ICD2 Programmer & Debugger

ICD2 programmer board

Here I am using the assembly designed and manufactured by Chapslab.com for which I have slightly redesigned the PCB in order to be able to integrate it into a HAMMOND box ref. 1591 , easier to obtain than the one originally offered. However, this requires some cutouts in the corners of the card in order to be able to integrate it into its box.
I wrote this article in agreement with its author, whom I warmly thank for his kindness and his availability.


For those who do not know the ICD2 ( In Circuit Debugger 2 ), it is an interface which allows programming and debugging PIC microcontrollers from a PC.

This project is an ICD2 which is a bit simplified compared to the Microchip version. The goal is not to exactly remake a clone ( because it is necessary to start on a double layer PCB with vias and to find uncommon components like Cypress CY7C64613 ). The one presented here is much simpler, with common components ( except perhaps the FT232R but it is quite possible to make a serial version with a MAX232 ).

The main characteristics are as follows:

  • ICD2 seen as an original by MPLAB
  • Compatible with future versions of MPLAB since it uses its firmware ( Auto update via MPLAB )
  • USB bus powered
  • Possibility of supplying the target ( max 400mA )
  • DC / DC converter to generate the VPP programming voltage ( adjustable between +11 and + 15V )
  • RJ12 connector identical to that of Microchip ( cable length 20-30cm maximum because of possible interference )


Two main components are at the heart of this assembly: a PIC 16F876 ( A ) which contains the bootloader ( see "realization" ) and the firmware that MPLAB installs according to the series of PIC that we debug.
The other component is the brand new FT232RL from FTDI Chip which provides USB-RS232 conversion ( TTL levels ) to communicate with the PC. Therefore, this ICD2 is not really USB, but it is seen by MPLAB through the serial port, as if the original is connected through its serial port. The advantage of still being in USB is twofold: on the one hand the serial ports disappear on recent PCs, on the other hand the USB bus makes it possible to supply the ICD as well as reasonable consumption targets, which is very practical.

Construction files

Two versions of the ICD2-like firmware are available to you. They differ only by the PIC used, the PIC 16F876 or the PIC 16F876 A ( the internal programming differs slightly between the two versions, hence the different firmware ):

save"Standard" versionmd5s logo : 1ecdc511aeee8193f9b7d84c71a70f9c
save "A" versionmd5s logo : ac8858f12f1139958aa0ac1555be3050

Schematic & PCB

Diagram of ICD2

The PCB is a single-sided circuit, with 2 straps:


saveEagle files md5s logo : 5a97ea7e5ef8f8eecdb784f1eb217f74

ICD2 component side view

ICD2 welded side view
ICD2 assembled in its box

You will find below the list of components used as well as their references at Farnell:
saveList of components md5s logo : 7acde43a13780e90c31860d42ca6abbc


Not having the necessary material to manufacture printed circuits, I had mine made by a small company . Request a quote by e-mail with an image of the PCB in TIFF / 600dpi format as an attached file, for example, they respond very quickly.

The bootloader makes it possible, once the ICD is connected to MPLAB, to reprogram the PIC ( write the program memory ) in order to load the firmware corresponding to the family of PICs chosen ( 12F, 16F, 18F, ... ).
It is therefore necessary to have a PICs programmer to program the bootloader.

For my part, I used my PiCée development model photo of my ProtoPic2840 modelas well as my ProtoPic2840 development board , which I then use to test my small applications. The PiCée card having a programmer with a serial interface in situ, I use a PCMCIA / RS232 adapter card ( we can also find it on Amazon.fr for about thirty euros ... ) on my laptop.
→ Since the design of my copy, I have added an ICSP connector to my PICée card ...

You must begin by programming the PIC with a bootloader, using Ic-Prog for example.

The PIC 16F876 ( A ) is a CMS ( surface mount ) component, and to program the bootloader I used a 28 pin CMS / DIL adapter bracket purchased from Farnell. It is not necessary to solder all the legs, only the power supplies / ground / MCLR / RB6 / RB7 are necessary.
Also taking into account the very small step of the FT232RL circuit, it is desirable to use a magnifying glass, or even a magnifying lamp. even more comfortable!

Note : the choke presented here is a CMS version, but mounted as a through component. It suffices for that to weld 2 legs recovered from a resistance according to the step of 5.08mm and voila ( the range of CMS chokes is much larger than the classic chokes ). Here is an overview of the assembly:

CMS self photo

If you prefer a tarversant component, here is the 5.08mm pitch model for you:

photo of the self

Programming the PIC 16F876 (A)
It is not useful to check the fuses, leave them as shown below:

Ic Prog
Preferably use the Com1 or Com2 ports for your USB-Serial link , in order to avoid compatibility problems with MPLAB.
If both are already used by other interfaces, you will need to rename one to Com3 for example ...

logo_windowsDevelopment tool under Windows: MPLAB
You will obviously have to connect your ICD to a target development model, otherwise nothing is possible ...
A small test plate with pellets ( or even better with a breadboard... ) with a PIC and the few components around to make it work, and voila!

