PIC18F2XXX/4XXX FAMILY
DS30009622M-page 34 2010-2015 Microchip Technology Inc.
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
4.3 Verify Configuration Bits
A configuration address may be read and output on PGD via the 4-bit command, ‘1001’. Configuration data is read and
written in a byte-wise fashion, so it is not necessary to merge two bytes into a word prior to a compare. The result may
then be immediately compared to the appropriate configuration data in the programmer’s memory for verification. Refer
to Section 4.1 “Read Code Memory, ID Locations and Configuration Bits” for implementation details of reading
configuration data.
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
2010-2015 Microchip Technology Inc. DS30009622M-page 35
PIC18F2XXX/4XXX FAMILY
4.4 Read Data EEPROM Memory
Data EEPROM is accessed, one byte at a time, via an Address Pointer (register pair: EEADRH:EEADR) and a data
latch (EEDATA). Data EEPROM is read by loading EEADRH:EEADR with the desired memory location and initiating a
memory read by appropriately configuring the EECON1 register. The data will be loaded into EEDATA, where it may be
serially output on PGD via the 4-bit command, ‘0010’ (Shift Out Data Holding register). A delay of P6 must be introduced
after the falling edge of the 8th PGC of the operand to allow PGD to transition from an input to an output. During this
time, PGC must be held low (see Figure 4-4).
The command sequence to read a single byte of data is shown in Table 4-2.
FIGURE 4-3: READ DATA EEPROM FLOW
TABLE 4-2: READ DATA EEPROM MEMORY
4-Bit
Command
Data Payload Core Instruction
Step 1: Direct access to data EEPROM.
0000
0000
9E A6
9C A6
BCF EECON1, EEPGD
BCF EECON1, CFGS
Step 2: Set the data EEPROM Address Pointer.
0000
0000
0000
0000
0E <Addr>
6E A9
OE <AddrH>
6E AA
MOVLW <Addr>
MOVWF EEADR
MOVLW <AddrH>
MOVWF EEADRH
Step 3: Initiate a memory read.
0000 80 A6 BSF EECON1, RD
Step 4: Load data into the Serial Data Holding register.
0000
0000
0000
0010
50 A8
6E F5
00 00
<MSB><LSB>
MOVF EEDATA, W, 0
MOVWF TABLAT
NOP
Shift Out Data
(1)
Note 1: The <LSB> is undefined. The <MSB> is the data.
Start
Set
Address
Read
Byte
Done
No
Yes
Done?
Move to TABLAT
Shift Out Data
PIC18F2XXX/4XXX FAMILY
DS30009622M-page 36 2010-2015 Microchip Technology Inc.
FIGURE 4-4: SHIFT OUT DATA HOLDING REGISTER TIMING (0010)
4.5 Verify Data EEPROM
A data EEPROM address may be read via a sequence of core instructions (4-bit command, ‘0000’) and then output on
PGD via the 4-bit command, ‘0010’ (TABLAT register). The result may then be immediately compared to the appropriate
data in the programmer’s memory for verification. Refer to Section 4.4 “Read Data EEPROM Memory” for
implementation details of reading data EEPROM.
4.6 Blank Check
The term Blank Check means to verify that the device has no programmed memory cells. All memories must be verified:
code memory, data EEPROM, ID locations and Configuration bits. The Device ID registers (3FFFFEh:3FFFFFh) should
be ignored.
A “blank” or “erased” memory cell will read as ‘1’. Therefore, Blank Checking a device merely means to verify that all bytes
read as FFh, except the Configuration bits. Unused (reserved) Configuration bits will read 0’ (programmed). Refer to
Figure 4-5 for blank configuration expect data for the various PIC18F2XXX/4XXX Family devices.
Given that Blank Checking is merely code and data EEPROM verification with FFh expect data, refer to Section 4.4 “Read
Data EEPROM Memory” and Section 4.2 “Verify Code Memory and ID Locations” for implementation details.
FIGURE 4-5: BLANK CHECK FLOW
1234
PGC
P5
PGD
PGD = Input
Shift Data Out
P6
PGD = Output
5678
1234
P5A
91011 13 15161412
Fetch Next 4-Bit Command
0100
PGD = Input
LSb
MSb
12
34
56
1234
nnnn
P14
Yes
No
Start
Blank Check Device
Is
device
blank?
Continue
Abort

PIC18F4510-E/ML

Mfr. #:
Manufacturer:
Microchip Technology
Description:
8-bit Microcontrollers - MCU 32KB 1536 RAM 36I/O
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union