PIC16F87/88
3.8
Protection Against Spurious Write
3.9
Operation During Code Protect
There are conditions when the device should not write
to the data EEPROM memory. To protect against spu-
rious EEPROM writes, various mechanisms have been
built-in. On power-up, WREN is cleared. Also, the
Power-up Timer (72 ms duration) prevents an
EEPROM write.
When the data EEPROM is code protected, the micro-
controller can read and write to the EEPROM normally.
However, all external access to the EEPROM is
disabled. External write access to the program memory
is also disabled.
When program memory is code protected, the micro-
controller can read and write to program memory nor-
mally, as well as execute instructions. Writes by the
device may be selectively inhibited to regions of the
memory depending on the setting of bits WRT1:WRT0
of the configuration word (see Section 15.1 “Configu-
ration Bits” for additional information). External
access to the memory is also disabled.
The write initiate sequence and the WREN bit together
help prevent an accidental write during brown-out,
power glitch, or software malfunction.
TABLE 3-1:
REGISTERS/BITS ASSOCIATED WITH DATA EEPROM AND
FLASH PROGRAM MEMORIES
Value on
Power-on
Reset
Value on
all other
RESETS
Address Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
10Ch
10Dh
10Eh
10Fh
EEDATA EEPROM/FLASH Data Register Low Byte
EEADR EEPROM/FLASH Address Register Low Byte
xxxx xxxx uuuu uuuu
xxxx xxxx uuuu uuuu
--xx xxxx --uu uuuu
---- -xxx ---- -uuu
EEDATH
EEADRH
—
—
—
—
EEPROM/FLASH Data Register High Byte
—
—
—
EEPROM/FLASH Address
Register High Byte
18Ch
18Dh
0Dh
EECON1 EEPGD
—
—
FREE WRERR WREN
WR
RD
x--x x000 x--x q000
---- ---- ---- ----
00-0 ---- 00-0 ----
00-0 ---- 00-0 ----
EECON2 EEPROM Control Register 2 (not a physical register)
PIR2
PIE2
OSFIF
CMIF
—
—
EEIF
EEIE
—
—
—
—
—
—
—
—
8Dh
OSFIE CMIE
Legend:
x= unknown, u= unchanged, - = unimplemented, read as ‘0’, q= value depends upon condition.
Shaded cells are not used by data EEPROM or FLASH program memory.
DS30487B-page 34
Preliminary
2003 Microchip Technology Inc.