Start MPLAB , then select [ Programmer ], [ Select Programmer ] and [ MPLAB ICD 2 ] options .
Start the connection between MPLAB and the ICD2 using the [ Programmer ] and [ Connect ] commands , then [ Programmer ] and [ Settings ].
You must now adjust the programming voltage VPP to + 13V using the trimmer P1, voltage that can be measured on the cathode of D1.
That's all ! If you do not have a voltmeter, you can always use this screen to adjust it by activating the [ Update ] key:

MPLAB Settings 2a

Programming the Firmware
The file should be in the directory (C: \ Program Files \ Microchip \ MPLAB IDE \ ICD2), but if for you this is not the case, I offer it for download below:

saveFirmware file md5s logo : 72539d9bd3e6b92193f984e6226d0a1c

Start MPLAB , then select the [ Debugger ], [ Select Tool ] and [ MPLAB ICD 2 ] options . Click on [ Connect ], and finally on [ donwload operating system ]. Optionally select the file type (ICD2 16F / 12F Firmware Files) then the firmware file (ICD01020704.hex) to download, it will then be programmed in the PIC 16F876 ( A ).
Let the procedure end by itself, your PIC 16F876 ( A ) is then finally ready.

Be careful, however, during the first donwload operating system, you must set the Baudrate of the port used to 19200 bauds . Subsequently, you can easily switch it back to 57600 baud to debug.

You can control the result of the operation by viewing these parameters:

MPLAB Settings 1a

logo_linuxDevelopment tool for Linux: Piklab
Linux kernels of version 2.6.31 or greater include the latest FT232 virtual port emulation drivers. So there is nothing special to install. The corresponding port for Windows COM x is the / dev / ttyS x device .

You will obviously have to connect your ICD to a target development model, otherwise nothing is possible ...
A small test board with a PIC and the few components around so that it can work, and voila!

You can download Piklab directly from the developer's site , or if you are on Ubuntu, install it using Synaptics for example.
screenshot of Piklab
Start Piklab , then select [ Scheduler ] and [ Connect ], then [ Scheduler ] and [ Advanced ].

You must now adjust the programming voltage VPP to + 13V using the trimmer P1, voltage that can be measured on the cathode of D1.
That's all ! If you do not have a voltmeter, you can always use this screen to adjust it by activating the [ Read ] key located to the right of (Vpp of the programmer):

screenshot of Piklab

connector The ICD2 link connector has a 6-pin RJ12 socket on one side and a 5-pin connector conforming to the "Microchip" standard on the other.

ICSP connection diagram

plan of my Pic development system with ICD2
Variant for VPP
Some micro-controllers do not accept too much a voltage higher than the admissible one, for example the P18F45K22 which requires a maximum voltage of 9V for VPP.
So I made a small modification with components mounted as a "flywheel", as shown in the diagram below:
Diagram of the modified voltage step-up of the ICD2 ...
So, by switching switch S1, I can select my VPP voltage to + 9V or + 13V.
photo of the modified case ...
I give you here the main oscillograms read directly on my ICD2, it can be useful if yours does not work
Measurement conditions
  • ICD2 connected to the USB port of the PC
  • The model to be programmed ( necessary for proper operation ) powered and connected to the RJ12 socket of the ICD2
  • MPLAB launched and initialized with the PIC present on the model to be programmed: menu option [Configure] then [Select Device]
  • The oscilloscope probe in position x10
  • The 2 measurements on the RJ12 socket were carried out with an already programmed PIC, by selecting the read function: [Program] then [Read] in the MPLAB menu
IC3 LM3578 pin6 IC2 P16F876 MCLR Power On pin1 IC2 P16F876 MCLR Connect pin1 IC2 P16F876 RxD Connect pin17 IC2 P16F876 TxD Connect pin18
IC2 P16F876 RTS Connect pin25 IC2 P16F876 CTS Connect pin26 J2 RJ12 Reading pin3 J2 RJ12 Reading pin6  
For information only, the ICD2 set cost me in December 2010 around 70 € including cables and box.
In comparison with the original from Microchip DV164005 - MPLAB ICD 2 MODULE (with USB cables & ICD interface) which selling price is $ 199.99 ...
Downloadable elements of the project

I address to the author Chapslab.com of this very practical tool my deepest thanks for his precious help and his availability during the troubleshooting and commissioning of my ICD2, as well as for his authorization to put it online. of this article in my personal site.
Add comment
  • No comments found

Quelques liens vers les sites de mes amis...

Licence Creative Commons

L'ensemble de ce site hormis une notification spécifique est mis
à  disposition selon les termes de la Licence Creative Commons
Attribution - Pas d'Utilisation Commerciale - Partage dans les Mêmes Conditions
3.0 France.
Licence Creative Commons

Les Fabricants de Circuits Imprimés que j'utilise

Mes fournisseurs favoris

Vérifiez la disponibilité de votre nom de domaine :