...
programmed memory locations. A blank or erased
device information that cannot be erased. The device
Check. Additionally, all unimplemented memory space
should be ignored from the Blank Check.
command is used for the Blank Check. It
these memory regions. A 鈥楤LANK鈥?or 鈥楴OT BLANK鈥?/div>
response is returned. If it is determined that the device
is not blank, it must be erased before attempting to
program the chip.
Code memory is programmed with the
PROGP
command.
PROGP
programs one row of code memory
starting from the memory address specified in the
command. The number of
PROGP
commands required
to program a device depends on the number of write
blocks that must be programmed in the device.
A flowchart for programming code memory is shown in
Figure 3-4. In this example, all 88K instruction words of
a dsPIC33F/PIC24H device are programmed. First, the
number of commands to send (called 鈥楻emainingC-
mds鈥?in the flowchart) is set to 1368 and the destination
address (called 鈥楤aseAddress鈥? is set to 鈥?鈥? Next, one
write block in the device is programmed with a
PROGP
command. Each
PROGP
command contains data for
one row of code memory of the dsPIC33F/PIC24H.
After the first command is processed successfully,
鈥楻emainingCmds鈥?is decremented by 鈥?鈥?and compared
with 鈥?鈥? Since there are more
PROGP
commands to
send, 鈥楤aseAddress鈥?is incremented by 0x80 to point to
the next row of memory.
On the second
PROGP
command, the second row is
programmed. This process is repeated until the entire
device is programmed..
Note:
If a bootloader needs to be programmed,
the bootloader code must not be pro-
grammed into the first page of code mem-
ory. For example, if a bootloader located at
address 0x200 attempts to erase the first
page, it would inadvertently erase itself.
Instead, program the bootloader into the
second page, e.g. 0x400.
漏
2007 Microchip Technology Inc.
Preliminary
DS70152D-page 35