This document extends the LPC2917/19 data sheet Ref. 1 with additional details to
support both hardware and software development. It focuses on functional description,
register details and typical application use. It does not contain a detailed description or
specification of the hardware already covered by the data sheet Ref. 1
1.2Intended audience
This document is written for engineers evaluating and/or developing hardware or sof tware
for the LPC2917/19. Some basic knowledge of ARM processors, ARM architecture and
ARM9TDMI-S in particular is assumed Ref. 2
1.3Guide to the document
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
.
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
F
T DRAFT DRAFT DRAFT DRA
.
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
2.Overview
2.1Functional blocks and clock domains
An overview of the functionality of the LPC2917/19 is given as well as a functional
description of the blocks and their typical usage. Register descriptions are given in the
appropriate sub-sections. The Datasheet Ref. 1
This chapter gives an overview of the functional blocks, clock domains, power modes an d
the interrupt and wake-up structure.
Figure 1 gives a simplified overview of the functional blocks. These blocks are explained
in detail in Section 3
gathered into subsystems and one or more of these blocks and/or subsystems are put into
a clock domain. Each of these clock domains can be configured individually for power
management (i.e. clock on or off and whether the clock responds to sleep and wake-up
events).
(with the exception of some trivial blocks). Several blocks are
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
Fig 2. Power modes
The device operates in normal-power mode after reset. In this mode the device is fully
functional, i.e. all clock domains are available
1
. The system can be put into idle-power
mode either partially or fully. In this mode selected clock domains are switched off, and
this might also suspend execution of the software. The clock domains are enabled again
upon a wake-up event. This wake-up event is provided by the Event Router.
The clock domains that can be switched off during idle-power mode depend on the
selected wake-up events. For an external interrupt (e.g. EXTINT0) no active clock is
required, i.e. all clock domains can be switched off. However, for wake-up on a timer
interrupt the clock domain of the timer should stay enabled during low-power mode. In
general, each subsystem that might cause a wake-up upon an interrupt must be excluded
from the low power mode, i.e. the clock domain of the subsystem should stay enabled.
Setting the power mode and configuring the clock domains is handled by the CGU, see
Section 3.3
Section 3.6
. Configuration of wake-up events is handled by the Event Router, see
.
2.3Memory map
2.3.1Memory-map view of different AHB master layers
The LPC2917/19 has a multi-layer AHB bus structure with three layers. The different bus
masters in the LPC2917/19 (CPU, FRSS_A and FRSS_B) each have their own AHB-lite
system bus (layer). AHB slaves are hooked up to these AHB-lite busses. Not all slaves
are connected to all layers, so the individual AHB bus masters in the LPC2917/19 each
have their own view of the system memory map.
2
The ARM968E-S CPU has access to all AHB slaves and hence to all address regions.
1.Although all clock domains are available, not all the domains are enabled. E.g. the ADC clock domain is switched off by default
after reset.
2.The CAN and LIN controllers can issue a wake-up event via activity on the CAN or LIN bus. This feature does not require an active
clock for their subsystem; but the first message can be lost.
The ARM9 processor has a 4 GB of address space. The LPC2917/19 has divided this
memory space into eight regions of 512 MB each. Each region is used for a dedicated
purpose.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Figure 3
gives a graphical overview of the LPC2917/19 memory map.
The ARM968E-S processor has its exception vectors located at address logic 0. Since
flash is the only non-volatile memory available in the LPC2917/19, the exception vectors
in the flash must be located at address logic 0 at reset (AHB_RST).
After booting a choice must be made for region 0. When enabled the Tightly Coupled
Memories (TCMs) occupy fixed address locations in region 0 as indicated in Figure 4
Information on how to enable the TCMs can be found in the ARM documentation, see
Ref. 2
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
gives a graphical overview of the embedded flash memory map.
NXP Semiconductors
0x00000000
0x1FFFFFFF
0x00200000
FLASH IF1
Configuration Area (4 Kbyte)
0x00200FFF
Embedded FLASH
memory area
512 Kbyte -
768 Kbyte
0x0007FFFF - 0x000BFFFF
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
Fig 5. Region 1 embedded flash memory
Region 1 is reserved for the embedded flash. A data area of 2 Mbyte (to be prepared for a
larger flash-memory instance) and a configuration area of 4 kB are reserved for each
embedded flash instance. Although the LPC2917/19 contains only one embedded flash
instance, the memory aperture per instance is defined at 4 Mbyte.
2.3.2.3Region 2: external static memory area
Region 2 is reserved for the external static memory. The LPC2917/19 provides I/O pi ns for
eight bank-select signals and 24 address lines. This implies that eight memory banks of
16 Mbytes each can be addressed externally.
2.3.2.4Region 3: external static memory controller area
The external Static-Memory Controller configuration area is located at region 3
2.3.2.5Region 4: internal SRAM area
Figure 6
gives a graphical overview of the internal SRAM memory map.
User manualRev. 01.02. — 8 November 2007 10 of 263
NXP Semiconductors
Region #4: embedded SRAM
0x8000_0000 - 0x9FFF_FFFF
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
embedded Memory (Controller) #2..#N
Data Transfer Area
(reserved for future extensions)
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
0x1FFF_FFFF
DR
AFT
DRAFT
DR
F
T DRAF
Fig 6. Region 4 internal SRAM memory
Region 4 is reserved for internal SRAM. The LPC2917/19 has two internal SRAM
instances. Instance #0 is 32 kB, instance #1 is 16 kB. See Section 3.5.2.3
2.3.2.6Region 5
Not used.
2.3.2.7Region 6
Not used.
2.3.2.8Region 7: bus-peripherals area
Figure 7
gives a graphical overview of the bus-peripherals area memory map.
User manualRev. 01.02. — 8 November 2007 12 of 263
NXP Semiconductors
The lower part of region 7 is again divided into VPB clusters, also referred to as
subsystems in this User Manual. A VPB cluster is typically used as the address space for
a set of VPB peripherals connected to a single AHB2VPB bridge, the slave on the AHB
system bus. The clusters are aligned on 256 kB boundaries. In the LPC2917/19 four VPB
clusters are in use: General SubSystem (GeSS), Peripheral SubSystem (PeSS), InVehicle Networking SubSystem (IVNSS) and the Modulation and Sampling SubSystem
(MSCSS). The VPB peripherals are aligned on 4 kB boundaries inside the VPB clusters.
The upper part of region 7 is used as the memory area where memory-mapped register
interfaces of stand-alone AHB peripherals and a DTL cluster reside. Each of these is a
slave on the AHB system bus. In the LPC2917/19 two such slaves are present: the Power,
Clock and Reset subsystem (PCRSS) and the Vectored Interrupt Controller (VIC). The
PCRSS is a DTL cluster in which the CGU, PMU and RGU are connected to the AHB
system bus via an AHB2DTL adapter. The VIC is a DTL target connected to the AHB
system bus via its own AHB2DTL adapter.
2.3.3Memory-map operating concepts
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
The basic concept in the LPC2917/19 is that each memory area has a ‘natural’ location in
the memory map. This is the address range for which code residing in that area is written.
Each memory space remains permanently fixed in the same location, eliminatin g the need
to have portions of the code designed to run in different address ran ges.
Because of the location of the exception-handler vectors on the ARM9 processor (at
addresses 0000 0000h through 0000 001Ch: see Table 2
embedded flash is mapped at address 0000 0000h to allow initial code to be executed
and to perform the required initialization, which starts executing at 0000 0000h.
The LPC2917/19 generates the appropriate bus-cycle abort exception if an access is
attempted for an address that is in a reserved or unused address region or unassigned
peripheral spaces. For these areas bo th attempted data accesses and instruction fetches
generate an exception. Note that write-access addresses should be word-aligned in ARM
code or half-word aligned in Thumb code. Byte-aligned writes are performed as word or
half-word aligned writes without error signalling.
Within the address space of an existing peripheral a dat a-abort exception is not gener ated
in response to an access to an undefined address. Address decoding within each
peripheral is limited to that needed to distinguish defined registers within the peripheral
itself. Details of address aliasing within a peripheral space are not defined in the
LPC2917/19 documentation and are not a supported feature.
Note that the ARM stores the pre-fetch abort flag along with the associated instruction
(which will be meaningless) in the pipeline and processes the abort only if an attempt is
made to execute the instruction fetched from the illegal address. This prevents the
accidental aborts that could be caused by pre-fetches occurring when code is executed
very near to a memory boundary.
User manualRev. 01.02. — 8 November 2007 15 of 263
Q
FIQ
NXP Semiconductors
VICARM
IRQ
UART
Interrupt Requests
Event
Router
VICARM
IRQ
Interrupt Requests
Events
In this case the VIC (Vectored Interru pt Controller) is configured to send an interr upt (IRQ
or FIQ) towards the ARM processor. Examples are interrupts to indicate the reception of
data via a serial interface, or timer interrupts. The Event Router serves as a multiplexer for
internal and external events (e.g. RTC tick and external interrupt lines) and indicates the
occurrence of such an event towards the VIC (Event-Router interrupt). The Event Router
is also able to latch the occurrence of these events (level or edge-triggered).
Fig 9. Interrupt (UART) causing an IRQ
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
Fig 10. Event causing an IRQ
2.4.1Interrupt device architecture
In the LPC2917/19 a general approach is taken to generate inter rupt requests towards the
CPU. A vectored Interrupt Controller (VIC) receives and collects the interrupt requests as
generated by the several modules in the device.
Figure 11
the parameters provided by the user software.
shows the logic used to gate the event signal originating from the function with
User manualRev. 01.02. — 8 November 2007 16 of 263
NXP Semiconductors
31
2
1
0
STATUS
&
SET
STATUS
CLEAR
STATUS
ENABLE
SET
ENABLE
CLEAR
ENABLE
>1
>1
Event
Interrupt
Request
Control
Interface
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
Fig 11. I nterrupt device architecture
A set of software-accessible variables is provided for each interrupt source to control and
observe interrupt request generation. In general, a pair of read-only registers is used for
each event that leads to an interrupt request:
• STATUS captures the event. The variable is typically set by a hardware event and
cleared by the software ISR, but for test purposes it can also be set by software
• ENABLE enables the assertion of an interrupt-request output signal for the captured
event
In conjunction with the STATUS/ENABLE variables, commands are provided to set and
clear the variable state through a software write-action to write-only registers. These
commands are SET_STATUS, CLR_STATUS, SET_ENABLE and CLR_ENABLE.
The event signal is logically OR-ed with its associated SET_STATUS register bit, so both
events writing to the SET_STATUS register sets the STATUS register.
Typically, the result of multiple STATUS/ENABLE pairs is logically OR-ed per functional
group, forming an interrupt request signal towards the Vectored Interrupt Controller.
2.4.2Interrupt registers
A list is provided for each function in the detailed block-description part of this document,
containing the interrupt sources for that function. A table is also provide d to indicate the bit
positions per interrupt source. These positions are identical for all the six registers
INT_STATUS, INT_ENABLE, INT_SET_STATUS, INT_CLEAR_STATUS,
INT_SET_ENABLE and INT_CLEAR_ENABLE.
User manualRev. 01.02. — 8 November 2007 17 of 263
Up to 32 interrupt bits are available for each register .
NXP Semiconductors
2.4.2.1Interrupt clear-enable register
Write ‘1’ actions to this register set one or more ENABLE variables in the INT_ENABLE
register. INT_SET_ENABLE is write-only. Writing a 0 has no effect.
Table 4.INT_CLR_ENABLE register bit description
BitVariable NameAccess Value Description
iCLR_ENABLE[i]W1Clears the ENABLE[i] variable in corresponding
2.4.2.2Interrupt set-enable register
Write ‘1’ actions to this register set one or more ENABLE variables in the INT_ENABLE
register. INT_SET_ENABLE is write-only. Writing a 0 has no effect.
Table 5.INT_SET_ENABLE register bit description
BitVariable NameAccess Value Description
iSET_ENABLE[i]W1Sets the ENABLE[i] variable in corresponding
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
INT_ENABLE register (set to 0)
INT_ENABLE register to 1
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
2.4.2.3Interrupt status register
The interrupt status register reflects the status of the corresponding interrupt event that
leads to an interrupt request. INT_STATUS is a read-only register. Its content is either
changed by a hardware event (from logic 0 to 1 in the case of an event), or by software
writing a 1 to the INT_CLR_STATUS or INT_SET_STATUS register.
T able 6.INT_STATUS register bit description
* = reset value
BitVariable NameAccess Value Description
iSTATUS[i]R1Event captured; request for interrupt service on
2.4.2.4Interrupt enable register
This register enables or disables generation of inte rrupt requests on associated interruptrequest output signals. INT_ENABLE is a read-only register. Its content is changed by
software writing to the INT_CLR_ENABLE or INT_SET_ENABLE registers.
Table 7.INT_ENABLE register bit description
* = reset value
BitVariable NameAccess Value Description
iENABLE[i]R1Enables interrupt request generation. The
the corresponding interrupt request signal if
ENABLE[i] = 1 interrupt for end of scan
0*
corresponding interrupt request output signal is
asserted when STATUS[i] =1
0*
2.4.2.5Interrupt clear-status register
Write ‘1’ actions to this register clear one or more status variables in the INT_STATUS
register. Writing a ‘0’ has no effect.
User manualRev. 01.02. — 8 November 2007 18 of 263
NXP Semiconductors
T able 8.INT_CLR_STATUS register bit description
BitVariable NameAccess Value Description
iCLR_STATUS[i]W1Clears STATUS[i] variable in INT_STATUS
2.4.2.6Interrupt set-status register
Write ‘1’ actions to this register set one or more STATUS variables in the INT_STATUS
register. This registe r is write-only and is intended for debug purposes. W riting a ‘0’ has no
effect.
Table 9.INT_SET_STATUS register bit description
BitVariable NameAccess Value Description
iSET_STATUS[i]W1Sets STATUS[i] variable in INT_STATUS
2.4.3Wake-up
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
register (set to 0)
register to 1
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
In low-power mode, selected idle clock domains are switched off. The wake-up signal
towards the CGU enables the clock of these domains. A typical application is to configu re
all clock domains to switch off. Since the clock of the ARM processor is also switched off,
execution of software is suspended and resumed on wake-up.
In this case the Event Router is configured to send a wake-up signal towards the CGU
(Clock Generation Unit). Examples are events to indicate the reception of dat a (e.g. on the
CAN receiver) or external interrupts.
The VIC can be used (IRQ wake-up event or FIQ wake-up event of the Event Router) to
generate a wake-up event on an interrupt occurrence. This is only possible if the clock
domain of the interrupt source is excluded from low-power mode. The VIC does not need
a clock to generate these wake-up events.
Examples of use are to configure a timer to wake up the system af ter a defined time, or to
wake up on receiving data via the UART.
The flash memory consists of the embedded flash memory (flash) and a contro ller (the
FMC) to control access to it. The controller can be accessed in two ways: either by
register access in software, running on the ARM core, or directly via the JTAG interface
Figure 14
In the following sections access to the Flash Memory Controller via software is described.
Access via the JTAG interface is described in Section 6
.
.
3.1.2Flash memory layout
The flash memory is arranged into sectors, pages and flash-words Figure 15. For writing
(erase/burn) the following issues are relevant:
• Protection against erase/burn is arranged per sector.
• Erasing is done per sector.
• Burning - the actual write into flash memory - is done per page.
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
T DRAFT DRAFT DRAFT DRA
Flash-word
#
small
large
Size
small
large
(per sector)
#
Size#Size
small
large
(per page)
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
LPC2917512k8/78192/6553616/128512 byte32 16 byte
3.1.3Flash memory reading
During a read (e.g. read-only data or program execu tio n ) no spec ial ac tion s ar e re qu ire d .
The address space of flash memory can simply be accessed like normal ROM with word,
half-word or byte access. It is possible however to modify or optimize the read settings of
the flash memory.
For optimal read performance the flash memory cont ains two intern al 128- bit buf f ers. The
configuration of these buffers and the number of wait-states for unbuffered reads can be
set in the FMC, see Ref. 1
register see Table 18
. For a detailed description of the flash bridge wait-states
.
3.1.4Flash 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 Ref. 1
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). Th e code that
initiates the erase/burn operation mus t al so 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)
User manualRev. 01.02. — 8 November 2007 21 of 263
operation the internal clock of the flash must be enabled. After comp letion the clock can
be disabled again.
. During this process any access to the
NXP Semiconductors
In the following sections the typical write (erase and burn) sequences are listed.
3.1.4.1Erase 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 Section 2.4.1.
• Protect sector(s) (optional).
Remark: During the erase process the internal clock of the flash module must be enabled.
3.1.4.2Burn 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 latc he s (sin g le 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 Section 3.1.7
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
).
D
RAFT
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
• Unprotect the sectors containing the pa ges 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 (ordin ary 32-bit word writes to the
address space of the flash memory).
Remark: Data must be written from flash-word boun daries onwards and must be a
multiple of a flash-word.
– Initiate the burn process.
– Wait until burning is finished, see Section 2.4.1
.
• Protect sectors (optional).
Remark: During the burn process the internal clock of the flash module must be enabled.
Remark: Only erased flash-word locations can be written to.
Remark: A complete page should be burned at one time. Before burning it again the
User manualRev. 01.02. — 8 November 2007 22 of 263
NXP Semiconductors
Unprotect sectors
Enable flash clock
for each page to
be programmed
Write data to page
Start burning page
Wait for burning
to finish
Disable flash clock
Fig 16. Flash-memory burn sequence
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.1.5Flash signature generation
The flash module contains a built-in signature generator. This generator can produce a
128-bit signature (MISR) from a range of the fl ash memory. A typical usage is to verify the
flashed contents against a calculated signature (e.g. during programming).
Remark: The address range for generating a signature must be aligned on flash-word
boundaries.
Remark: Like erasing a sector or burning a page, the generation of a signature is also an
asynchronous action; i.e. after starting generation the module begins calculating the
signature, and during this process any access to the flash results in wait-states (see
Section 3.1.2
). To serve interrupts or perform other actions this critical code must be
present outside flash memory (e.g. internal RAM). The code that initiates the signature
generation must also be present outside flash memory.
3.1.6Flash interrupts
Burn, erase and signature generation (MISR) are asynchronous operations; i.e. after
initiating them it takes some time before they complete. During this period access to the
flash memory results in wait-states.
Completion of these operations is checked vi a the interrupt status register (INT_STATUS).
This can be done either by polling the corresponding interrupt status or by enabling the
generation of an interrupt via the interrupt enable register (INT_SET_ENABLE).
The following interrupt sources are available (see Ref. 1
):
• END_OF_BURN; indicates the completion of burning a page.
• END_OF_ERASE; indicates the completion of erasing one or more sectors.
User manualRev. 01.02. — 8 November 2007 23 of 263
• END_OF_MISR; indicates the completion of signature generation.
Generation of an interrupt can be enabled (INT_SET_ENABLE register) or disabled
(INT_CLR_ENABLE register) for each of these interrupt sources. The interrupt status is
always available even if the corresponding interrupt is disabled. INT_STATUS indicates
the raw, unmasked interrupt status.
NXP Semiconductors
Remark: The interrupt status of an operation should be cleared via the
INT_CLR_STATUS register before starting the operation, o therwise the status might
indicate completion of a previous operation.
Remark: Access to flash memory is blocked during asynchronous operations and results
in wait-states. Any interrupt service routine that needs to be serviced during this period
must be stored entirely outside the flash memory (e.g. in internal RAM).
Remark: To detect the completion of an operation (e.g. erase or burn) it is also possible to
poll the interrupt status register. This register indicates the raw interrupt status, i.e. the
status is independent of whether an interrupt is enabled or not. In this case the interrupts
of the Flash Memory Controller must be disabled (default value after reset).
Polling is the easiest way to detect completion of an operation. This method is also used
in the previous examples.
3.1.7Flash memory index-sector features
The flash memory has a special index sector. This is normally invisible from the address
space. By setting the FS_ISS bit in the FCTR register the index sector becomes visible at
the flash base address and replaces all regular sectors. The layout Figure 17
procedure are similar to those for regular sectors.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
and burn
DR
AFT
DRAFT
DR
F
T DRAF
JTAG
access
PAGES 6 - 7
PAGES 4 - 5
PAGES 0 - 3
Base address of
Flash Memory
Customer info
Customer info
Fig 17. Index sector layout
Sect or Se cur ity
Sect or Se cur ity
Reser ved
Reser ved
Reser ved
protection
By writing to specific locations in this sector the following features can be enabled:
• JTAG access protection
• Storage of customer information
• Sector security
Remark: It is not possible to erase the index sector. As a result the sector is write-only
and enabled features cannot be disabled again.
In the following sections these features and the procedures to en able th em are describ ed
User manualRev. 01.02. — 8 November 2007 24 of 263
NXP Semiconductors
Remark: As the index sector shares the address space of the regular sectors it is not
possible to access it via code in flash. Accessing is only possible via code outside flash
memory (e.g. internal RAM).
Remark: Take care when writing locations in the index sector. The sector cannot be
erased, and using unspecified values or locations might result in a corrupted or
malfunctioning device which cannot be recovered.
3.1.7.1JTAG access protection
JTAG access protection is a feature to block ac ce ss to the de vice thr ou g h the J TAG
interface. When this feature is enabled it is no longer possible to use the JTAG interface
(e.g. via a debugger) and read out memory or debug code.
The following flash word in the index sector controls JTAG access protection :
LPC2917/19 - ARM9 microcontroller with CAN and LIN
FSS_ISS bit setIndex
sector page #
DRAFT
Preliminary UM
Flash-word valueDescription
All bits 0Protection enabled
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Remark: After enabling this feature is not activated until next reset.
Remark: When enabled it is not possible to disable this feature.
3.1.7.2Index-sector customer info
The index sector can also be used to program customer-specific information. Page 5 (32
flash words) and the last 31 flash-words of page 4 (the first flash-word is used for JTAG
access protection) can be programme d at the cu sto m er’s discretion. The range available
for this purpose is shown in Table 12
Table 12.Customer-specific information
Index Sector Page #
(FS_ISS bit set)
40x2000 08300x2000 09FF
50x2000 0A400x2000 0BFF
3.1.7.3Flash memory sector security
Sector security is a feature for setting sectors to Read-Only. It is possible to enable this
feature for each individual sector. Once it has been enabled it is no longer possible to
write (erase/burn) to the sector. This feature can be used, for example, to prevent a boot
sector from being replaced.
For every sector in flash memory there is a corresponding flash-word in the index sector
that defines whether it is secured or not. Table 13
flash-words and sectors in flash memory:
LPC2917/19 - ARM9 microcontroller with CAN and LIN
Index Sector
Page #
Flash Memory
Sector #
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
Flash-Word
Address
(FS_ISS bit set)
DR
AFT
DRAFT
DR
F
T DRAF
In Table 14 decoding of the flash-word is listed:
Table 14.Sector security values
Flash-word valueDescription
All bits ‘1’Corresponding sector is Read/Write (default)
All bits ‘0’Corresponding sector is Read-Only
Remark: After enabling this feature is not activated until the next reset.
Remark: When enabled, it is not possible to disable this feature.
3.1.8FMC register overview
The Flash Memory Controller registers have an offset to the base address FMC RegBase
which can be found in the peripherals base-address map, see Table 3
User manualRev. 01.02. — 8 November 2007 27 of 263
NXP Semiconductors
Flash memory has data latches to store the data that is to be programmed into it, so that
the data-latch contents can be read instead of reading the flash memory contents.
Data-latch reading is always done without buffering, with the programmed number of
wait-states (WSTs) on every beat of the burst. Data-latch reading can be done both
synchronously and asynchronously, and is selected with the FS_RLD bit.
Index-sector reading is always done without buffering, with the programmed number of
WSTs on every beat of the burst. Index-sector reading can be done both synchronously
and asynchronously and is selected with the FS_ISS bit.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
Table 16
Table 16.FCTR register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 16 reservedR-Reserved; do not modify. Read as logic 0
15FS_LOADREQR/WData load request.
14FS_CACHECLRR/WBuffer-line clear.
13FS_CACHEBYPR/WBuffering bypass.
12FS_PROGREQR/WProgramming request.
11FS_RLSR/WSelect sector latches for reading.
10FS_PDLR/WPreset data latches.
9FS_PDR/WPower-down.
8reservedR-Reserved; do not modify. Read as logic 0
7FS_WPBR/WProgram and erase protection.
1*Program and erase disabled.
0Program and erase enabled.
1Program and data-load selected.
0*Erase selected.
1*The flash memory is ac ti ve .
0The flash memory is in standby.
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.1.10Flash 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.
Erase time to be programmed can be calculated from the following formula:
Burn time to be programmed can be calculated from the following formula:
Table 17
Table 17.FPTR register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 16 reservedR-Reserved; do not modify. Read as logic 0
15EN_TR/WProgram-timer enable.
14 to 0TR[14:0]R/WProgram timer; the (remaining) burn and erase
shows the bit assignment of the FPTR register.
1Flash memory program timer enabled.
0*Flash memory program timer disabled.
User manualRev. 01.02. — 8 November 2007 29 of 263
NXP Semiconductors
WST
t
acc clk()
t
t
tclk sys()
------------------
>1–
WST
t
acc addr()
t
tclk sys()
--------------------- -
>1–
3.1.11Flash bridge wait-states register
The flash bridge wait-states register (FBWST) controls the number of wait-states inserted
for flash-read transfers. This register also controls the seco nd buffer line for asynchronous
reading.
To eliminate the delay associated with synchronizing flash-read data, a predefined
number of wait-states must be programmed. These depend on flash-memory response
time and system clock period. The minimum wait-states value can be calculated with the
following formulas where t
t
acc(addr)
Synchronous reading:
Asynchronous reading:
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
= clock access time, t
acc(clk)
= address access time (see Ref. 1 for further details):
clk(sys)
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
F
T DRAFT DRAFT DRAFT DRA
= system clock period and
DRAFT
DRA
F
DR
AFT
DR
T DRAF
Remark: If the programmed number of wait-states is more than three, flash-data reading
cannot be performed at full speed (i.e. with zero wait-states at the AHB bus) if speculative
reading is active.
Table 18
Table 18.FBWST register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 16 reservedR-Reserved; do not modify. Read as logic 0
15CACHE2ENR/WDual buffering enable.
14SPECALWAYSR/WSpeculative reading.
13 to 8reservedR-Reserved; do not modify. Read as logic 0
7 to 0WST[7:0]R/WNumber of wait-states. Contains the number of
shows the bit assignment of the FBWST register.
1*Second buffer line is enabled.
0Second buffer line is disabled.
1*S peculative reading is always performed.
0Single speculative reading is performed.
wait-states to be inserted for flash memory
reading. The minimum calculated value must
be programmed for proper flash memory readoperation.