2010-2015 Microchip Technology Inc. DS30009622M-page 31
PIC18F2XXX/4XXX FAMILY
3.4 ID Location Programming
The ID locations are programmed much like the code memory. The ID registers are mapped in addresses, 200000h
through 200007h. These locations read out normally even after code protection.
Table 3-8 demonstrates the code sequence required to write the ID locations.
In order to modify the ID locations, refer to the methodology described in Section 3.2.1 “Modifying Code Memory”.
As with code memory, the ID locations must be erased before being modified.
TABLE 3-8: WRITE ID SEQUENCE
3.5 Boot Block Programming
The code sequence detailed in Table 3-5 should be used, except that the address used in “Step 2” will be in the range
of 000000h to 0007FFh.
3.6 Configuration Bits Programming
Unlike code memory, the Configuration bits are programmed a byte at a time. The Table Write, Begin Programming 4-bit
command (‘1111’) is used, but only eight bits of the following 16-bit payload will be written. The LSB of the payload will be
written to even addresses and the MSB will be written to odd addresses. The code sequence to program two consecutive
configuration locations is shown in Table 3-9.
Note: The user only needs to fill the first 8 bytes of the write buffer in order to write the ID locations.
4-Bit
Command
Data Payload Core Instruction
Step 1: Direct access to code memory and enable writes.
0000
0000
8E A6
9C A6
BSF EECON1, EEPGD
BCF EECON1, CFGS
Step 2: Load write buffer with 8 bytes and write.
0000
0000
0000
0000
0000
0000
1101
1101
1101
1111
0000
0E 20
6E F8
0E 00
6E F7
0E 00
6E F6
<MSB><LSB>
<MSB><LSB>
<MSB><LSB>
<MSB><LSB>
00 00
MOVLW 20h
MOVWF TBLPTRU
MOVLW 00h
MOVWF TBLPTRH
MOVLW 00h
MOVWF TBLPTRL
Write 2 bytes and post-increment address by 2.
Write 2 bytes and post-increment address by 2.
Write 2 bytes and post-increment address by 2.
Write 2 bytes and start programming.
NOP - hold PGC high for time P9 and low for time P10.
Note: The address must be explicitly written for each byte programmed. The addresses can not be incremented
in this mode.