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
490 of 571
NXP Semiconductors
UM10316
Chapter 28: LPC29xx Flash/EEPROM
In the following, code examples for setting the FTCR register for different flash operations
are listed:
Unprotect sector
*Sector = UNPROTECT;
FCTR = (FS_LOADREQ | FS_WPB | FS_WEB | FS_WRE | FS_CS);
Erase sector
*Sector = 0;
FCTR = (FS_PROGREQ | FS_WPB | FS_CS);
Burn page
FCTR = (FS_PROGREQ | FS_WPB | FS_WRE | FS_CS);
Preset data latches
FCTR = (FS_ISS | FS_WRE | FS_WEB | FS_CS | FS_PDL);
FCTR = (FS_ISS | FS_WRE | FS_WEB | FS_CS);
3.2 Flash memory program-time register
The flash memory program-time register (FPTR) controls the timer for burning and
erasing the flash memory. It also allows reading of the remaining burn or erase time.
A built-in timer is used to control the burn time or erase time. The timer is started by
writing the burn or erase time to the timer register FPTR.TR, and by enabling it through
FPTR.EN_T. During burning or erasing, the timer register counts back to zero, and its
current value is returned when reading the FPTR register. This timer register can be used
to observe the progress of burning/erasing, and to terminate the burning/erasing.
Erase time (t
er
) to be programmed can be calculated from the following formula:
2
FS_WEB
R/W
Program and erase enable.
1*
Program and erase disabled.
0
Program and erase enabled.
1
FS_WRE
R/W
Program and erase selection.
1
Program and data-load selected.
0*
Erase selected.
0
FS_CS
R/W
Flash memory chip-select.
1*
The flash memory is active.
0
The flash memory is in standby.
Table 415. FCTR register bit description (FTCR, address: 0x2020 0000)
…continued
* = reset value
Bit
Symbol
Access
Value
Description
t
er
t
er
t
sec
(
)
512
t
clk sys
(
)
×
---------------------------------
=