![](http://datasheet.mmic.net.cn/Freescale-Semiconductor/S9S12HZ128J3VAL_datasheet_99633/S9S12HZ128J3VAL_80.png)
Chapter 2 256 Kbyte Flash Module (FTS256K2V1)
MC9S12HZ256 Data Sheet, Rev. 2.05
80
Freescale Semiconductor
2.4.1.2
Command Write Sequence
The Flash command controller is used to supervise the command write sequence to execute program,
erase, erase verify, and data compress algorithms.
Before starting a command write sequence, the ACCERR and PVIOL flags in the FSTAT register must be
determine the state of the address, data, and command buffers. If the CBEIF flag is set, indicating the
buffers are empty, a new command write sequence can be started. If the CBEIF flag is clear, indicating the
buffers are not available, a new command write sequence will overwrite the contents of the address, data,
and command buffers.
A command write sequence consists of three steps which must be strictly adhered to with writes to the
Flash module not permitted between the steps. However, Flash register and array reads are allowed during
a command write sequence. A command write sequence consists of the following steps:
1. Write an aligned data word to a valid Flash array address. The address and data will be stored in
the address and data buffers, respectively. If the CBEIF ag is clear when the Flash array write
occurs, the contents of the address and data buffers will be overwritten and the CBEIF ag will be
set.
2. Write a valid command to the FCMD register.
of the data buffer are ignored and all address bits in the address buffer are ignored.
contents of the data buffer represents the number of consecutive words to read for data
compression and the contents of the address buffer represents the starting address.
data buffer will be programmed to the address specied in the address buffer with all address
bits valid.
of the data buffer are ignored and address bits [9:0] contained in the address buffer are ignored.
the data buffer and address buffer are ignored.
the contents of the data buffer and address buffer are ignored.
3. Clear the CBEIF ag by writing a 1 to CBEIF to launch the command. When the CBEIF ag is
cleared, the CCIF ag is cleared on the same bus cycle by internal hardware indicating that the
command was successfully launched. For all command write sequences except data compress and
sector erase abort, the CBEIF ag will set four bus cycles after the CCIF ag is cleared indicating
that the address, data, and command buffers are ready for a new command write sequence to begin.
For data compress and sector erase abort operations, the CBEIF ag will remain clear until the
operation completes.
A command write sequence can be aborted prior to clearing the CBEIF ag by writing a 0 to the CBEIF
ag and will result in the ACCERR ag being set.