English
Language : 

PIC18F2331_10 Datasheet, PDF (279/392 Pages) Microchip Technology – 28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High-Performance PWM and A/D
PIC18F2331/2431/4331/4431
23.5 Program Verification and
Code Protection
The overall structure of the code protection on the
PIC18 Flash devices differs significantly from other
PIC® devices.
The user program memory is divided into five blocks.
One of these is a Boot Block of 512 bytes. The
remainder of the memory is divided into four blocks on
binary boundaries.
Each of the five blocks has three code protection bits
associated with them. They are:
• Code-Protect bit (CPn)
• Write-Protect bit (WRTn)
• External Block Table Read bit (EBTRn)
Figure 23-5 shows the program memory organization
for 8 and 16-Kbyte devices, and the specific code
protection bit associated with each block. The actual
locations of the bits are summarized in Table 23-3.
FIGURE 23-5:
CODE-PROTECTED PROGRAM MEMORY FOR PIC18F2331/2431/4331/4431
MEMORY SIZE/DEVICE
Block Code Protection
Controlled By:
8 Kbytes
(PIC18F2331/4331)
Boot Block
Block 0
Block 1
Address
Range
0000h
0FFFh
0200h
0FFFh
1000h
1FFFh
Unimplemented
Read ‘0’s
3FFFh
16 Kbytes
(PIC18F2431/4431)
Boot Block
Block 0
Block 1
Block 2
Block 3
Address
Range
0000h
01FFh
0200h
0FFFh
1000h
1FFFh
2000h
2FFFh
3000h
3FFFh
CPB, WRTB, EBTRB
CP0, WRT0, EBTR0
CP1, WRT1, EBTR1
CP2, WRT2, EBTR2
CP3, WRT3, EBTR3
TABLE 23-3: SUMMARY OF CODE PROTECTION REGISTERS
File Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
300008h CONFIG5L
—
—
—
—
CP3(1) CP2(1)
300009h CONFIG5H CPD
CPB
—
—
—
—
30000Ah CONFIG6L
—
—
—
—
WRT3(1) WRT2(1)
30000Bh CONFIG6H WRTD WRTB WRTC
—
—
—
30000Ch CONFIG7L
—
—
—
—
EBTR3(1) EBTR2(1)
30000Dh CONFIG7H —
EBTRB
—
—
—
—
Legend: Shaded cells are unimplemented.
Note 1: Unimplemented in PIC18F2331/4331 devices; maintain this bit set.
Bit 1
CP1
—
WRT1
—
EBTR1
—
Bit 0
CP0
—
WRT0
—
EBTR0
—
 2010 Microchip Technology Inc.
DS39616D-page 279