PIC Programming with Linux

Mr. Lane has written a program called picprg to enable you to easily program a PIC microcontroller.
Reading a PIC

Make sure the programmer is connected and the processor is plugged in correctly. Press the R key from the main menu and the data from the processor will be read into the internal buffer; its clock type and fuse states will be displayed on the second line of the display. As it is reading, picprg will display every 16th address, just to let you know it is working correctly.

Programming a PIC

With the programmer connected and the processor plugged in the right direction, press P to start the programming process. The data in RAM will be written to the PIC and the third line will display “Programming PIC”. If any errors are found, they will be displayed with the address, the value read from the PIC during the failed verify and the value expected. Every 16th address it programs will be displayed, assuring you that it is still working.

From this point, it's up to you to learn how to write programs for the PIC. Many useful sites which can help you on your way are on the Internet; David Tait's list of PIC resources is the best starting point.

Resources

Brian Lane lives with his wife Denise in Olalla, Washington. He spends his days developing embedded software and his nights writing Linux code. He can be contacted at nexus@tatoosh.com or http://www.tatoosh.com/nexus/.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Using a Pickit2

Anonymous's picture

Here is a guide but is in spanish for programming a pic in C:
http://jorge.saad.com.mx/?p=106

New Version - v2.3.0 Available Now

brianlane's picture

I have just relesed v2.3.0, which works with the v2.2.x and v2.4.x kernels. You can download it from the picprg homepage

Also, my homepage has changed to http://www.brianlane.com

Brian Lane

Re: New Version - v2.3.0 Available Now

Anonymous's picture

Many thanks for developing this IMMENSELY useful programming tool! With any luck, my university will be using this in the years to come.

Re: New Version - v2.3.0 Available Now

brianlane's picture

Thanks! If you guys come up with any improvements please feel free to pass them on to me. I plan to revise the program sometime this year to add support for more of the PIC processors.

Brian

VPP40 ?

TJ's picture

Prorammers like the PIC16PRO40, which allows programming different sized chips depending on their placement in sockets, has an extra control line labelled VPP40 (prog enable for 40 pin chips versus the other sizes).

Is it possible picprg could be extened to support the extra (optional) control line? If you like I could work it out, but I haven't looked at the code yet so don't know what I'd be biting off... and experience tells me its usually better to ask the source (no pun).

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix