Datasheet
Chapter 2 256 Kbyte Flash Module (S12FTS256K2V1)
MC9S12E256 Data Sheet, Rev. 1.10
Freescale Semiconductor 111
2.4.1.3.4 Sector Erase Command
The sector erase command is used to erase the addressed sector in the Flash memory using an embedded
algorithm. If the Flash sector to be erased is in a protected area of the Flash block, the PVIOL flag in the
FSTAT register will set and the sector erase command will not launch. After the sector erase command
has successfully launched, the CCIF flag in the FSTAT register will set after the sector erase operation has
completed unless a second command has been buffered.
Figure 2-27. Example Sector Erase Command Flow
Write: Register FCLKDIV
Read: Register FCLKDIV
Bit FDIVLD set?
Write: Flash Sector Address
Write: Register FCMD
Sector Erase Command 0x40
Write: Register FSTAT
yes
no
Clear bit CBEIF 0x80
yes
Clock Register
Loaded
Check
1.
2.
3.
Clear bit ACCERR 0x10
Write: Register FSTAT
no
yes
no
Protection
Violation Check
Access
Error Check
Read: Register FSTAT
no
no
Address, Data,
Command
Buffer Empty Check
Next Write?
yes
EXIT
no
and Dummy Data
Clear bit PVIOL 0x20
Write: Register FSTAT
yes
Bit Polling for
Command
Completion Check
Read: Register FSTAT
yes
NOTE: command write sequence
aborted by writing 0x00 to
FSTAT register.
NOTE: command write sequence
aborted by writing 0x00 to
FSTAT register.
CCIF
Set?
Bit
PVIOL
Set?
Bit
ACCERR
Set?
Bit
CBEIF
Set?
Bit
