Datasheet
2010 Microchip Technology Inc. DS39622L-page 25
PIC18F2XXX/4XXX FAMILY
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
Section 4.1 “Read Code Memory, ID Locations and
Configuration Bits” for implementation details of
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 may not be used to
increment the Table Pointer beyond the code memory
space. In a 64-Kbyte device, for example, a
post-increment read of address, FFFFh, will wrap the
Table Pointer back to 000000h, rather than point to the
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
with Post-Increment
Increment
Pointer
with Post-Increment
with Post-Increment