475
19.6 Detailed Explanation on the Flash Memory Write/Erase
19.6.4 Erasing the Data (Sector Erase)
This section explains the procedure of issuing the sector erase command and erasing
any sector from the flash memory. This command enables each sector to be erased,
and two or more sectors to be specified at the same time.
s Erasing the data (Sector erase)
To erase an arbitrary sector from the flash memory, send the sector erase command in the
command sequence table (See
Table 19.4-1 "Command Sequence Table") from the CPU to the
flash memory.
s Method of Specifying a Sector
The sector erase command is executed by executing the bus operation six times. The sector
erase wait of 50
s is started by writing the sector erase code (30
H) to any accessible even
address in the target sector in the 6th-cycle bus operation. To erase two or more sectors, the
erase code (30H) should be written to the address in the target sector just after the above
operation.
s Notes on Specifying Two or More Sectors
The erase operation is started after the last sector erase code is written and the sector erase
wait period of 50
s is terminated. Thus, the next erase sector address and erase code (i.e. in
the 6th cycle of the command sequence) must be input each within 50
s to erase two or more
sectors simultaneously, which may not be accepted later than 50
s. It can be checked whether
the succeeding sector erase code write operation is valid, using the sector erase timer flag
(DQ3). In this case, the address from which the sector erase timer flag (DQ3) is read must
indicate the sector to be erased.
s Procedure of Erasing a Sector
Using the hardware sequence flag (see Section
19.5 "Confirming the Automatic Algorithm
Execution State"), the status of the automatic algorithm within the flash memory can be
determined.
Figure 19.6-2 "Example of Procedure of Erasing the Sector from the Flash
Memory" shows an example of procedure of erasing the sector from the flash memory. Here,
the toggle bit flag (DQ6) is used for verifying the end of writing. Note that data to be used for
checking the flag is read from the sector to be erased.
The toggle bit flag (DQ6) stops the toggle operation at the same time when the time limit
exceeded flag (DQ5) is changed to "1", so the toggle bit flag (DQ6) must be rechecked even if
the time limit exceeded flag (DQ5) is "1."
Similarly, the data polling flag (DQ7) is changed at the same time when the time limit exceeded
flag (DQ5) is changed, so the data polling flag (DQ7) must be rechecked.