In-Circuit Programming Using The Microchip ICD2

The Microchip ICD2 is a great low cost USB programmer we recommend for carrying out in circuit firmware programming and upgrades of Microchip microcontrollers.  There are a large number of programmers that will also be suitable, however this procedure deals with the Microchip ICD2.

Ensure your PC is running the latest version of MPLAB IDE (V7.# or higher which may be downloaded from www.microchip.com) – this must be installed before connecting the ICD2 programmer to the PC.

  1. Connect the ICD 2 programmer to your PC using its USB cable (do not connect its power supply – it will take its power from the USB port).  If it is the first time it has been connected wait for Windows to finish installing the USB drivers.  Then run the Microchip MPLAB IDE software.
  2. From the menu select:- ‘Configure’ > ‘Select Device’ > Select the device you are programming (you can find this in the manufacture documentation, on the circuit diagram or by looking at the part number on the PCB).
  3. From the menu select:- ‘Programmer’ > ‘Select Programmer’ > ‘ICD2′
  4. From the menu select:- ‘Programmer’ > ‘Settings’.  Ensure that ‘Allow ICD2 to select memories and ranges’ IS checked in the ‘Program’ tab:

icp-with-icd2-11

  1. Select the Power tab and, unless directed otherwise in the IBEX manufacture documentation, made sure the ‘Power target circuit from MPLAB ICD2′ is NOT checked.  Press ‘Apply’ and then ‘OK’ to close the window
  2. From the menu select:- ‘File’ > ‘Import’ > Select the ROM firmware file to be used ([filename].hex).

Then for each PCB to program follow the following procedure:

  1. Disconnect power from the PCB if it is powered.
  2. Connect the ICD2 to the ‘Programming’ header, ensuring pin 1 of the ICD2 cable (marked on connector) connects to pin 1 of the PCB connector (indicated by 2 arrows on our PCB’s).   (If connecting to a 7 pin PCB header then pins 6 & 7 will be un-connected)
  3. Power the PCB (always after connecting the ICD2 to it).
  4. Press the ‘Program Target Device’ button in MPLAB.

  1. Watch the ‘Output’ window and wait for programming and verifying to complete.
  2. Disconnect the PCB power.
  3. Disconnect the ICD2 programming lead from the PCB
  4. Re-power the PCB
  5. Verify the correct operation of the PCB using the new firmware

This guide isn’t extensive and Microchip may have altered their software since it was written.  If you run into problems please contact us.

If you have problems with programming continually failing then check your programming cable from the ICD2 to the PCB. Problems have been experienced in the past with cables that appear fine when tested with a continuity tester but due to poor connections would cause programming to inexplicably fail.  If in doubt make a new cable to be sure this is not the problem.

USEFUL?
We decided to help other designers and engineers by opening up many of our companies internal notes and libraries through mini sites like this. We benefit hugely from resources on the web and feel we should give back some of our knowledge and resources to the community. If you find this site helpful all we ask in return is that you consider adding a link back to any page on this site somewhere on the web. Link ins massively help towards this site appearing in search engine results, allowing other engineers to find it more quickly and of course giving us a bit of that sweet Google juice! Thanks.