Beginners Guide To Programming A PIC

Jump to: navigation, search

Here you will find guides on how to perform basic programming of a PIC.

How to guides and videos

File:How to program a PIC.pdf: Please note that this guide uses a PICKit2, The most common PIC programmer among DIYC members, but the process should be very similar for other PIC's and programmers.

File:PICKit III.pdf: Guide for using a PICKit III to program a PIC using a "HEX" file. The first few screens would be the same for the "ASM" file but then you should be able to use Waynes videos for the "project creation". You should also be able to use this for the diagnostic firmware, just change the file name that you select in the file browser. Made by Mmulvenna

WayneJ's video series on PIC programming: For those that prefer to see it done in a video.

Microchip PIC References: Other information and tutorials on PICs.

PIC Programming Hints: Hints to programming PICs.

Gooligum PIC Programming tutorial series

Where to buy Programmers

Depending on the controller design you will either need just a programmer like the Pickit2 or you will also need a ZIF socket to program the PIC. If the controller has an ICSP header then you do not need a ZIF socket, but it is a good idea to purchase one.
Pickit2 and 14pin ZIF socket from DIYC user J1sys
Pickit2 clone with built in ZIF socket from DIYC user tjetzer
Pickit2 clone with ZIF socket from EBay
Zif socket only Useful if you want to buy the socket later and for multiple sizes.

Software to Program PICs

The PICKIt2 is used to download a .HEX file to the PIC. Frequently the software is availble in .ASM format, that will need to be compiled using a compiler as shown above in the documents and videos. If firmware is available in an assembly file (.asm) file that needs to be compiled and built with Microchip's free MPLAB IDE software or MPLAB X IDE.

If you have never compiled firmware before, there is an excellent series of tutorials available above.

Older versions of MPLAB IDE may not support some of the newer PICs like the 16F1825 PIC and you my need to update the MPLAB IDE to a later version.

If you are just looking to download a .hex file to a PIC, you can use the easier PICKIT2 software. You may also have to update the PICKIT2 software to support the 16F1825. Version 2.61 supports the 16F1825 PIC and allows you to program the firmware into the PIC. While you are updating the PICKIT 2 software, you might want to also download the latest device file Version 1.62.14 and replace the file in the PICKIT 2 program directory with this file.