I like using the PICkit 2 with the PK2CMD.exe command line control. I can embedded it into any IDE with ease and automate the programming of the microcontroller through the PICkit 2 programmer. The limitation of the Microchip released PK2CMD vs the PICkit 2 GUI control was they used different device files and the PK2CMD didn't support as many devices as the GUI supported. The GUI supported more of the latest devices but neither supported the PIC18F25K22 which is an awesome device.
But several years ago a Microchip forum post by MichaelS explained that he figured out how to modify the PK2CMD to work with the device file for the GUI. So this meant that the PK2CMD v1.21 by MichaelS could support all the parts that the GUI supported. And if that GUI device list was ever updated, then the PK2CMD would also get updated by that same file.
The original set of files that are part of the MichaelS V1.21 .zip file include some documentation and files for mac and linux users but frankly I couldn't figure it all out. And I couldn't find a document that explained what devices are supported. So I used the PK2CMD command -?p to get a list to verify the PIC18F25K22 was supported. You can do the same by typing the command at the dos prompt
pk2cmd -?p
and it will list all the devices quickly. If you just want the PIC12 parts listed then type
pk2cmd -?p pic12
I simplified it all for Windows users and just placed the two main files you need, pk2cmd.exe and pk2devicefile.dat on my PICkit 2 page. Assuming you have the PK2CMD installed on a Windows machine, then just replace those two older files of the same name with these two new ones and you are set.
I typically use PICkit 3 and MPLAB X when I'm using my Mac for C code but for Basic Compilers I only use PICkit 2 with Windows and I also run XP through Parallels on my iMac.
Now if you are really in for a challenge, there are two guys who made their own PICkit 2 device file editors so you can add new parts as they are released. I haven't tried these out yet. You have to know the device ID and more information from the programming spec of the device to do this but here are the links if you want to try this out.
Jared Sanson Device Editor
Dougy83 Device Editor
These are not for the beginner and I really don't have the time or desire to dig too deep. I'm just happy I have a simple set of files that support many of the latest parts such as the
PIC12F1xxx
PIC16F18xx
PIC16F19xx
PIC18F25kxx
This is a great feature addition to the old PICkit 2.
I also found a site that has a ready made PICkit 2 Device file that reports to supporting the latest devices for a total of 678 devices. I still have to try that one out. It's added to my PICkit 2 page as well.
Whew!! That was a lot to cover in one blog post. I hope it was helpful.