DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
477 of 571
NXP Semiconductors
UM10316
Chapter 28: LPC29xx Flash/EEPROM
For optimal read performance the flash memory contains two internal 128-bit buffers. The
configuration of these buffers and the number of wait-states for unbuffered reads can be
set in the FMC, see
. For a detailed description of the flash bridge wait-states
register see
.
2.3 Flash memory writing
Writing can be split into two parts, erasing and burning. Both operations are
asynchronous; i.e. after initiating the operation it takes some time to complete. Erasing is
a relatively time-consuming process, see
. During this process any access to the
flash memory results in wait-states. To serve interrupts or perform other actions this
critical code must be present outside the flash memory (e.g. internal RAM). The code that
initiates the erase/burn operation must also be present outside the flash memory.
Normally the sectors are protected against write actions. Before a write is started the
corresponding sector(s) must be unprotected, after which protection can be enabled
again. Protection is automatically enabled on a reset. During a write (erase/burn)
operation the internal clock of the flash must be enabled. After completion the clock can
be disabled again.
In the following sections the typical write (erase and burn) sequences are listed. See
for details.
2.3.1 Erase sequence (for one or more sectors)
•
Unprotect sector(s) to be erased.
•
Mark sector(s) to be erased.
•
Initiate the erase process.
•
Wait until erasing is finished, see
•
Protect sector(s) (optional).
Remark:
During the erase process the internal clock of the flash module must be enabled.
2.3.2 Burn sequence (for one or more pages)
Burning data into the flash memory is a two-stage process. First the data for a page is
written into data latches, and afterwards the contents of these data latches (single page)
are burned into memory. If only a part of a page has to be burned the contents of the data
latches must be preset with logical 1s to avoid changing the remainder of the page.
Presetting these latches is done via the FMC (see
•
Unprotect the sectors containing the pages to be burned.
•
For each page:
–
Preset the data latches of the flash module (only required if a part of a page has to
be programmed; otherwise optional).
–
Write data for the page into the data latches (ordinary 32-bit word writes to the
address space of the flash memory).
Remark:
Data must be written from flash-word boundaries onwards and must be a
multiple of a flash-word.
–
Initiate the burn process.
–
Wait until burning is finished, see
.