
472
CHAPTER 19 512K-BIT (64 KB) FLASH MEMORY
19.6.2 Writing the Data
This section explains the procedure of issuing the write command and writing the data
to the flash memory. Figure 19.6-1 "Example of Procedure of Writing the Data to the Flash Memory" shows an example of procedure of writing data to the flash memory.
s Writing the Data
To activate the automatic data write algorithm of the flash memory, send the write command in
the command sequence table (See
Table 19.4-1 "Command Sequence Table") from the CPU to
the flash memory continuously. When the data write operation to the target address in the 4th
cycle has been terminated, the automatic algorithm is started for automatic writing.
s How to Specify the Address
Only even addresses can be specified as the write address in the write data cycle. If an odd
address is specified, data cannot be correctly written. That is, it is necessary to write the data in
units of words to even addresses.
Data can be written to the flash memory, and any address sequence may be specified, even if
data has been written across the sector boundary. However, only one-word data can be written
by executing the write command once.
s Notes on Writing the Data
It is not possible to convert the bit data from "0" back into "1" by reading data. If the bit data "1"
is written to the bit data "0", the data polling algorithm or toggle operation does not terminate
and the flash memory elements are determined to be defective. Then, the time limit exceeded
flag (DQ5) is set to "1" after the defined time for write operation has passed or the bit data "1"
appears to have been written but is not actually done. If data is read in the read/reset status,
the bit data read from the flash memory is "0". The erase operation is required to convert the bit
data from "0" back to "1".
All commands are ignored while automatic writing is being performed. Note that the data at the
address for writing is not assurred if the hardware is reset during automatic writing.
s Procedure of Writing the Data to the Flash Memory
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. Here, the data polling flag (DQ7) is used for verifying the end of writing.
The data reading for checking the flag is started from the last-written address. 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 even if the time limit exceeded flag (DQ5) is "1."
Similarly, 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.