Programming PICs and EEPROMs



In-Circuit Serial Programming

The standard Microchip PICkit programming connector is a 6-pin header that connects to the target device, otherwise called ICSP connector as referred in Microchip In-Circuit Serial Programming.


Here is the typical ICSP application schematic.

 

PICkit 2

 

There are many PIC programmer available, commercial and DIY devices. As Microchip introduces the new microprocessors the programming software has to be updated accordingly playing catch-up with the PIC manufacturer. That is the root of the problem with third-party PIC programmers. Microchip's PICkit 2 is the low cost ICSP programmer for Flash PICs with USB interface introduced by Microchip. Only subset of PIC microcontrollers is supported, but the list includes most of devices from PIC16, PIC18 and PIC24 families and covers many the PICs you are likely want to use. It is fully integrated with Microchip’s MPLAB IDE and allow not only program but debug applications as well. As alternative you can use the standalone programmer applet, see picture below. Even though Microchip hasn't updated the list of supported devices since 2013 there is user-contributed effort to add the new devices to it, see Updating the list of PICkit devices section.

 

The PICkit 2 has USB bootloader and capable of updating the programmer firmware. The firmware and schematic are freely available. Apparently Microchip has made the open design intentionally, see it as the way to boost using the popularity PIC microprocessors. With such simplicity of design it is easy to build a clone version. My first PIC programmer was Melabs EPIC device with parallel port interface. After upgrading my PC I have realized that parallel port became legacy these days, as the most of new PC motherboards do not have it all. The another annoying part about Melabs programmers in general is that even if you buy the full package (hardware + software) upgrades are not free and only beta stuff available for download. I have successfully burned all my PIC18 and PIC24 chips using PICkit 2 and would definitely recommend it. The PICkit 2 UI software available for download here.



PICkit 3

PICkit 3 introduced as successor of PICkit 2 and using the same PK2DeviceFile.dat device definition file and build around PIC24FJ256GB106 device. The Microchip states that the PICkit 3 differs from the PICkit 2 by providing:

  • Extended EE program image space (512 Kbytes)
  • True voltage reference
  • Increased voltage range (1.8-5V VDD; 1.8-14V VPP)
  • Doesn't have standalone programming application and can be used only with Microchip IDE

Note: As of now both PICkit 2 and PICkit 3 were phased out and Microchip moved to PICkit 4 and Snap even though PICKit3 is still supporting in MPLAB X IDE. The PICkit 3 UI software available for download here.


Updating the list of PICkit devices

Both PICkit2 and PICkit3 programmers using the same PK2DeviceFile.dat file with all the data required to program each device. The last official version of this file was v1.62.15 as part of PICkit v3.1 distribution and goes back to '12. However, there is freely available PICkit device editor and the new devices can be added to the list. Do not go for version 1.0.0.7 though, it's broken! Stay on 1.0.0.6.

There is a third party effort to continue PICkit 3 support, but I am not aware of any release past v1.63.155. Here is an unofficial update v1.63.155 for PK2DeviceFile.dat. I have tested some devices, like PIC16F1454, PIC16F1455 and PIC18F25K80. Updating the device part numbers is tricky and required consulting Microchip data sheets, see an example here.



Programming EEPROMs

Both PICkit2 and PICkit3 can also program EEPROMs. The schematic for programming 24LC I2C serial EEPROMs is show below.

The pull-up resistor with value 2.2K is required as the corresponding PICkit pin is open-drain. I took me about half an hour to build the adapter using the stripboard.

There are some modifications required for PICkit 3 to program I2C devices, see the explanation from readme.txt

NOTE: The I2C (24LC) Serial EEPROM devices require the following PICkit 3 hardware changes to work properly:
   Remove TR3 from the PICkit 3.
   Remove R50 from the PICkit 3.

You can check PICKit 2 readme / PICKit 3 readme for connecting the particular EEPROM for programming.