Datasheet

106
6120F–ATARM–03-Oct-06
AT91SAM7X512/256/128 Preliminary
Figure 19-5. Command State Chart
In order to guarantee valid operations on the Flash memory, the field Flash Microsecond Cycle
Number (FMCN) in the Flash Mode Register MC_FMR must be correctly programmed (see ”MC
Flash Mode Register” on page 112).
19.2.4.1 Flash Programming
Several commands can be used to program the Flash.
The Flash technology requires that an erase must be done before programming. The entire
memory plane can be erased at the same time, or a page can be automatically erased by clear-
ing the NEBP bit in the MC_FMR register before writing the command in the MC_FCR register.
By setting the NEBP bit in the MC_FMR register, a page can be programmed in several steps if
it has been erased before (see Figure 19-6).
Check if FRDY flag set
No
Yes
Read Status: MC_FSR
Write FCMD and PAGENB in MC_FCR
Check if LOCKE flag set
Check if FRDY flag set
No
Read Status: MC_FSR
Yes
Yes
Locking region violation
No
Check if PROGE flag set
Yes
No
Bad keyword violation and/or Invalid command
Command Successful