EasyManua.ls Logo

ROHS MC9S08QE128 - Page 84

Default Icon
345 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 4 Memory
MC9S08QE128 MCU Series Reference Manual, Rev. 2
84 Freescale Semiconductor
An example flow to execute the sector erase operation is shown in Figure 4-19. The sector erase command
write sequence is as follows:
1. Write to a flash block address to start the command write sequence for the sector erase command.
The flash address written determines the sector to be erased while global address bits [8:0] and the
data written are ignored.
2. Write the sector erase command, 0x40, to the FCMD register.
3. Clear the FCBEF flag in the FSTAT register by writing a 1 to FCBEF to launch the sector erase
command.
If a flash sector to be erased is in a protected area of the flash block, the FPVIOL flag in the FSTAT register
will set and the sector erase command will not launch. Once the sector erase command has successfully
launched, the FCCF flag in the FSTAT register will set after the sector erase operation has completed.
Figure 4-19. Example Sector Erase Command Flow
Write: Flash Sector Address
Write: FCMD register
Write: FSTAT register
1.
2.
3.
Write: FSTAT register
yes
no
Access Error and
no
Bit Polling for
Read: FSTAT register
yes
Read: FSTAT register
no
START
yes
FCBEF
Set?
Command
FCCF
Set?
FACCERR/FPVIOL
Set?
Write: FCDIV register
Read: FCDIV register
yes
no
Clock Register
FDIVLD
Set?
NOTE: FCDIV needs to
Written
Check
Protection Violation
Check
Buffer Empty Check
and Dummy Data
Sector Erase Command 0x40
Clear FCBEF 0x80
Clear FACCERR/FPVIOL 0x30
Command Completion
Check
EXIT
be set after each reset

Table of Contents