Tools & Downloads   /   Programmers & ICSP

Microcontroller In Circuit Serial Programming (ICSP) with Microchip PIC

In Circuit Serial Programming is a method of directly programming a Microchip PIC or Atmel AVR while in they are connected to a circuit, as opposed to programming the chip ahead, and only then soldering it to a circuit. There are many benefits to ICSP, but also some important design considerations which I will try to highlight.

Published
Updated

At a glance

CategoryProgrammers & ICSP
IncludesCircuit diagram
Reading time~4 min
Jump to a section
  1. How to prepare your circuit to work with ICSP?
  2. Common Microchip PIC ICSP layouts
  3. Additional reading and references
  4. Quick Solutions to Questions related to ICSP:
  5. Related projects

Summary of Microcontroller In Circuit Serial Programming (ICSP) with Microchip PIC

In-Circuit Serial Programming (ICSP) allows direct programming of Microchip PIC or Atmel AVR chips while connected to a circuit, eliminating the need for chip removal. Key benefits include shortened development cycles, in-field firmware upgrades, system calibration, and unique ID assignment. Successful implementation requires using dedicated pins for PGC/ICSPCLK, PGD/ICSPDAT, and MCLR/VPP. When sharing pins, isolation via Schottky diodes, R/C networks, or resistors (1k-10k) is necessary to handle high voltages and signal interference.

Parts used in ICSP:

  • Microchip PIC
  • Atmel AVR
  • Programming clock (PGC or ICSPCLK)
  • Programming data (PGD or ICSPDAT)
  • MCLR/VPP pin
  • Schotkey diode
  • R/C network
  • Resistors (1k to 10k)
  • ICSP header

In circuit programming has many advantages:

  • It shortens the development cycle – it is really annoying to take a chip out of the board each time it needs to be reprogrammed, and it’s even much harder with SMD.
  • Allows customer and in field firmware upgrades
  • Calibrate the system during manufacturing or in the field
  • Assign unique ID \ serial number to productMicrocontroller In Circuit Serial Programming (ICSP) with Microchip PIC

How to prepare your circuit to work with ICSP?

The programmer uses serial signaling scheme to program the chip in circuit. The signaling is carried through the programming clock (PGC or ICSPCLK) and the programming data (PGD or ICSPDAT) pins. In addition, the MCLR/VPP pin is used as either a high voltage programming signal or an attention indicator to the device.

Wherever application allows, use dedicated pins for ICSP. It will save you much trouble. Not sharing a pin both for ICSP and I/O for example, minimizes the preparation work which needs to be done to allow ICSP.

Often, and especially true with low pin devices, it is not possible to dedicate the 3 needed pins just for ICSP, and when want them to have dual functionality.

In this case:

1. Isolate Vpp from the circuit by using a Schotkey diode and an R/C. NOTE: in some devices, like the PIC12F629, this pin will be driven to about 13 volts by the programmer while programming the device. Make sure whatever is connected to the Vpp pin can sustain this voltage level, or isolate it with an appropriate resistor or a Schotkey diode.Microcontroller In Circuit Serial Programming (ICSP) with Microchip PIC schematic

2. Isolate ICSP_Clock and ICSP_Data from the rest of the circuit. The isolation method is application specific, which unfortunately means there is no ready recipe.  Often, a resistive isolation works fine. Recommended resistor values are 1k to 10k.

3. Physically locate the ICSP header as close as possible to the programmed chip, to reduce attenuation.

Common Microchip PIC ICSP layouts

Additional reading and references

  • Microchip PICKit 2  manual
  • Microchip In-Circuit Serial Programming™ (ICSP™ ) Guide
  • ICSP in wikipedia

For more detail: Microcontroller In Circuit Serial Programming (ICSP) with Microchip PIC

  • What are the main advantages of In-Circuit Serial Programming?
    It shortens the development cycle, allows customer and in-field firmware upgrades, enables system calibration during manufacturing, and permits assigning unique IDs.
  • How does the programmer signal the chip during ICSP?
    The signaling is carried through the programming clock (PGC or ICSPCLK) and the programming data (PGD or ICSPDAT) pins.
  • What role does the MCLR/VPP pin play?
    It is used as either a high voltage programming signal or an attention indicator to the device.
  • Can I share ICSP pins with general I/O functions?
    Yes, but it requires specific isolation methods because many low pin devices do not allow dedicated pins for ICSP.
  • How should Vpp be isolated if shared with the circuit?
    Isolate Vpp from the circuit by using a Schottky diode and an R/C network to protect components from up to 13 volts.
  • What is the recommended method to isolate ICSP Clock and Data?
    Often, a resistive isolation works fine with recommended resistor values between 1k and 10k.
  • Where should the ICSP header be physically located?
    Locate the ICSP header as close as possible to the programmed chip to reduce attenuation.
  • Does ICSP work with SMD components?
    Yes, ICSP makes reprogramming much easier compared to removing SMD chips from the board.
Programmers & ICSP

Calculator Test using PIC24FJ64GA006 with Proteus Simulation

Introduction The Calculator Test using EASYHDL is a practical microcontroller project built on the PIC24FJ64GA006 and simulated in Proteus. This project demonstrates...

Programmers & ICSP

PID Controlled Oven using TMS320F28027PT with Proteus Simulation

IntroductionThis project demonstrates a PID controlled oven implemented using a PICCOLO TMS320F28027PT microcontroller and verified through Proteus simulation.It is a practical microcontroller...

Programmers & ICSP

PICCOLO Motor Controller Sample Design using TMS320F28023PT with Proteus Simulation

IntroductionThis project demonstrates a PICCOLO motor controller sample design implemented using the TMS320F28023PT Piccolo microcontroller and tested through Proteus simulation. It focuses...

Programmers & ICSP · PIC16F84A

PIC Musical Doorbell using PIC16F84A with Proteus Simulation

IntroductionThis microcontroller project demonstrates a musical doorbell built around a PIC16F84A and a simple piezo sounder.Using two push buttons, the system allows...

Programmers & ICSP · PIC16F877A

EPE PIC/LCD Demo using PIC16F877 with Proteus Simulation

IntroductionThe EPE PIC/LCD Demo is a classic microcontroller project that demonstrates how a PIC16F877 can fully control a PG12864F graphical LCD.Designed as...

Programmers & ICSP · PIC16F628A

DHT11 Low Cost Humidity Sensor using PIC16F628A with Proteus Simulation

IntroductionThis microcontroller project demonstrates how to interface a low-cost DHT11 temperature and humidity sensor with a PIC16F628A using a Proteus simulation environment.The...

Ibrar Ayyub

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough...