
504
CHAPTER 20 1M-BIT (128KB) FLASH MEMORY
20.6.4 Erasing Optional Data (erasing sectors) in Flash Memory
This section describes the procedure for issuing the Sector Erase command to erase
optional data (erase sector) in the flash memory. Individual sectors can be erased.
Multiple sectors can also be specified at one time.
s Erasing Optional Data (erasing sectors) in the Flash Memory
Optional sectors in the flash memory can be erased by sending the Sector Erase command in
"Starting the Flash Memory Automatic Algorithm") continuously to the target sector in the flash
memory.
r Specifying sectors
The Sector Erase command is executed in six bus operations. Sector erase wait of 50
s is
started by writing the sector erase code (30H) to an accessible even-numbered address in the
target sector in the sixth cycle. To erase multiple sectors, write the erase code (30H) to the
addresses in the target sectors after the above processing operation.
r Notes on specifying multiple sectors
Erase is started when the sector erase wait period of 50
s terminates after the final sector
erase code has been written. That is, to erase multiple sectors at one time, an erase code
(sixth cycle of the command sequence) must be written within 50
s of writing of the address of
a sector and the address of the next sector must be written within 50
s of writing of the
previous erase code. Otherwise, the address and erase code may not be accepted. The sector
erase timer (hardware sequence flag DQ3) can be used to check whether writing of the
subsequent sector erase code is valid. At this time, specify so that the address used for reading
the sector erase timer indicates the sector to be erased.
s Erasing Sectors in the Flash Memory
The hardware sequence flags (see Section
20.5 "Confirming the Automatic Algorithm Execution
State") can be used to determine the state of the automatic algorithm in the flash memory.
Figure 20.6-2 "Example of the Flash Memory Sector Erase Procedure" an example of the
procedure for erasing sectors in the flash memory. Here, the toggle bit flag (DQ6) is used to
confirm that erasing has terminated.
The data that is read to check the flag is read from the sector to be erased.
The toggle bit flag (DQ6) stops the toggle operation at the same time that the timing limit
exceeded flag (DQ5) is changed to 1. For example, even if the timing limit exceeded flag (DQ5)
is 1, the toggle bit flag (DQ6) must be rechecked.
The data polling flag (DQ7) also changes at the same time that the timing limit exceeded flag bit
(DQ5) changes. As a result, the data polling flag (DQ7) must be rechecked.