This schematic is intended for demonstration purposes only.
More code and circuits are here.
The "U2 Programmer" is unit is a very nice PIC programmer developed by microEngineering Labs, Inc. It has a USB connector and a 10-pin programming connector. The unit is powered from the USB port. All timing and programming is controlled by an on-board PIC microcontroller. The programmer's firmware may be upgraded from the PC. Commands and data are received from the PC at high rates that never leave it starved for data. It will program a PIC as fast as Microchip specifications allow. Because it's based on a PIC it can drive up to 25mA to help overcome loading conditions associated with the RB6, RB7, and MCLR on the in-circuit-programming-port (ICSP) of the PIC being flashed. The microEngineering U2 Programmer has proved to be a robust programming platform for my projects.
USB programmer photo sourced at Melabs web site.
My hardware implementation
Although melabs sells a small box for the U2 Programmer I installed it in my own plastic box with two ZIF sockets and a reset pushbutton.
microEngineering Labs advises against powering application hardware from their on-board 5V regulator, but it appears that the regulator is quite capable of powering a PIC during programming in the stand-alone ZIF socket. Hence my implementation routes the +5VDC to the two ZIF sockets but not to my ICSP connector.
One ZIF socket is for 28 and 40-pin PICs. The other is for 8, 14, and 18-pin PICs. A good alternative to building up a custom box such as mine is to buy one or more of the melabs adapters.
The reset button is intended for when the ICSP cable is connected and when MCLR is enabled in the PIC. It's helpful during project debug when the application doesn't have a reset button of it's own. The 100 ohm resistor prevents a direct short to the programmer's electronics.
The black RJ-12 (telephone) jack is used for cable connection to the ICSP connector on my boards.
Accommodating Low Voltage Programming mode
Certain PIC's such as the 16F628 need to have their PGM pins tied low during programming to ensure that Low Voltage Programming is disabled while programming with the U2 Programmer. The symptom of LVP issues during programming is a message box that pops up stating that there is a "programming error at address xxxx." Since the PGM pin is tri-stated during programming, it's therefore vulnerable to electrical noise. Both on-board ZIF sockets have the PGM pins tied to ground through a 1K resistor for this purpose, illustrated in the following schematic, but if using the ICSP cable to program such parts in the application socket, you need to ensure that the PGM pin will be effectively pulled low. In some applications, you might be able to ground it directly. Other applications might require a 1K or 100K resistor, depending on what the pin is being used for.
The software is well-designed and straightforward. It includes a command line interface so that the software can be invoked directly from the CCS Compiler and other programs.
Photo sourced at Melabs web site.
Pleasant and kind folks! Reponsive! Fast updates to add new devices! Great support!