UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
30 of 362
NXP Semiconductors
UM10208
Chapter 5: LPC2800 Flash
3.3 Wait state programming
The Flash controller takes data from the memory after a predefined number of clock
cycles. These clock cycles are called wait states and can be programmed in the
WAIT_STATES field of the F_WAIT register. The optimal number of wait states depends
on the clock frequency of the AHB clock. As a result, the number of wait states should
typically be changed if the CPU clock rate is changed. To prevent incorrect reads, wait
states should be changed to a larger value just
before
increasing the CPU clock rate, or
changed to a smaller value just
after
decreasing the CPU clock rate.
4.
In-Application flash programming
4.1 Introduction
Programming the embedded flash memory requires a specific sequence of events,
controlled primarily by software.
The flash memory is organized in sectors, as shown in
, that must be erased
before data can be written into them. The flash memory also has built in protection against
accidental programming.
As software write words to addresses in the Flash memory address range (0x104x xxxx),
the hardware transfers a Flash word (4 words, 16 bytes) into an internal page buffer, after
each write to an address 0x104x xxxC. A Flash page is the unit in which the Flash is
programmed: 512 bytes.
shows a flow chart for programming the flash memory on the LPC2888. The
shaded part of the flow chart represents functions that are done automatically by the
hardware of the flash controller.