
PIC16F870/871
DS30569B-page 32
2003 Microchip Technology Inc.
3.10
FLASH Program Memory Write
Protection
The configuration word contains a bit that write protects
the FLASH program memory, called WRT. This bit can
only
be
accessed
when
programming
the
PIC16F870/871 devices via ICSP. Once write protec-
tion is enabled, only an erase of the entire device will
disable it. When enabled, write protection prevents any
writes to FLASH program memory. Write protection
does not affect program memory reads.
TABLE 3-1:
READ/WRITE STATE OF INTERNAL FLASH PROGRAM MEMORY
TABLE 3-2:
REGISTERS ASSOCIATED WITH DATA EEPROM/PROGRAM FLASH
Configuration Bits
Memory Location
Internal
Read
Internal
Write
ICSP Read
ICSP Write
CP1
CP0
WRT
00
x
All program memory
Yes
No
01
0
Unprotected areas
Yes
No
Yes
No
01
0
Protected areas
Yes
No
01
1
Unprotected areas
Yes
No
01
1
Protected areas
Yes
No
10
0
Unprotected areas
Yes
No
Yes
No
10
0
Protected areas
Yes
No
10
1
Unprotected areas
Yes
No
10
1
Protected areas
Yes
No
11
0
All program memory
Yes
No
Yes
11
1
All program memory
Yes
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR, BOR
Value on
all other
RESETS
0Bh, 8Bh,
10Bh, 18Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
10Dh
EEADR
EEPROM Address Register, Low Byte
xxxx xxxx
uuuu uuuu
10Fh
EEADRH
—
EEPROM Address, High Byte
xxxx xxxx
uuuu uuuu
10Ch
EEDATA
EEPROM Data Register, Low Byte
xxxx xxxx
uuuu uuuu
10Eh
EEDATH
—
EEPROM Data Register, High Byte
xxxx xxxx
uuuu uuuu
18Ch
EECON1
EEPGD
—
WRERR
WREN
WR
RD
x--- x000
x--- u000
18Dh
EECON2 EEPROM Control Register2 (not a physical register)
—
Legend:
x
= unknown, u = unchanged, r = reserved, - = unimplemented, read as '0'.
Shaded cells are not used during FLASH/EEPROM access.
Note
1:
These bits are reserved; always maintain these bits clear.