2 Device Programming – ICSP

ICSP mode is a special programming protocol that allows reading and writing to the device memory of the dsPIC33CK256MC006 devices. The ICSP mode is the most direct method used to program the device, which is accomplished by applying control codes and instructions serially to the device using the PGECx and PGEDx pins. ICSP mode also has the ability to read the contents of the executive memory to determine if the Programming Executive is present, and to write the Programming Executive to executive memory if it is missing. Then, Enhanced ICSP mode will be used.

In ICSP mode, the system clock is taken from the PGECx pin, regardless of the device’s Oscillator Configuration bits. All instructions are shifted serially into an internal buffer, then loaded into the Instruction Register (IR) and executed. No program fetching occurs from internal memory. Instructions are fed in 24 bits at a time. PGEDx is used to shift data in, and PGECx is used as both the serial shift clock and the CPU execution clock.

Note:
  1. During ICSP operation, the operating frequency of PGECx must not exceed 5 MHz.
  2. ICSP mode is slower than Enhanced ICSP mode for programming.