PIC Programming Protocol - Building a custom PIC programmer - Page 1
Forum section: electronics / general

author: Rendon
author_rank: Newbie
timestamp: November 25, 2015, 09:22:13 am
content: I am wanting to build myself a custom-made PIC programmer, which will use a windows GUI that I will create myself. Presently, I use a PICkit 2 with its standalone GUI. It's good, but there are features I would like to add.The only issue is, I don't know the programming protocol. I imagine the transaction of data takes place over an I^2C bus. I obviously have to feed it character by character, and then do checks, but I do not know the protocol. I do not know how to read data, like the config bytes or the device type.I did a google search for this information but I found nothing useful. Is there anyone who could point me to this information? I just need an overview; I can take care of the intricacies myself.

author: FrankBuss
author_rank: Unknown
timestamp: November 25, 2015, 09:35:10 am
content: See here:http://www.microchip.com/TechDoc.aspx?type=Programming

author: Ian.M
author_rank: Super Contributor
timestamp: November 25, 2015, 09:50:40 am
content: Microchip have more variations of their programming protocol than you can shake a stick at. Apart from a small handful of obsolete legacy OTP EPROM devices, they are all vaguely SPI like with a bidirectional data line and a clock line provided by the programmer, and instead of a /CS chip select, an active high VPP and in some cases a PGM signal. Some PICs need 12.5V to enter programming mode, some less, and some just need a normal logic '1' on Vpp with a special code sequence clocked in on the data line. There is no single document that gives all the programming specs. You have to trawl though the datasheets for indovidual devices to see which ones have the same programming spec. If you want to support more than a few individual devices, its a PITA just gathering the data!However the whole PICkit 2 system except for the MPLAB 8/X driver interface is open source - that's the firmware, the standalone Windows GUI, and the cross-platform command line utility, + the full schematic is published so why re-invent the wheel? You can add whatever you need to the software, (as long as that isn't support for 3rd party chips, which Microchip does take action against).

author: MarkF
author_rank: Super Contributor
timestamp: November 25, 2015, 11:02:20 am
content: Here are some direct Microchip PICKit2 source code links I found on their forum:Standalone (GUI) application source codeFirmware source codePK2CMD v1.21 RC1Here is theMicrochip Downloads Archive(see bottom of the page for PICkit2).

author: neslekkim
author_rank: Super Contributor
timestamp: November 25, 2015, 11:31:28 am
content: And SuzyC on the forum here have some threads about pic programminghttps://www.eevblog.com/forum/microcontrollers/help!!!-why-can't-i-program-my-pic18f25k22-id's/

author: Rendon
author_rank: Newbie
timestamp: November 25, 2015, 11:42:41 am
content: Thanks guys. You've been very helpful. I may come across as ignorant - and perhaps I am. I actually did a google search for the PicKit 2 GUI source code some while back, couldn't find it, and gave up. Thanks so much for the link! I'm really glad to have it :-)

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: November 25, 2015, 05:35:36 pm
content: What features do you want to add?