Chapter 4 Memory

An example flow to execute the sector erase operation is shown in Figure 4-13. The sector erase command write sequence is as follows:

1.Write to an aligned 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 the data written is 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, FSTAT[FPVIOL] is set and the sector erase command does not launch. After the sector erase command has successfully launched and the sector erase operation has completed, FSTAT[FCCF] is set.

START

Read: FCDIV register

Clock Register

FDIVLD

WrittenSet? Check

yes

 

no

Note: FCDIV needs to

 

 

 

be set after each reset

 

 

 

 

 

 

 

 

Write: FCDIV register

 

 

 

 

 

 

 

Read: FSTAT register

Command

FCBEF

no

Buffer Empty Check

Set?

 

 

 

 

 

 

yes

 

 

 

 

 

 

 

 

 

 

 

Access Error and

FACCERR/FPVIOL

yes

Protection Violation

 

Set?

Check

no

 

 

 

 

1.

 

Write: Flash Sector Address

 

and Dummy Data

 

 

 

 

 

 

 

 

Write: FSTAT register

Clear FACCERR/FPVIOL 0x30

2.

3.

Write: FCMD register

Sector Erase Command 0x40

Write: FSTAT register

Clear FCBEF 0x80

Read: FSTAT register

Bit Polling for

FCCF

no

Command Completion

Set?

 

 

Check

 

 

 

 

 

yes

 

 

 

EXIT

 

Figure 4-13. Example Sector Erase Command Flow

MCF51QE128 MCU Series Reference Manual, Rev. 3

Freescale Semiconductor

85

Get the latest version from freescale.com

Page 85
Image 85
Freescale Semiconductor MCF51QE128RM manual Example Sector Erase Command Flow