The error-protect state can be cleared only by a reset or entry to hardware standby mode.
Note:
*
It is possible to write to these registers. Note that a transition to software standby mode
initializes these registers.
Figure 18-19 Flash Memory State Transitions in Modes 5, 6 and 7 (On-Chip ROM
Enabled) when Programming Voltage (V
PP
) is Applied
The purpose of error-protect mode is to prevent overprogramming or overerasing damage to flash
memory by detecting abnormal conditions that occur if the programming or erasing algorithm is
not followed, or if a program crashes while the flash memory is being programmed or erased.
This protection function does not cover abnormal conditions other than the setting conditions of
the flash memory error bit (FLER), however. Also, if too much time elapses before the error-
protect state is reached, the flash memory may already have been damaged. This function
accordingly does not offer foolproof protection from damage to flash memory.
To prevent abnormal operations, when programming voltage (V
PP
) is applied, follow the
programming and erasing algorithms correctly, and keep microcontroller operations under
constant internal and external supervision, using the watchdog timer for example. If a transition to
error-protect mode occurs, the flash memory may contain incorrect data due to errors in
P = 1 or E = 1
P = 0 and E = 0
Error occurs
RES = 0 or STBY = 0
or software standby
RES = 1 and STBY = 1
and not software standby
RES = 0 or
STBY = 0
Error occurs
(software standby)
RES = 0 or
STBY = 0
Software
standby
Software standby
cleared
RES = 0 or
STBY = 0
RD:
VF:
PR:
ER:
RD:
VF:
PR:
ER:
INIT.:
Memory read enabled
Verify read enabled
Programming enabled
Erase enabled
Memory read disabled
Verify read disabled
Programming disabled
Erase disabled
Initialized state of registers (FLMCR, EBR1, EBR2)
Memory read
or verify mode
Program mode
or erase mode
Reset or standby
(hardware protect)
Error-protect mode
(software standby)
Error-protect mode
RD VF PR ER
FLER = 0
RD VF PR ER
FLER = 0
RD VF PR ER
FLER = 1
RD VF PR ER
INIT.
FLER = 1
RD VF PR ER
INIT.
FLER = 0
609