Datasheet

Chapter 2 256 Kbyte Flash Module (S12FTS256K2V1)
MC9S12E256 Data Sheet, Rev. 1.10
112 Freescale Semiconductor
2.4.1.3.5 Mass Erase Command
The mass erase command is used to erase a Flash memory block using an embedded algorithm. If the Flash
block to be erased contains any protected area, the PVIOL flag in the FSTAT register will set and the mass
erase command will not launch. After the mass erase command has successfully launched, the CCIF flag
in the FSTAT register will set after the mass erase operation has completed unless a second command has
been buffered.
Figure 2-28. Example Mass Erase Command Flow
Write: Register FCLKDIV
Read: Register FCLKDIV
Bit FDIVLD set?
Write: Flash Block Address
Write: Register FCMD
Mass Erase Command 0x41
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
CCIF
Set?
Bit
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.
PVIOL
Set?
Bit
ACCERR
Set?
Bit
CBEIF
Set?
Bit