English
Language : 

MC9S12Q128_10 Datasheet, PDF (524/644 Pages) Freescale Semiconductor, Inc – HCS12 Microcontrollers
Chapter 18 64 Kbyte Flash Module (S12FTS64KV4)
START
Read: FCLKDIV register
Clock Register
Written
Check
FDIVLD
no
Set?
NOTE: FCLKDIV needs to
be set once after each reset.
yes
Write: FCLKDIV register
Read: FSTAT register
Address, Data,
Command
Buffer Empty Check
CBEIF
no
Set?
yes
Access Error and
Protection Violation
Check
ACCERR/
PVIOL
Set?
no
yes
Write: Flash Sector Address
1. and Dummy Data
Write: FSTAT register
Clear ACCERR/PVIOL 0x30
2.
Write: FCMD register
Sector Erase Command 0x40
3.
Write: FSTAT register
Clear CBEIF 0x80
Read: FSTAT register
Bit Polling for
Command Completion
Check
CCIF
Set?
no
yes
EXIT
Figure 18-24. Example Sector Erase Command Flow
524
MC9S12Q128
Freescale Semiconductor
Rev 1.10