Information

dsPIC33F/PIC24H PROGRAMMING SPECIFICATION
DS70152H-page 32 © 2010 Microchip Technology Inc.
5.0 DEVICE PROGRAMMING – ICSP
ICSP mode is a special programming protocol that
allows you to read and write to dsPIC33F/PIC24H
device family memory. The ICSP mode is the most
direct method used to program the device; however,
note that Enhanced ICSP is faster. ICSP mode also
has the ability to read the contents of executive
memory to determine if the programming executive is
present. This capability is accomplished by applying
control codes and instructions serially to the device
using pins PGCx and PGDx.
In ICSP mode, the system clock is taken from the
PGCx pin, regardless of the device’s oscillator Config-
uration bits. All instructions are shifted serially into an
internal buffer, then loaded into the instruction register
and executed. No program fetching occurs from inter-
nal memory. Instructions are fed in 24 bits at a time.
PGDx is used to shift data in, and PGCx is used as both
the serial shift clock and the CPU execution clock.
5.1 Overview of the Programming
Process
Figure 5-1 illustrates the high-level overview of the
programming process. After entering ICSP mode, the
first action is to Bulk Erase the device. Next, the code
memory is programmed, followed by the device
Configuration registers. Code memory (including the
Configuration registers) is then verified to ensure that
programming was successful. Then, program the
code-protect Configuration bits, if required.
FIGURE 5-1: HIGH-LEVEL ICSP™
PROGRAMMING FLOW
Note: Any development tool that modifies the con-
figuration memory on dsPIC33FJ06GS101/
102/202, dsPIC33FJ16GS402/404/502/
504, dsPIC33FJ32GS406/606/608/610 and
dsPIC33FJ64GS406/606/608/610 devices
must take care to preserve the data con-
tained in the last six words of program mem-
ory. Refer to Appendix C: “Diagnostic and
Calibration Registers” for more
information.
Note: During ICSP operation, the operating
frequency of PGCx must not exceed
5MHz.
Start
Perform Bulk
Erase
Program Memory
Verify Program
End
Enter ICSP™
Program Configuration Bits
Verify Configuration Bits
Exit ICSP