
2009 Microchip Technology Inc.
Advance Information
DS41297F-page 25
PIC18F2XK20/4XK20
4.2
Verify Code Memory and ID
Locations
The verify step involves reading back the code memory
space and comparing it against the copy held in the
programmer’s buffer. Memory reads occur a single byte
at a time, so two bytes must be read to compare
against the word in the programmer’s buffer. Refer to
reading code memory.
The Table Pointer must be manually set to 200000h
(base address of the ID locations) once the code
memory has been verified. The post-increment feature
of the table read 4-bit command can not be used to
increment the Table Pointer beyond the code memory
space. In a 64-Kbyte device, for example, a post-incre-
ment read of address FFFFh will wrap the Table Pointer
back to 000000h, rather than point to unimplemented
address 010000h.
FIGURE 4-2:
VERIFY CODE MEMORY FLOW
Read Low Byte
Read High Byte
Does
Word = Expect
data?
Failure,
Report
Error
All
code memory
verified?
No
Yes
No
Set TBLPTR = 0
Start
Set TBLPTR = 200000h
Yes
Read Low Byte
Read High byte
Does
Word = Expect
data?
Failure,
Report
Error
All
ID locations
verified?
No
Yes
Done
Yes
No
with Post-increment
Increment
Pointer
with Post-Increment