2010 Microchip Technology Inc. DS39583C-page 19
PIC18FXX20
3.5 Boot Block Programming
The Boot Block segment is programmed in exactly the
same manner as the ID locations (see Section 3.4).
Multi-panel writes must be disabled so that only
addresses in the range 0000h to 01FFh will be written.
The code sequence detailed in Figure 3-6 should be
used, except that the address data used in “Step 2” will
be in the range 000000h to 0001FFh.
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
8 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 Figure 3-7.
TABLE 3-7: SET ADDRESS POINTER TO CONFIGURATION LOCATION
FIGURE 3-10: CONFIGURATION PROGRAMMING FLOW
4-Bit
Command
Data Payload Core Instruction
Step 1: Direct access to config memory.
0000
0000
8E A6
8C A6
BSF EECON1, EEPGD
BSF EECON1, CFGS
Step 2: Position the program counter
(1)
.
0000
0000
EF 00
F8 00
GOTO 100000h
Step 3
(2)
: Set Table Pointer for config byte to be written. Write even/odd addresses.
0000
0000
0000
0000
0000
0000
1111
0000
0000
1111
0000
0E 30
6E F8
0E 00
6E F7
0E 00
6E F6
<LSB><MSB ignored>
00 00
2A F6
<LSB ignored><MSB>
00 00
MOVLW 30h
MOVWF TBLPTRU
MOVLW 00h
MOVWF TBLPRTH
MOVLW 00h
MOVWF TBLPTRL
Load 2 bytes and start programming
NOP - hold SCLK high for time P9
INCF TBLPTRL
Load 2 bytes and start programming
NOP - hold SCLK high for time P9
Note 1: If the code protection bits are programmed while the program counter resides in the same block, then the interaction of
code protection logic may prevent further table write. To avoid this situation, move the program counter outside the code
protection area (e.g., GOTO 100000h).
2: Enabling the write protection of configuration bits (WRTC = 0 in CONFIG6H) will prevent further writing of configuration
bits. Always write all the configuration bits before enabling the write protection for configuration bits.
Load Even
Configuration
Start
Program
Program
MSB
Done
Delay P9 Time
for Write
Delay P9 Time
for Write
LSB
Load Odd
Configuration
Address
Address
Done
Start