Microchip ICD2 In Circuit Debugger

© Brooke Clarke, N6GCE

Microchip ICD2 & PIC Protoboard


My Precision Clock was behaving in strange ways and the In Circuit Debugger looks like a good way to see what's going on.  The older ICD will work on the 16F870 that I started using for this clock, but Microchip is introducing a new ICD2 that will have much more capability but does not support the 16F870.  It does however support the 16F873A which is a drop in replacement with much more memory and that helps the ICD.  So the plan is to use the 16F873A for debug and development and switch back to the 16F870 for production.

Microchip ICD2 web site -

Burning Firmware methods

18 Nov 2002 - ICD2 now working.  Needed to download MPLAB 6.10.00, follow the USB instructions, update the ICD firmware.

When using the ICD it's necessary to have a project with compiled code then you must program the target PIC.  You can not use a PIC with just the target program installed.  This is becasue additional code is loaded into the PIC to support the debug process.  When using View ->file Registers you can type in the first letter of the variable or file you want which is way way easier than trying to use the scroll bar.

There appears to be a bug in the skip over command, it jumped over two instructions rather than just one.

My target clock uses RB6 and RB7 as digit driver lines going to the gates of some hexfets.  When the debugger code is installed into the PIC these lines no longer work for display and so far I have not determined how to load just the desired application code.

21 Dec 2002 - There are seperate top tabs for selecting your programmer and debugger.  If the debugger is set to "none" and the ICD2 is set as the development programmer then you could load the target chip with just the application code and not the additinal debug code.  MPLAB will you to have the ICD2 used for either Debugging (where it loads the extra code) or Probramming (where it does not add the debugger code), but not both.  If you try to enable both MPLAB will direct to to close the other one.

21 Dec 2002 - Using ICD2 as a programmer for the 12F675 requires removing the LEDs that I have connected directly to GP0 and GP1.
The Microchip web site says that when any erase operation is done on the 12F765 ALL the memory is erased.  This is not acceptable for my application where I need the data EEPROM to remain intact when the program code is burned in.

19 Nov 2002 - MPLAB ICD 2 Firmware Version 1.03.00, November 6, 2002 supports the following chips:

PIC12F629*(1) PIC12F675*(1)

PIC16F630*(2) PIC16F676*(2)PIC16F818* PIC16F819* PIC16F870* PIC16F871* PIC16F872* PIC16F873* PIC16F873A* PIC16F874* PIC16F874A* PIC16F876* PIC16F876A* PIC16F877* PIC16F877A*

PIC18C601 PIC18C801 PIC18F1220* PIC18F1320* PIC18F2220* PIC18F2320* PIC18F242 PIC18F248 PIC18F252 PIC18F258  PIC18F4220* PIC18F4320* PIC18F442 PIC18F448  PIC18F452 PIC18F458 PIC18F6620* PIC18F6720* PIC18F8620* PIC18F8720*

* Indicates new part support in this release. For information on full support vs. beta support, see the MPLAB IDE Device Selection dialog.
(1) - AC152050 required. or see Hardware below for modular connector
(2) - AC162052 required. or see Hardware below for modular connector


The DV164006  Kit that I got came with the PICDEM2+ but did not include the AC162049 Universal Programming module that is an interface with the 6P6C socket and a socket to allow this adapter to be placed between a DIP packaged PIC and it's socket.  The related AC162050 for the 18F629/675 and the AC162051 Header interface are also NOT included.


    ICD2 to Target Interface

6 Position 6 Contact (6P6C) phone socket on target board.  The 6P6C is wider than a standard telephone RJ-11 2C4P modular connector and narrower than a CAT5 LAN 8P8C connector.
6-pin modular socket, it is an AMP/TYCO Electronics part # 520470-4 (Digikey part # A9049-ND)
The Jameco p/n 124038 comes with wire leads that can be soldered into via holes on an existing board making conversion to ICD easier.
The Jameco p/n 115836 is very similar to the AMP socket
6P6C pin #
PIC pin
 8 pin PIC
Jameco 124038
wire color
RB7/PG Data
RB6/PG Clock
not used
not used
* these two pins are reversed in DS41190A for the 12F629 & 12F675


10 k Ohm pull up on MCLR so that the ICD can force 0, +5, +13 volts on this pin.
RB6 and RB7 used for serial clock and data between target and ICD2 module

Target Firmware

Address 0000, a NOP was recommended for the first ICD, but the factory says that it's not needed with ICD2, I have it there anyway.

MPLAB Version

5.70.40 - does not support ICD2 with 16F873A
6.00.20 - needed for ICD2 and 16F873A
            - needed for USB instead of complex serial interface between computer and ICD2
6.10.00 - Available Dec 2002

Independent use of the Debug functions in the chip

Microchip is not talking about what the on chip circuitry does.

Back to Brooke's Products for Sale, Electronics, Military Information, Home page

This is the  time this page has been accessed since since 7 November 2002