Chapter 3 4 Kbyte EEPROM Module (S12XEETX4KV2)
MC9S12XDP512 Data Sheet, Rev. 2.11
Freescale Semiconductor 169
3.4.2.5 Sector Erase Abort Command
The sector erase abort operation will terminate the active sector erase or sector modify operation so that
other sectors in an EEPROM block are available for read and program operations without waiting for the
sector erase or sector modify operation to complete.
An example flow to execute the sector erase abort operation is shown in Figure 3-19. The sector erase abort
command write sequence is as follows:
1. Write to any EEPROM memory address to start the command write sequence for the sector erase
abort command. The address and data written are ignored.
2. Write the sector erase abort command, 0x47, to the ECMD register.
3. Clear the CBEIF flag in the ESTAT register by writing a 1 to CBEIF to launch the sector erase abort
command.
If the sector erase abort command is launched resulting in the early termination of an active sector erase
or sector modify operation, the ACCERR flag will set once the operation completes as indicated by the
CCIF flag being set. The ACCERR flag sets to inform the user that the EEPROM sector may not be fully
erased and a new sector erase or sector modify command must be launched before programming any
location in that specific sector. If the sector erase abort command is launched but the active sector erase or
sector modify operation completes normally, the ACCERR flag will not set upon completion of the
operation as indicated by the CCIF flag being set. If the sector erase abort command is launched after the
sector modify operation has completed the sector erase step, the program step will be allowed to complete.
The maximum number of cycles required to abort a sector erase or sector modify operation is equal to four
EECLK periods (see Section 3.4.1.1, “Writing the ECLKDIV Register”) plus five bus cycles as measured
from the time the CBEIF flag is cleared until the CCIF flag is set.
NOTE
Since the ACCERR bit in the ESTAT register may be set at the completion
of the sector erase abort operation, a command write sequence is not
allowed to be buffered behind a sector erase abort commandwrite sequence.
The CBEIF flag will not set after launching the sector erase abort command
to indicate that a command should not be buffered behind it. If an attempt is
made to start a new command write sequence with a sector erase abort
operation active, the ACCERR flag in the ESTAT register will be set. A new
command write sequence may be started after clearing the ACCERR flag, if
set.
NOTE
The sector erase abort command should be used sparingly since a sector
erase operation that is aborted counts as a complete program/erase cycle.