470
20.4.7
Prewrite Verify Mode
Prewrite-verify mode is a verify mode used when programming all bits to equalize their threshold
voltages before erasing them.
Program all flash memory to H'00 by writing H'00 using the prewrite algorithm shown in figure
20.10. H'00 should also be written when using RAM for flash memory emulation (when
prewriting a RAM area). (This also applies when using RAM to emulate flash memory erasing
with an emulator or other support tool.) After the necessary programming time has elapsed, exit
program mode (by clearing the P bit to 0) and select prewrite-verify mode (leave the P, E, PV, and
EV bits all cleared to 0). In prewrite-verify mode, a prewrite-verify voltage is applied to the
memory cells at the read address. If the flash memory is read in this state, the data at the read
address will be read. After selecting prewrite-verify mode, wait 4 μs or more before reading.
Note:
For a sample prewriting program, see the prewrite subroutine in the sample erasing
program.
20.4.8
Protect Modes
Flash memory can be protected from programming and erasing by software or hardware methods.
These two protection modes are described below.
Software Protection:
Prevents transitions to program mode and erase mode even if the P or E bit
is set in the flash memory control register (FLMCR). Details are as follows.
Function
Protection
Description
Program
Erase
Verify
*
1
Block
protect
Individual blocks can be protected from erasing
and programming by the erase block registers
(EBR1 and EBR2). If H'00 is set in EBR1 and in
EBR2, all blocks are protected from erasing and
programming.
Disabled
Disabled
Enabled
Emulation
protect
*
2
When the RAMS or RAM0 bit, but not both,
is set in the wait-state control register (WSCR),
all blocks are protected from programming and
erasing.
Notes:
*
1 Three modes: program-verify, erase-verify, and prewrite-verify.
*
2 Except in RAM areas overlapped onto flash memory.
*
3 All blocks are erase-disabled. It is not possible to specify individual blocks.
Disabled
Disabled
*
3
Enabled