dsPIC33F/PIC24H PROGRAMMING SPECIFICATION
FIGURE 3-4:
FLOWCHART FOR
PROGRAMMING CODE
MEMORY
3.5.2
PROGRAMMING VERIFICATION
After code memory is programmed, the contents of
memory can be verified to ensure that programming
was successful. Verification requires code memory to
be read back and compared against the copy held in
the programmer’s buffer.
Start
The READPcommand can be used to read back all the
BaseAddress = 0x0
RemainingCmds = 1368
programmed code memory.
Alternatively, you can have the programmer perform
the verification after the entire device is programmed,
using a checksum computation.
Send PROGP
Command to Program
BaseAddress
3.5.3
CHECKSUM COMPUTATION
Only the Configuration registers are included in the
checksum computation. The Device ID and Unit ID are
not included in the checksum computation.
Is
No
PROGPresponse
PASS?
Table 3-2 shows how this 16-bit computation can be
made for each dsPIC33F and PIC24H device. Compu-
tations for read code protection are shown both
enabled and disabled. The checksum values shown
here assume that the Configuration registers are also
erased. However, when code protection is enabled,
the value of the FGS register is assumed to be 0x5.
Yes
RemainingCmds =
RemainingCmds – 1
BaseAddress =
BaseAddress + 0x80
Is
RemainingCmds
‘0’?
No
Yes
Failure
Report Error
Finish
DS70152D-page 36
Preliminary
© 2007 Microchip Technology Inc.