4.7.4 CONFIG4

Memory Write Protection

Note:
  1. Bits are implemented as sticky bits. Once protection is enabled, it can only be reset through a Bulk Erase.
Name: CONFIG4
Offset: 0x800A

Configuration Word 4

Bit 15141312111098 
   LVPWRTSAFWRTDWRTCWRTB 
Access R/PUR/PR/PR/PR/P 
Reset 111111 
Bit 76543210 
 WRTAPPSAFENBBENBBSIZE[2:0] 
Access R/PUUR/PR/PR/PR/PR/P 
Reset 11111111 

Bit 13 – LVP Low-Voltage Programming Enable bit

The LVP bit cannot be written (to zero) while operating from the LVP programming interface. The purpose of this rule is to prevent the user from dropping out of LVP mode while programming from LVP mode, or accidentally eliminating LVP mode from the Configuration state. The preconditioned (erased) state for this bit is critical.

ValueDescription
1Low-voltage programming enabled. MCLR/VPP pin function is MCLR. The MCLRE Configuration bit is ignored.
0HV on MCLR/VPP must be used for programming

Bit 11 – WRTSAF  Storage Area Flash Write Protection bit(1)

ValueDescription
1SAF not write-protected
0SAF write-protected

Bit 10 – WRTD  Data EEPROM Write Protection bit(1)

ValueDescription
1Data EEPROM not write-protected
0Data EEPROM write-protected

Bit 9 – WRTC  Configuration Register Write Protection bit(1)

ValueDescription
1Configuration Registers not write-protected
0Configuration Registers write-protected

Bit 8 – WRTB  Boot Block Write Protection bit(1)

ValueDescription
1Boot Block not write-protected
0Boot Block write-protected

Bit 7 – WRTAPP  Application Block Write Protection bit(1)

ValueDescription
1Application Block not write-protected
0Application Block write-protected

Bit 4 – SAFEN  SAF Enable bit(1)

ValueDescription
1SAF disabled
0SAF enabled

Bit 3 – BBEN  Boot Block Enable bit(1)

ValueDescription
1Boot Block disabled
0Boot Block enabled

Bits 2:0 – BBSIZE[2:0]  Boot Block Size Selection bits

BBSIZE is used only when BBEN = 0.

BBSIZE can only be written while BBEN = 1; after BBEN = 0, BBSIZ is write-protected.

Table 4-1. Boot Block Size Bits
BBENBBSIZEActual Boot Block Size User Program Memory Size (words)Last Boot Block Memory Access
PIC16(L)F18424/44
1xxx0
011151201FFh
0110102403FFh
0101-000204807FFh
Note: The maximum boot block size is half the user program memory size. All selections higher than the maximum are set to half size. For example, all BBSIZE = 000 - 100 produce a boot block size of 4 kW on a 8 kW device.
Bits are implemented as sticky bits. Once protection is enabled, it can only be reset through a Bulk Erase.