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.
User manualRev. 01.02. — 8 November 2007 30 of 263
NXP Semiconductors
t
BIST
t
fl BIST()
3+t
clk sys()
×()FMSSTOPFMSSTART–1+()×=
3.1.12Flash-memory clock divider register
The flash-memory clock divider register (FCRA) controls the clock divider for the flashmemory program-and-erase clock CRA. This clock should be programmed to 66 kHz
during burning or erasing.
The CRA clock frequency fed to flash memory is the system clock frequency divided by
3 × (FCRA + 1). The programmed value must result in a CRA clock frequency of
66 kHz ± 20 %.
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 19
Table 19.FCRA register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 12 reservedR-Reserved; do not modify. Read as logic 0
11 to 0FCRA[11:0]R/WClock divider setting.
shows the bit assignment of the FCRA register.
000h*No CRA clock is fed to the flash memory.
3.1.13Flash-memory BIST control registers
The flash-memory Built-In Self Test (BIST) control registers control the embedded BIST
signature generation. This is implemented via the BIST start- address register FMSSTART
and the stop-address register FMSSTOP.
A signature can be generated for any part of the flash memory contents. The address
range to be used for generation is defined by writing the start address to the BIST startaddress register and the stop address to the BIST stop-address register. The BIST start
and stop addresses must be flash memory word-aligne d and can be derived from th e AHB
byte addresses through division by 16. Signature generation is star ted by setting the BIST
start-bit in the BIST stop-address register. Setting the BIST star t-bit is typically combined
with defining the signature stop address.
Flash access is blocked during the BIST signature calculation. The duration of the flash
BIST time is
Table 20
and Table 21 show the bit assignment of the FMSSTART and FMSSTOP
registers respectively.
Table 20.FMSSTART register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 17 reservedR-Reserved; do not modify. Read as logic 0,
write as logic 0.
16 to 0FMSSTART[16:0]R/W0 0000h* BIST start address (corresponds to AHB byte
User manualRev. 01.02. — 8 November 2007 31 of 263
NXP Semiconductors
Table 21.FMSSTOP register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 18 reservedR-Reserved; do not modify. Read as logic 0,
17MISR_STARTR/WBIST start.
16 to 0FMSSTOP[16:0]R/WBIST stop address divided by 16 (corresponds
3.1.14Flash-memory BIST signature registers
The flash-memory BIST signature registers return signatures as produced by the
embedded signature generator. There is a 128-bit signature reflected by the four registers
FMSW0, FMSW1, FMSW2 and FMSW3.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
write as logic 0.
1BIST signature generation is initiated.
0*Reset value.
to AHB byte address [20:4]).
0 0000h*Reset value.
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
The signature generated by the flash memory is used to verify the flash memory conten ts.
The generated signature can be compared with an expected signature and thus makes
unnecessary the more time- and code-consuming procedure of reading back the entire
contents.
Table 22
to Table 25 show bit assignment of the FMSW0 and FMSW1, FMSW2, FMSW3
registers respectively.
Table 22.FMSW0 register bit description
BitSymbolAccess ValueDescription
31 to 0FMSW0[31:0]R-Flash BIST 128-bit signature (bits 31 to 0).
Table 23.FMSW1 register bit description
BitSymbolAccess ValueDescription
31 to 0FMSW1[63:32]R-Flash BIST 128-bit signature (bits 63 to 32).
Table 24.FMSW2 register bit description
BitSymbolAccess ValueDescription
31 to 0FMSW2[95:64]R-Flash BIST 128-bit signature (bits 95 to 64).
Table 25.FMSW3 register bit description
BitSymbolAccess ValueDescription
31 to 0FMSW3[127:96]R-Flash BIST 128-bit signature (bits 127 to 96).
3.1.15Flash 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.
User manualRev. 01.02. — 8 November 2007 32 of 263
NXP Semiconductors
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).
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
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.
• END_OF_MISR; indicate s the completion of a signature generation (MISR).
For each of these interrupt sources generation of an interrupt can be enabled
(INT_SET_ENABLE register) or disabled (INT _C LR_ E NA BLE re gis te r) . Th e interr u pt
status is always available even if the corresponding interrupt is disabled. INT_STATUS
indicates the raw, unmasked interrupt status.
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 flash memory (e.g. in internal RAM).
Remark: To detect 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.15.1FMC interrupt bit description
Table 26
gives the interrupts for the FMC. The first column gives the bit numb er in the
interrupt registers. For a general explanation of the interrupt concept and a description of
the registers see Section 2.4
Table 26.FMC interrupt sources
Register
bit
31 to 3unusedUnused
2END_OF_MISRBIST signature generati on has finished
1END_OF_BURNPage burning has finished
0END_OF_ERASEErasing of one or more sectors has finished
Interrupt sourceDescription
.
3.2Static Memory Controller (SMC)
3.2.1SMC functional description
External memory can be connected to the device. The Static Memory Controller (SMC)
controls timing and configuration of this external memory.
User manualRev. 01.02. — 8 November 2007 33 of 263
NXP Semiconductors
ARM
Data (8/16/32 bit)
Address (lowest part)
SMC
External
Memory
Bank n
External
Memory
Bank 1
External
Memory
Bank 0
CS1
CS0
CS
n
Bank Select
Fig 18. Schemat ic representation of the SMC
The SMC provides an interface between a system bus and external (off-chip) memory
devices. It provides support for up to eight independently configurable memory banks
simultaneously . Each memory bank is capable of supporting SRAM , ROM, Flash EPROM,
Burst ROM memory or external I/O devices (memory-mapped).
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
Memory banks can be set to write-protect state. In this case the memory controller blocks
write access for the specified bank. When an illegal write occurs the WRITEPROTERR bit
in the SMBSR register is set.
3.2.2External memory interface
The external memory interface depends on the bank width: 32, 16 or 8 bits selected via
MW bits in the corresponding SMBCR register. Choice of memory chips requires an
adequate set-up of the RBLE bit in the same register. RBLE = 0 for 8-bit based external
memories, while memory chips capable of accepting 16- or 32-bit wide data will work with
RBLE = 1. If a memory bank is configured to be 32 bits wide, address lines A0 and A1 can
be used as non-address lines. Memory banks configured to 16 bits wide do not require
A0, while 8-bit wide memory banks require address lines down to A0.
Configuring A1 and/or A0 line(s) to provide address or non-add ress function is
accomplished by setting up the SCU. Symbol A[x] refers to the highest-o rder add ress li ne
of the memory chip used in the external-memory interface. CS refers to the eight bankselect lines, and BLS refers to the four byte-lane select lines. WE_N is the write output
enable and OE_N is the output enable. Address pins on the device are shared with other
User manualRev. 01.02. — 8 November 2007 34 of 263
functions. When connecting external memories, check that the I/O pin is programmed to
the correct function. Control of these settings is handled by the SCU (see Section 3.4
).
NXP Semiconductors
CS0 .. CS
n
OE_N
CECE
OEOE
WEWE
IO[15:0]IO[15:0]
A[x:0]A[x:0]
D[31:16]D[15:0]
BLS0
BLS1
A[x+2:2]
BLS2
BLS3
LB
UBUB
LB
WE_N
Figure 19 shows configuration of a 32-bit wide memory bank using 8-bit devices.
Figure 20
Figure 22
Figure 23
Figure 24
DRAFT
Preliminary UM
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
and Figure 21 show a 32-bit wide memory using 16- and 32-bit devices.
shows configuration of a 16-bit wide memory bank using 8-bit devices.
shows configuration of a 16-bit wide memory bank using 16-bit devices.
shows an 8-bit wide memory bank. This memory width requires 8-bit devices.
CS0 .. CS n
OE_N
CECECECE
BLS3BLS0BLS1BLS2
D[31:24]D[23:16]D[15:8]D[7:0]
A[x+2:2]
WEWEWEWE
IO[7:0]IO[7:0]IO[7:0]IO[7:0]
OEOEOEOE
D
RAFT
DR
DRAFT
T DRAFT DRAFT DRAFT DRA
A[x:0]A[x:0]A[x:0]A[x:0]
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
32-bit bank using 8-bit devices
Fig 19. External memory interface: 32-bit banks with 8-bit devices
32-bit bank using 16-bit devices
Fig 20. External memory interface: 32-bit banks with 16-bit devices
User manualRev. 01.02. — 8 November 2007 36 of 263
NXP Semiconductors
CS0 .. CS
n
OE_N
CE
OE
WE
IO[15:0]
A[x:0]
D[15:0]
A[x+1:1]
BLS0
BLS1
LB
UB
WE_N
CS0 .. CS
n
OE_N
CE
OE
WE
IO[7:0]
A[x:0]
D[7:0]
BLS0
A[x:0]
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
16-bit bank using 16-bit device
Fig 23. External memory interface: 16-bit banks with 16-bit devices
8-bit bank using 8-bit device
Fig 24. External memory interface: 8-bit banks with 8-bit devices
Memory is available in various speeds, so the numbers of wait-states for both read and
write access must be set up. These settings should be reconsidered when the ARM
processor-core clock changes.
In Figure 25
a timing diagram for reading external memory is shown. The relationship
between the wait-state settings is indicated with arrows.
User manualRev. 01.02. — 8 November 2007 38 of 263
NXP Semiconductors
OE_N
CLK(SYS)
CS
ADDR
DATA
WSTOEN
WST1
WSTWEN
WST2
WE_N / BLS
IDCY
In Figure 27 usage of the idle/turn-around time (IDCY) is demonstrated. Extra wait-states
are added between a read and a write cycle in the same external memory device.
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
WSTOEN=5, WSTWEN=5, WST1=7, WST2=6, IDCY=5
Fig 27. Reading/writing external memory
Address pins on the device are shared with other functions. When connecting external
memories, check that the I/O pin is programmed to the correct function. Control of these
settings is handled by the SCU.
3.2.3External SMC register overview
The external SMC memory-bank configuration registers are shown in Table 28.
The memory-bank configuration registers have an offset to the base address SMC
RegBase which can be found in the memory map.
Table 28.External SMC register overview
Offset
Access WidthReset
Address
Bank 0
000hR/W4FhSMBIDCYR0Idle-cycle control register for memory
004hR/W51FhSMBWST1R0Wait-state 1 control register for memory
008hR/W51FhSMBWST2R0Wait-state 2 control register for memory
00ChR/W40hSMBWSTOENR0Output-enable assertion delay control
010hR/W41hSMBWSTWENR0Write-enable assertion delay control
014hR/W880hSMBCR0Configuration register for memory bank 0see Table 34
018hR/W20hSMBSR0Status register for memory bank 0see Table 35
User manualRev. 01.02. — 8 November 2007 41 of 263
Access WidthReset
value
SymbolDescriptionReference
register for memory bank 4
register for memory bank 4
bank 5
bank 5
bank 5
register for memory bank 5
register for memory bank 5
bank 6
bank 6
bank 6
register for memory bank 6
register for memory bank 6
bank 7
bank 7
bank 7
register for memory bank 7
register for memory bank 7
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
see Table 32
see Table 33
see Table 29
see Table 30
see Table 31
see Table 32
see Table 33
see Table 29
see Table 30
see Table 31
see Table 32
see Table 33
see Table 29
see Table 30
see Table 31
see Table 32
see Table 33
DR
AFT
DRAFT
DR
F
T DRAF
NXP Semiconductors
WST1
t
aR()inttemd read()
+
t
clk sys()
----------------------------------------------
1–=
3.2.4Bank idle-cycle control registers
The bank idle-cycle control register configures the external bus turnaround cycles
between read and write memory accesses to avoid bus contention on the externalmemory data bus. The bus turnaround wait-time is inserted between external bus
transfers in the case of:
• Read-to-read, to different memory banks
• Read-to-write, to the same memory bank
• Read-to-write, to different memory banks
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 29
Table 29.SMBIDCYRn register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 4reservedR-Reserved; do not modify. Read as logic 0, write
3 to 0IDCY[3:0]R/WIdle or turnaround cycles. This register contains
shows the bit assignment of the SMBIDCYR0 to SMBIDCYR7 registers.
Fh*
3.2.5Bank wait-state 1 control registers
The bank wait-state 1 control register configures the external transfer wait-states in read
accesses. The bank configuration register contains the enable and polarity setting for the
external wait.
The minimum wait-states value WST1 can be calculated from the following formula:
Where:
as logic 0
the number of bus turnaround cycles added
between read and write accesses. The
turnaround time is the programmed number of
cycles multiplied by the system clock period
t
= internal read delay. For more information see Ref. 1 Dynamic characteristics.
a(R)int
t
emd(read)
Table 30
T able 30.SMBWST1Rn register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 5reservedR-Reserved; do not modify. Read as logic 0, write
4 to 0WST1[4:0]R/WWait-state 1. This register contains the length of
User manualRev. 01.02. — 8 November 2007 42 of 263
= external-memory read delay in ns.
shows the bit assignment of the SMBWST1R0 to SMBWST1R7 registers.
as logic 0
read accesses, except for burst ROM where it
defines the length of the first read access only.
The read-access time is the programmed
number of wait-states multiplied by the system
clock period
1Fh*
NXP Semiconductors
WST2
t
aW()inttemd write()
+
t
clk sys()
------------------------------------------------
1–=
3.2.6Bank wait-state 2 control registers
The bank wait-state 2 control register configures the external transfer wait-states in write
accesses or in burst-read accesses. The bank configuration register contains the enable
and polarity settings for the external wait.
Sequential-access burst-reads from burst-flash devices of the same type as for burst
ROM are supported. Due to sharing of the SM BWST2 R register between write an d burstread transfers it is only possible to have one setting at a time for burst flash; either write
delay or the burst-read delay. This means that for write transfer the SMBWST2R register
must be programmed with the write-delay value, and for a burst-read transfer it must be
programmed with the burst-access delay.
The minimum wait-states value WST2 can be calculated from the following formula:
Where:
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
t
= internal write delay. For more information see Ref. 1 Dynamic characteristics.
a(W)int
t
emd(write)
Table 31
T able 31.SMBWST2Rn register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 5reservedR-Reserved; do not modify. Read as logic 0, write
4 to 0WST2[4:0]R/WWait-state 2. This register contains the length of
= external-memory write delay in ns.
shows the bit assignment of the SMBWST2R0 to SMBWST2R7 registers.
as logic 0
write accesses, except for burst ROM where it
defines the length of the burst-read accesses.
The write-access time c.q. the burst ROM read
access time is the programmed number of waitstates multiplied by the system clock period
1Fh*
3.2.7Bank output enable assertion-delay control register
The bank output-enable assertion-delay 1 control register configures the delay between
the assertion of the chip-select and the output enable. This delay is used to reduce the
power consumption for memories that are unable to provide valid data immediately after
the chip-select is asserted. Since the access is timed by the wait-state s, th e prog ra mmed
value must be equal to or less than the bank wait-state 1 programmed value. The output
enable is always deasserted at the same time as the chip-select at the end of the transfer.
The bank configuration register contains the enable for output assertion delay.
User manualRev. 01.02. — 8 November 2007 43 of 263
shows the bit assignment of the SMBWSTOENR0 to SMBWSTOENR7 registers.
NXP Semiconductors
Table 32.SMBWSTOENRn register bit descripti on
* = reset value
BitSymbolAccess ValueDescription
31 to 4reservedR-Reserved; do not modify. Read as logic 0, write
3 to 0WSTOENR/WOutput-enable assertion delay. This register
3.2.8Bank write-enable assertion-delay control register
The bank write-enable assertion-delay 1 control register configures the delay between the
assertion of the chip-select and the write enable. This delay is used to reduce power
consumption for memories. Since the access is timed by the wait-states the programmed
value must be equal to or less than the bank wait-state 2 programmed value. The write
enable is asserted half a system-clock cycle after assertion of the chip-select for logic 0
wait-states. The write enable is deasserted half a system-clock cycle before the
chip-select, at the end of the transfer. The byte-lane select outputs have the same timing
as the write-enable output for writes to 8-bit devices that use the byte-lane select s instead
of the write enables. The bank configuration register contains the enable for output
assertion delay.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
as logic 0.
contains the length of the output-enable delay
after the chip-select assertion. The outputenable assertion-delay time is the programmed
number of wait-states multiplied by the system
clock period
0h*
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 33
shows the bit assignment of the SMBWSTWENR0 to SMBWSTWENR7
registers.
T able 33.SMBWSTWENRn register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 4reservedR-Reserved; do not modify. Read as logic 0, write
3 to 0WSTWENR/WWrite-enable assertion delay. This register
3.2.9Bank configuration register
The bank configuration register defines bank access for the connected memory device.
A data transfer can be initiated to the external memory greater than the width of the
external-memory data bus. In this case the external transfer is automatically split up into
several separate transfers.
Table 34
shows the bit assignment of the SMBCR0 to SMBCR7 registers.
as logic 0
contains the length of the write enable delay
after the chip-select assertion. The write-enable
assertion-delay time is the programmed
number of wait-states multiplied by the system
clock period
User manualRev. 01.02. — 8 November 2007 44 of 263
NXP Semiconductors
Table 34.SMBCRn register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 8reservedR-Reserved; do not modify. Read as logic 0, write as
7 and 6MW[1:0]R/WMemory-width configuration
5BMR/WBurst mode
4WPR/WWrite-protect; e.g. (burst) ROM, read-only flash or
3CSPOLR/WChip-select polarity
2 and 1reservedR-Reserved; do not modify. Read as logic 0, write as
0RBLER/WRead-byte lane enable
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
logic 0
00*8-bit; reset value for memory banks 1, 3 and 7
01*16-bit; reset value for memory banks 2 and 6
10*32-bit; reset value for memory banks 0, 4 and 5
11Reserved
1Sequential access burst-reads to a maximum of four
consecutive locations is supported to increase the
bandwidth by using reduced access time. However,
bursts crossing quad boundaries are split up so that
the first transfer after the boundary uses the slow
wait-state 1 read timing
0*The memory bank is configured for non-burst
memory
SRAM
1The connected device is write-protected
0*No write-protection is required
1The chip-select input is active HIGH
0*The chip-select input is active LOW
logic 0
1The byte-lane select pins are held asserted (logic 0)
during a read access. This is for 16-bit or 32-bit
devices where the separate write-enable signal is
used and the byte-lane selects must be held
asserted during a read. The write-enable pin WEN is
used as the write-enable in this configuration.
0*The byte-lane select pins BLSn are all deasserted
(logic 1) during a read access. This is for 8-bit
devices if the byte-lane enable is connected to the
write-enable pin, so must be deasserted during a
read access (default at reset). The byte-lane select
pins are used as write-enables in this configuration
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.2.10Bank status register
The bank status register reflects the status flags of each memory bank.
User manualRev. 01.02. — 8 November 2007 45 of 263
shows the bit assignment of the SMBSR0 to SMBSR7 registers.
NXP Semiconductors
Table 35.SMBSRn register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 2reservedR-Reserved; do not modify. Read as logic 0, write
1WRITEPROTERR R/WWrite-protect error
0reservedR-reserved; do not modify. Read as logic 0, write
3.3Power control and reset block (PCRT)
The PCRT block consists of the following three sub-blocks: the Clock Generation Unit
(CGU), Reset Generation Unit (RGU) and Power Managem ent Unit (PMU). Each of these
sub-blocks is described in a section below. For more information on the PCRT and CGU
see Ref. 1
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
as logic 0
1A write access to a write-protected memory
device was initiated. Writing logic 1 to this
register clears the write-protect status flag
0*Writing a logic 0 has no effect
as logic 0
.
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
F
T DRAFT DRAFT DRAFT DRA
DR
DRAFT
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.3.1Clock Generation Unit (CGU)
The CGU uses a set of building blocks to generate the clock for the output branches. The
building blocks are as follows:
• OSC1M – 1 MHz crystal oscillator
• XO50M – 50 MHz oscillator
• PL160M – PLL
• FDIV0..6 – 7 Frequency Dividers
• Output control
The following clock output branches are generated:
User manualRev. 01.02. — 8 November 2007 47 of 263
PLL160M
clkout /
clkout120 /
clkout240
Output
Control
Clock
outputs
NXP Semiconductors
DRAFT
Preliminary UM
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
DRAFT
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
T DRAFT DRAFT DRAFT DRA
3.3.1.1CGU register overview
The CGU registers are shown in Table 36
.
The clock-generation unit registers have an offset to the base address CGU RegBase
which can be found in the memory map.
Remark: Any clock-frequency adjustment has a direct impact on the timing of on- boar d
peripherals such as the UARTs, SPI, Watchdog, timers, CAN controller, LIN master
controller, ADCs and flash memory interface.
Table 36.CGU register overview
Addres
s offset
000hR7100 0011hreservedReserved004hR0000 0000hreservedReserved008hR0C00 0000hreservedReserved00ChR-reservedReserved014hR/W0000 0000hFREQ_MONFrequency monitor registersee Table 37
018hR0000 0FE3hRDETClock detection registersee Table 38
01ChR0000 0001hXTAL_OSC_STATUSCrystal-oscillator status registersee Table 39
020hR/W0000 0005hXTAL_OSC_CONTROL Crystal-oscillator control registersee Table 40
024hR0005 1103hPLL_STATUSPLL status registersee Table 41
028hR/W0005 1103 hPLL_CONTROLPLL control registersee Table 42
02ChR0000 1001hFDIV_STATUS_0FDIV 0 frequency-divider status registersee Table 43
030hR/W0000 1001hFDIV_CONTROL_0FDIV 0 frequency-divider control registersee Table 44
034hR0000 1001hFDIV_STATUS_1FDIV 1 frequency-divider status registersee Table 43
038hR/W0000 1001hFDIV_CONTROL_1FDIV 1 frequency-divider control registersee Table 44
03ChR0000 1001hFDIV_STATUS_2FDIV 2 frequency-divider status registersee Table 43
040hR/W0000 1001hFDIV_CONTROL_2FDIV 2 frequency-divider control registersee Table 44
044hR0000 1001hFDIV_STATUS_3FDIV 3 frequency-divider status registersee Table 43
048hR/W0000 1001hFDIV_CONTROL_3FDIV 3 frequency-divider control registersee Table 44
04ChR0000 1001hFDIV_STATUS_4FDIV 4 frequency-divider status registersee Table 43
050hR/W0000 1001hFDIV_CONTROL_4FDIV 4 frequency-divider control registersee Table 44
054hR0000 1001hFDIV_STATUS_5FDIV 5 frequency-divider status registersee Table 43
058hR/W0000 1001hFDIV_CONTROL_5FDIV 5 frequency-divider control registersee Table 44
05ChR0000 1001hFDIV_STATUS_6FDIV 6 frequency-divider status registersee Table 43
060hR/W0000 1001hFDIV_CONTROL_6FDIV 6 frequency-divider control registersee Table 44
064hR0000 0000hSAFE_CLK_STATUSOutput-clock status register for
068hR/W0000 0000hSAFE_CLK_CONFOutput-clock configuration register for
06ChR0000 0000hSYS_CLK_STATUSOutput-clock status register for
070hR/W0000 0000hSYS_CLK_CONFOutput-clock configuration register for
The XO50M oscillator can be disabled using the ENABLE field in the oscillator control
register. Even when enabled, this can be bypassed using the BYPASS field in the same
register. In this case the input of the OSC1M crystal is fed directly to the output.
The XO50M oscillator has an HF pin which selects the operating mode. For operation at
higher frequencies (15-50MHz), the XO50M oscillator HF must be enabled. For
frequencies below that the pin must be disabl ed. Setting of the pin is contr olled b y th e HF
in the oscillator control register.
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.3.1.3Controlling the PL160M PLL
The structure of the PLL clock path is shown in Figure 30
Fig 30. PLI60MPLL control mechanisms
The PLL reference input clock can be selected from either of the oscillators. The input
frequency can be directly routed to the post-divider using the BYPASS control. The
post-divider can be bypassed using the DIRECT control.
The post-divider is controlled by settings of the field PSEL in the output control register.
PSEL is a 2-bit value that selects a division between 1 and 8 in powers of 2.
.
The feedback divider is controlled by settings of the MSEL field in the output control
register. The MSEL is a 5 -bit value corresponding to the feedback d ivider minus 1. Thus, if
MSEL is programmed to 0 the feedback divider is 1.
In normal mode the post-divider is enabled and the following relations are verified:
F
clkout
Values of the dividers are chosen with the following process:
User manualRev. 01.02. — 8 November 2007 50 of 263
= MDIV . F
clkin
= F
/ 2PDIV
cco
NXP Semiconductors
1. Specify the input clock frequency F
2. Calculate M to obtain the desired output frequency F
3. Find a value for P so that F
4. Ve rify that all frequencies and divider values conform to the limits
In direct mode, the following relations are verified:
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
clkin
clkout
= 2P / F
cco
clkout
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
with M = F
clkout
/ F
clkin
DR
AFT
DRAFT
DR
F
T DRAF
F
clkout
= M . F
clkin
= F
cco
Unless the PLL is configured in bypass mode it must be locked before using it as a clock
source. The PLL lock indication is read from the PLL status register.
Once the output clock is generated it is possible to use a three-phase outp ut control which
generates three clock signals separated in phase by 120°. This setting is controlled by
field P23EN.
Settings to power down the PLL, controlled by field PD in the PLL control register, and
safe switch setting controlled by the AUTOBLOK field are not shown in the illustration.
Note that safe switching of the clock is not enabled at reset.
3.3.1.4Controlling the frequency dividers
The seven frequency dividers are controlled by the FDIV0..6 registers.
The frequency divider divides the incoming clock by (L/D), where L and D are both 12 -bit
values, and attempts to produce a 50% duty-cycle. Each high or low phase is stretched to
last approximately D/(L*2) input-clock cycles. When D/(L*2) is an integer the duty cycle is
exactly 50%; otherwise it is an approximation.
The minimum division ratio is /2, so L should always be less than or equal to D/2. If not, or
if L is equal to 0, the input clock is passed directly to the output without being divided.
3.3.1.5Controlling the cloc k ou tp u t
Once a source is selected for one of the clock branches the output clock can be further
sub-divided using an output divider controlled by field IDIV in the clock-output
configuration register.
Each clock-branch output can be individually controlled to power it down and perform safe
switching between clock domains. These settings are controlled by the PD and
AUTOBLOK fields respectively.
The clock output can trigger disabling of the clock branch on a specific polarity of the
output. This is controlled via field RTX of the output-configuration register.
3.3.1.6Reading the control settings
Each of the control registers is associated with a status register. These registers can be
used to read the configured controls of each of the CGU building blocks.
3.3.1.7Frequency monitor
The CGU includes a frequency-monitor mechanism which measures the clock pulses of
one of the possible clock sources against the reference clock. The reference clock is the
PCRT block clock pcrt_clk.
User manualRev. 01.02. — 8 November 2007 51 of 263
NXP Semiconductors
Configure XO50MOSC
in normal mode with
HF pin enabled
Configure PLL to use
XO50MOSC as input
and generate 80MHz
(Fin = 10 MHz
and Fcco = 160 MHz)
with 3-phase output
enabled
Wait for PLL to lock
Configure FR clock
to 40 MHz
Configure FDIV5 to use
120° PLL output and
generate ~3.6866 MHz
Configure UART_CLK
to use FDIV5 and
divide by 2
When a frequency-monitor measurement begins two counters are started. The first starts
from the specified number of reference-clock cycles (set in field RCNT) and counts down
to 0: the second counts cycles of the monitored frequency starting from 0. The
measurement is triggered by enabling it in field MEAS and stops either when the
reference clock counter reaches 0 or the measured clock counter (in field FCNT)
saturates.
The rate of the measured clock can be calculated using the formula:
Fmeas = Fcore * FCNTfinal / (RCNTinitial - RCNTfinal)
When the measurement is finished either FCNTfinal is equal to the saturated value of the
counter (FCNT is a 14-bit value) or RCNTfinal is zero.
Measurement accuracy is influenced by the ratio between the clocks. For greater
accuracy the frequency to measure should be closer to the reference clock.
3.3.1.8Clock detection
All of the clock sources have a clock detector, the status of which can be read in a CGU
register. This register indicates which sources have been detected.
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
If this is enabled, the absence of any clock source can trigger a hardware interrupt.
3.3.1.9Bus disable
This safety feature is provided to avoid accidental changing of the clock settings. If it is
enabled, access to all registers except the RBUS register (so that it can be disabled) is
disabled and the clock settings cannot be mod i fie d.
3.3.1.10Clock-path programming
The following flowchart shows the sequence for programing a complete clock path:
Fig 31. Progr amming the clock path
3.3.1.11Frequency monitor register
The CGU can report the relative frequency of any operating clock. The clock to be
measured must be selected by software, while the fixed-frequency BASE_PCR_CLK is
used as the reference frequency. A 14-bit counter then counts the number of cycles of the
measured clock that occur during a user-defined number of re ference-clock cycles. Whe n
the MEAS bit is set the measured-clock counter is reset to 0 and counts up, while the 9-bit
reference-clock counter is loaded with the value in RCNT and then counts down towards
0. When either counter reaches its terminal value both counters are disabled and the
MEAS bit is reset to 0. The current values of the counters can then be read out and the
selected frequency obtained by the following equation:
If RCNT is programmed to a value equal to the core clock frequency in kHz a nd reaches 0
before the FCNT counter saturates, the value stored in FCNT would then show the
measured clock’s frequency in kHz without the need for any further calculation.
Note that the accuracy of this measurement can be affected by several factors.
Quantization error is noticeable if the ratio between the two clocks is large (e.g. 100 kHz
vs. 1kHz), because one counter saturates while the other still has only a small count
value. Secondly, due to synchronization, the counters are not started and stopped at
exactly the same time. Finally, the measured frequency can only be to the same level of
precision as the reference frequen cy.
Table 37.FREQ_MON register bit description
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELR/WClock-source selection for the clock to be
23MEASR/WMeasure frequency
22 to 9FCNTRSelected clock-counter value
8 to 0RCNTR/WReference clock-counter value
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
Each clock generator has a clock detector associated with it to alert the system if a clock
is removed or connected. The status register RDET can determine the current
‘clock-present’ status.
User manualRev. 01.02. — 8 November 2007 53 of 263
NXP Semiconductors
If enabled, interrupts are generated whenever ‘clock present’ changes status, so that an
interrupt is generated if a clock changes from ‘present’ to ‘non-present’ or from
‘non-present’ to ‘present’.
T able 38.RDET register bit description
* = reset value
BitSymbolAccess Value Description
31 to 12 reservedR-Reserved
11FDIV6_PRESENTRActivity-detection register for FDIV 6
10FDIV5_PRESENTRActivity-detection register for FDIV 5
9FDIV4_PRESENTRActivity-detection register for FDIV 4
8FDIV3_PRESENTRActivity-detection register for FDIV 3
7FDIV2_PRESENTRActivity-detection register for FDIV 2
6FDIV1_PRESENTRActivity-detection register for FDIV 1
5FDIV0_PRESENTRActivity-detection register for FDIV 0
4PLL240_PRESENTRActivity-detection register for 240
3PLL120_PRESENTRActivity-detection register for 120
2PLL_PRESENTRActivity-detection register for normal PLL
1XTAL_PRESENTRActivity-detection register for crystal
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
1*Clock present
0Clock not present
1*Clock present
0Clock not present
1*Clock present
0Clock not present
1*Clock present
0Clock not present
1*Clock present
0Clock not present
1*Clock present
0Clock not present
1*Clock present
0Clock not present
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
°-shifted
PLL output
1*Clock present
0Clock not present
°-shifted
PLL output
1*Clock present
0Clock not present
output
1*Clock present
0Clock not present
-oscillator output
1*Clock present
0Clock not present
User manualRev. 01.02. — 8 November 2007 54 of 263
NXP Semiconductors
T able 38.RDET register bit description
* = reset value
BitSymbolAccess Value Description
0LP_OSC_PRESENTRActivity-detection register for LP_OSC
3.3.1.13Crystal-oscillator status register
The register XTAL_OSC_STATUS reflects the status bits for the crystal oscillator.
Table 39.XTAL_OSC_STATUS register bit description
* = reset value
BitSymbolAccess Value Description
31 to 3reservedR-Reserved
2HFROscillator HF pin
1BYPASSRConfigure crystal operation or external clock
0ENABLEROscillator-pad enable
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
…continued
1*Clock present
0Clock not present
1*Oscillator high-freq uency mode (crystal or
external clock source above 10 MHz)
0Oscillator low-frequency mode (crystal or
external clock source below 20 MHz)
input pin XIN_OSC
0Operation with crystal connected
1*Bypass mode. Use this mode when an external
clock source is used instead of a crystal
0Power-down
1*Enable
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.3.1.14Crystal-oscillator control register
The register XTAL_OSC_CONTROL contains the control bits for the crystal oscillator.
Following a change of ENABLE bit in XTAL_OSC_CONTROL register requires a read in
XTAL_OSC_STATUS to confirm ENABLE bit is indeed changed.
T able 40.XTAL_OSC_CONTROL register bit description
User manualRev. 01.02. — 8 November 2007 55 of 263
[1]
[2]
[2]
NXP Semiconductors
fclkoutPLLMfclkin
fcco
2.P
---------- -
==
T able 40.XTAL_OSC_CONTROL register bit description …continued
* = reset value
BitSymbolAccess Value Description
0ENABLER/WOscillator-pad enable
[1] Do not change the BYPASS and ENABLE bits in one write-action: this will result in unstable device
[2] For between 10 MHz to 20 MHz the state of the HF pin is don’t care, see also the crystal specification notes
3.3.1.15PLL status register
The register PLL_STATUS reflects the status bits of the PLL.
Table 41.PLL_STATUS register bit description
* = reset value
BitSymbolAccess Value Description
31 to 1reservedR-Reserved; do not modify. Read as logic 0, write
0LOCKRIndicates if the PLL is in lock or not.
operation!
in Ref. 1
. Section 11 (Oscillator).
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
0Power-down
1*Enable
as logic 0
1In lock
0*Not in lock
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
[1]
DR
AFT
DRAFT
DR
F
T DRAF
3.3.1.16PLL control register
The PLL_CONTROL register contains the control bits for the PLL.
Post-divider ratio programming
The division ratio of the post-divider is controlled by PSEL[0:1] in the PLL_CONTROL
register. The division ratio is twice the value of P. This guarantees an output clock with a
50% duty cycle.
Feedback-divider ratio programming
The feedback-divider division ratio is controlle d by M SEL[ 4: 0] in the PLL_ C ON T ROL
register. The divisio n ratio between the PLL output clock and the input clock is the decimal
value on MSEL[4:0] plus one.
Frequency selection
Mode 1 - Normal mode
In this mode the post-divider is enabled, giving a 50% duty cycle clock with the frequency
relations described below:
The output frequency of the PLL is given by the following equation:
User manualRev. 01.02. — 8 November 2007 56 of 263
NXP Semiconductors
fclkoutMfclkinfcco==
1. Specify the input clock frequency f
2. Calculate M to obtain the desired output frequency f
3. Find a value for P so that f
4. Verify that all frequencies and divider values conform to the limits specified.
Mode 2 - Direct CCO Mode
In this mode the post-divider is bypassed and the CCO clock is sent directly to the
output(s), leading to the following frequency equation:
To select the appropriate values for M and P:
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
clkin
clkout PLL
= 2.P.f
cco
clkout
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
with M = f
clkout/fclkin
DR
AFT
DRAFT
DR
F
T DRAF
1. Specify the input clock frequency f
2. Calculate M to obtain the desired output frequency f
clkin
clkout
with M = f
clkout/fclkin
3. Verify that all frequencies and divider values conform to the limits specified.
Note that although the post-divider is not used, it still runs in this mode. To reduce current
consumption to the lowest possible value it is recommended to set PSEL[1:0] to ’00’. This
sets the post-divider to divide by two, which causes it to consume the least amount of
current.
T able 42.PLL_CONTROL register bit description
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELR/WClock-source Selection for clock generator to
be connected to the input of the PLL.
00h*Not used
01hCrystal oscillator
02h to
FFh
23 to 16 MSEL[4:0]R/WFeedback-divider division ratio (M)
000001
000012
000103
000114
00100*5
::
1111132
15 to 12 reservedRReserved
11AUTOBLOKW1Enables auto-blocking of clock when
User manualRev. 01.02. — 8 November 2007 57 of 263
NXP Semiconductors
T able 42.PLL_CONTROL register bit description …continued
* = reset value
BitSymbolAccess Value Description
9 and 8PSEL[1:0]R/WPost-divider division ratio (2P)
7DIRECTR/WDirect CCO clock output control
6 to 3reservedRReserved
7 to 3reservedRReserved
2P23ENR/WThree-phase output mode control
1BYPASSR/WInput-clock bypass control
0PDR/WPower-down control
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
002
01*4
108
1116
0*Clock output goes through post-divider
1Clock signal goes directly to outputs
0*PLL +120 ° and PLL +240° outputs disabled
1PLL +120° and PLL +240° outputs enabled
0CCO clock sent to post-dividers (only for test
modes)
1*PLL input clock sent to post-dividers
0Normal mode
1*Power-down mode
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
[1]
[2]
DR
AFT
DRAFT
DR
F
T DRAF
[1] Changing the divider ratio while the PLL is running is not recommended. Since there is no way of
synchronizing the change of the MSEL and PSEL values with the divider the risk exists that the counter will
read in an undefined value, which could lead to unwanted spikes or drops in the frequency of the output
clock. The recommended way of changing between divider settings is to power down the PLL, adjust the
divider settings and then let the PLL start up again.
[2] To power down the PLL, P23EN bit should also be set to 0.
3.3.1.17Frequency divider status register
There is one status register FDIV_STATUS_n for each frequency divider (n = 0..6). The
status bits reflect the inputs to the FDIV as driven from the control register
Table 43.FDIV_STATUS_n register bit description
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELRSelected source clock for FDIV n
00h*LP_OSC
01hCrystal oscillator
02hPLL
03hPLL +120
04hPLL +240
05h to
User manualRev. 01.02. — 8 November 2007 58 of 263
NXP Semiconductors
Table 43.FDIV_STATUS_n register bit description
* = reset value
BitSymbolAccess Value Description
23 to 12 LOADRLoad value
11 to 0DENOMINATORRDenominator or modulo value.
3.3.1.18Frequency divider control register
There is one control register FDIV_CONTROL_n for each frequency divider (n = 0..6).
The frequency divider divides the incoming clock by (LOAD/DENOMINATOR), where
LOAD and DENOMINATOR are both 12-bit values programmed in the control register
FDIV_CONTROL_n.
Essentially the output clock generates ‘LOAD’ positive edges during every
‘DENOMINATOR’ cycle of the input clock. An attempt is made to produce a 50%
duty-cycle. Each high or low phase is stretched to last approximately
DENOMINATOR/(LOAD*2) input clock cycles. When DENOMINATOR/(LOAD*2) is an
integer the duty cycle is exactly 50%: otherwise the waveform will only be an
approximation. It will be close to 50% for relatively large non-integer values of
DENOMINATOR/(LOAD*2), but not for small values.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
…continued
001h*
001h*
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
The minimum division ratio is divide-by-2, so LOAD should always be less than or equal to
(DENOMINATOR/2). If this is not true, or if LOAD is equal to 0, the input clock is passed
directly to the output with no division.
Table 44.FDIV_CONTROL_n register bit description
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELR/WSelected source clock for FDIV n
00h*LP_OSC
01hCrystal oscillator
02hPLL
03hPLL +120
04hPLL +240
05h to
FFh
23 to 12 LOADR/WLoad value
001h*
11 to 0DENOMINATORR/WDenominator or modulo value.
001h*
Invalid
0
0
3.3.1.19Output-clock status register for BASE_SAFE_CLK and BASE_PCR_CLK
There is one status register for each CGU output clock generated. All output generators
have the same register bits. Exceptions are the output generators for BASE_SAFE_CLK
and BASE_PCR_CLK, which are described here. For the other outputs, see
User manualRev. 01.02. — 8 November 2007 59 of 263
NXP Semiconductors
T able 45.SAFE_CLK_STA TUS, PCR_CLK_STATUS register bit description
* = reset value
BitSymbolAccess Value Description
31 to 5reservedR-Reserved
4 to 2IDIVR000*Integer divide value
1 to 0reservedR-Reserved.
3.3.1.20Output-clock configuration register for BASE_SAFE_CLK and BASE_PCR_CLK
There is one configuration register for each CGU output clock generated. All output
generators have the same register bits. An exception is the output generato rs for
BASE_SAFE_CLK and BASE_PCR_CLK, which are described here. For the other
outputs see Section 3.3.1.22
Table 46.SAFE_CLK_CONF, PCR_CLK_CONF register bit description
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELR/WSelected source clock
23 to 5reservedR-Reserved; do not modify, read as logic 0, write
4 to 2IDIVR/W000*Integer divide value
1 to 0reservedR-Reserved; do not modify. Read as logic 0, write
DRAFT
Preliminary UM
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
DRAFT
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
T DRAFT DRAFT DRAFT DRA
.
00h*LP_OSC
01h to
FFh
Invalid: the hardware will not accept these
values when written
as logic 0
as logic 0
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.3.1.21Output-clock status register
There is one status register for each CGU output clock generated. All output generators
have the same register bits. Exceptions are the output generators for BASE_SAFE_CLK
and BASE_PCR_CLK, see Section 3.3.1.19
XX = SYS, IVNSS, MSCSS, FRSS, UART, SPI, TMR or ADC, TESTSHELL
Table 47.XX_CLK_STATUS register bit description
* = reset value
BitSymbolAccess Value Description
31 to 5reservedR-Reserved
4 to 2IDIVR000*Integer divide value
1RTXR0*Clock-disable polarity
0PDR0*Power-down clock slice
3.3.1.22Output-clock configuration register
There is one configuration register for each CGU output clock generated. All output
generators have the same register bits. Exceptions are the output generators for
BASE_SAFE_CLK and BASE_PCR_CLK, see Section 3.3.1.20
XX = SYS, IVNSS, MSCSS, FRSS, UART, SPI, TMR or ADC, TESTSHELL
User manualRev. 01.02. — 8 November 2007 60 of 263
NXP Semiconductors
Each output generator takes in one input clock and sends one clock out of the CGU. In
between the clock passes through an integer divider and a clock control block. A clock
blocker/switch block connects to the clock control block.
The integer divider has a 3-bit control signal, IDIV, and divides the incoming clock by any
value from 1 through 8. The divider value is equal to (IDIV + 1); if IDIV is equal to zero, the
incoming clock is passed on directly to the next stage. When the input to the integer
divider has a 50% duty cycle the divided output will have a 50% duty cycle for all divide
values. If the incoming duty cycle is not 50% only even divide values will produce an
output clock with a 50% duty cycle.
Table 48.XX_CLK_CONF register bit description
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELR/Wselected source clock
23 to 12 reservedR-Reserved
11AUTOBLOKW-Enables auto-blocking of clock when
10 to 5reservedR-Reserved; do not modify. Read as logic 0, write
4 to 2IDIVR/W000*Integer divide value
1reservedR/W0*Reserved; do not modify . Read as logic 0, write
0PDR/W0*Power-down clock slice
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
User manualRev. 01.02. — 8 November 2007 61 of 263
NXP Semiconductors
Table 49.BUS_DISABLE register bit description
* = reset value
BitSymbolAccess Value Description
31 to 1reservedR-Reserved; do not modify. Read as logic 0, write
0RRBUSR/WBus write-disable bit
3.3.1.24CGU interrupt bit description
Table 50
interrupt registers. For a general explanation of the interrupt concept and a description of
the registers see Section 2.4
Table 50.CGU interrupt sources
Register
bit
31 to 12unusedUnused
11FDIV6FDIV 6 activity state change
10FDIV5FDIV 5 activity state change
9FDIV4FDIV 4 activity state change
8FDIV3FDIV 3 activity state change
7FDIV2FDIV 2 activity state change
6FDIV1FDIV 1 activity state change
5FDIV0FDIV 0 activity state change
4PL160M240PLL +240° activity state change
3PL160M120PLL +120° activity state change
2PL160MPLL activity state change
1crystalCrystal-oscillator activity state change
0LP_OSCRing-oscillator activity state change
DRAFT
Preliminary UM
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
DRAFT
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
T DRAFT DRAFT DRAFT DRA
as logic 0
1No writes to registers within CGU are possible
(except the BUS_DISABLE register)
0*Normal operation
gives the interrupts for the CGU. The first column gives the bit number in the
.
Interrupt sourceDescription
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.3.2Reset Generation Unit (RGU)
3.3.2.1RGU functional description
The RGU allows generation of independent reset signals for the following outputs:
User manualRev. 01.02. — 8 November 2007 62 of 263
NXP Semiconductors
• SMC
• GeSS AHB2VPB
• PeSS AHB2VPB
• GPIO
• UART
• Timer
• SPI
• IVNSS AHB2VPB
• IVNSS CAN
• IVNSS LIN
• EPCSS
• EPCSS PWM
• EPCSS ADC
• EPCSS Timer
• Interrupt controller
• AHB
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
Remark: The PE reset should be used in conjunction with th e CCS reset and possibly the
CHC reset. This ensures that they are all activated together.
Generation of reset outputs is controlled using registers RESET_CTRLx. Note that a POR
reset can also be triggered by software.
The RGU monitors the reset cause for each reset output. The reset cause can be
retrieved with two levels of granularity. The first level indicates one of the following reset
causes:
• No reset has taken place
• Watchdog reset
• Reset generated by software via RGU register
• Other cause
For this level of granularity the reset cause for all reset outputs is conden sed in registers
RESET_STATUSx.
The second level of granularity indicates a more detailed view of the reset cause. This
information is laid out in one register per reset output. Detailed reset causes can be:
User manualRev. 01.02. — 8 November 2007 63 of 263
NXP Semiconductors
This reset cause is indicated in registers RESET_EXT_STATUSx. Note that the reference
‘external’ in the register name means external to the RGU but not necessarily external to
the IC.
The different types of system reset can be ordered according to their scope. The hierarchy
is as follows:
1. POR reset: resets everything in the IC
2. External reset: resets everything in the IC except the OSC 1M oscillator
3. RGU reset: resets RGU and then has the same effect as Watchdog reset
4. Watchdog-triggered reset: triggers PCRT reset
5. PCRT reset: triggers cold reset and resets Watchdog and EFC general-purpose
6. Cold reset: triggers warm reset and resets memory controllers SCU, EFC and CFID
7. Warm reset: does not reset memory controllers SCU, EFC, CFID or Watchdog
outputs
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.3.2.2RGU register overview
The Reset Generation Unit (RGU) registers are shown in Table 51
.
The RGU registers have an offset to the base address RGU RegBase which can be found
in the memory map (see Section 3.3.1.20
Table 51.RGU register overview
Addres
s offset
100hW-RESET_CTRL0Reset control register 0see Table 52
104hW-RESET_CTRL1Reset control register 1see Table 53
110hR/W0000 0140hRESET_STATUS0Reset status register 0see Table 54
114hR/W0000 0000hRESET_STATUS1Reset status register 1see Table 55
118hR/W5555 5555hRESET_STATUS2Reset status register 2see Table 56
11ChR/W5555 5555hRESET_STATUS3Reset status register 3see Table 57
150hRFFFF FFFFh RST_ACTIVE_STATUS0Reset-Active Status register 0see Table 58
154hRFFFF FFFFh RST_ACTIVE_STATUS1Reset-Active Status register 1see Table 59
404hR/W0000 0000hRGU_RST_SRCSource register for RGU resetsee Table 60
408hR/W0000 0000hPCR_RST_SRCSource register for PCRT resetsee Table 61
40ChR/W0000 0010hCOLD_RST_SRCSource register for COLD resetsee Table 62
410hR/W0000 0020hWARM_RST_SRCSource register for WARM resetsee Table 63
480hR/W0000 0020hSCU_RST_SRCSource register for SCU resetsee Table 63
484hR/W0000 0020hCFID_RST_SRCSource register for CFID resetsee Table 63
490hR/W0000 0020hFMC_RST_SRCSource register for EFC resetsee Table 63
494hR/W0000 0020hEMC_RST_SRCSource register for EMC resetsee Table 63
498hR/W0000 0020hSMC_RST_SRCSource register for SMC resetsee Table 63
4A0hR/W0000 0040hGESS_A2V_RST_SRCSource register for GeSS AHB2VPB
4A4hR/W0000 0040hPESS_A2V_RST_SRCSource register for PeSS AHB2VPB
User manualRev. 01.02. — 8 November 2007 64 of 263
NXP Semiconductors
DRAFT
Preliminary UM
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
DRAFT
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
T DRAFT DRAFT DRAFT DRA
Table 51.RGU register overview
Addres
s offset
4A8hR/W0000 0040hGPIO_RST_SRCSource register for GPIO resetsee Table 64
4AChR/W0000 0040 hUART_RST_SRCSource register for UART resetsee Table 64
4B0hR/W0000 0040hTMR_RST_SRCSource register for Timer resetsee Table 64
4B4hR/W0000 0040hSPI_RST_SRCSou r ce register for SPI resetsee Table 64
4B8hR/W0000 0040hIVNSS_A2V_RST_SRCSource register for IVNSS AHB2VPB
4BChR/W0000 0040hIVNSS_CAN_RST_SRCSource register for IVNSS CAN resetsee Table 64
4C0hR/W0000 0040hIVNSS_LIN_RST_SRCSource register for IVNSS LIN resetsee Table 64
4C4hR/W0000 0040hMSCSS_A2V_RST_SRCSource register for MSCSS AHB2VPB
4C8hR/W0000 0040hMSCSS_PWM_RST_SRCSource register for MSCSS PWM
4CChR/W0000 0040hMSCSS_ADC_RST_SRCSource register for MSCSS ADC reset see Table 64
4D0hR/W0000 0040hMSCSS_TMR_RST_SRCSource register for MSCSS Timer
The RGU reset control register allows software to activate and release individual reset
outputs. Each bit corresponds to an individual rese t outp ut, an d writin g a ‘1’ activates that
output. The reset output is automatically de-activated after a fixed delay period.
Table 52.RESET_CONTROL0 register bit description
* = reset value
BitSymbolAccess Value Description
31 to 5reservedR-Reserved; do not modify, write as logic 0
4WARM_RST_CTRL W-Activate WARM_RST
3COLD_RST_CTRLW-Activate COLD_RST
2PCR_RST_CTRLW-Activate PCR_RST
1RGU_RST_CTRLW-Activate RGU_RST
0reserved R-Reserved; do not modify. Write as logic 0
LPC2917/19 - ARM9 microcontroller with CAN and LIN
logic 0
logic 0
logic 0
logic 0
logic 0
logic 0
logic 0
logic 0
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.3.2.4RGU reset status register
The reset status register shows which source (if any) caused the last reset activation per
individual reset output of the RGU. When one (or more) inputs of the RGU caused the
Reset Output to go active (indicated by value ’01’), the respective **_RST_SRC register
can be read, see Section 3.3.2.6
User manualRev. 01.02. — 8 November 2007 70 of 263
NXP Semiconductors
Table 57.RESET_STATUS3 register bit description
* = reset value
BitSymbolAccess Value Description
1 and 0IVNSS_LIN_RST_STATR/WReset IVNSS LIN status
3.3.2.5RGU reset active status register
The reset active status register shows the current value of the reset outputs of the RGU.
Note that the resets are active LOW.
T able 58.RST_ACTIVE_STATUS0 register bit description
* = reset value
BitSymbolAccess Value Description
31 to 5reservedR-Reserved; do not modify
4WARM_RST_STATR1*Current state of WARM_RST
3COLD_RST_STATR1*Current state of COLD_RST
2PCR_RST_STATR1*Current state of PCR_RST
1RGU_RST_STATR1*Current state of RGU_RST
0POR_RST_STAT R1*Current state of POR_RST
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
…continued
00No reset activated since RGU last
came out of reset
01*Input reset to the RGU
10Reserved
11Reset control register
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
T able 59.RST_ACTIVE_STATUS1 register bit description
* = reset value
BitSymbolAccess Value Description
31 and 30reservedR-Reserved; do no t modify
29AHB_RST_STATR1*Current state of AHB_RST
28VIC_RST_STATR1*Current state of VIC_RST
27 to 21reservedR-Reserved; do not modify
20MSCSS_TMR_RST_STATR1*Current state of MSCSS_TMR_RST
19MSCSS_ADC_RST_STATR1*Current state of MSCSS_ADC_RST
18MSCSS_PWM_RST_STATR1*Current state of MSCSS_PWM_RST
17MSCSS_A2V_RST_STATR1*Current state of MSCSS_A2V_RST
16IVNSS_LIN_RST_STATR1*Current state of IVNSS_LIN_RST
15IVNSS_CAN_RST_STATR1*Current state of IVNSS_CAN_RST
14IVNSS_A2V_RST_STATR1*Current state of IVNSS_A2V_RST
13SPI_RST_STATR1*Current state of SPI_RST
12TMR_RST_STATR1*Current state of TMR_RST
11UART_RST_STATR1*Current state of UART_RST
10GPIO_RST_STATR1*Current state of GPIO_RST
9PESS_A2V_RST_STATR1*Current state of PESS_A2V_RST
8GESS_A2V_RST_STATR1*Current state of GESS_A2V_RST
User manualRev. 01.02. — 8 November 2007 71 of 263
NXP Semiconductors
T able 59.RST_ACTIVE_STATUS1 register bit description
* = reset value
BitSymbolAccess Value Description
7reservedR-Reserved; do not modify
6SMC_RST_STATR1*Current state of SMC_RST
5EMC_RST_STATR1*Current state of EMC_RST
4FMC_RST_STATR1*Current state of FMC_RST
3 and 2reservedR-Reserved; do not modify
1CFID_RST_STATR1*Current state of CFID_RST
0SCU_RST_STATR1*Current state of SCU_RST
3.3.2.6RGU reset source registers
The reset source register indicates for each RGU reset output which specific reset input
caused it to go active.
Remark: The POR_RST reset output of the RGU does not have a source register as it
can only be activated by the POR reset module.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
…continued
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
The following reset source register description is applicable to the RGU reset output of the
RGU, which is activated by the RSTN input pin or the POR reset, see Table 246
. To be
able to detect the source of the next PCR reset the register should be cleared by writing a
1 after read.
Table 60.RGU_RST_SRC register bit description
* = reset value
BitSymbolAccess Value Description
31 to 2reservedR-Reserved; do not modify. Read as logic 0
1RSTN_PINR/W0*Reset activated by external input reset
0PORR/W0*Reset activated by power-on-reset
The following reset source register description is applicable to the PCR reset output of the
RGU, which is activated by the Watchdog Timer or the RGU reset, see Table 246
. To be
able to detect the source of the next PCR reset the register should be cleared by writing a
1 after read.
Table 61.PCR_RST_SRC register bit description
* = reset value
BitSymbolAccess Value Description
31 to 4reservedR-Reserved; do not modify. Read as logic 0
3WDT_TMRR/W0*Reset activated by Watchdog timer
(WDT)
2RGUR/W0*Reset activated by RGU reset
1 to 0reservedR-Reserved; do not modify. Read as logic 0
The following reset source register description is applicable for the COLD reset output of
the RGU, that is activated by the PCR reset, see Table 246
. To be able to detect the
source of the next COLD reset the register should be cleared by writing a 0 after read .
User manualRev. 01.02. — 8 November 2007 72 of 263
NXP Semiconductors
T able 62.COLD_RST_SRC register bit description
* = reset value
BitSymbolAccess Value Description
31 to 5reservedR-Reserved; do not modify. Read as logic 0
4PCRR/W1*Reset activated by PCR reset
3 to 0reservedR-Reserved; do not modify. Read as logic 0
The following reset source register description is applicable to all the reset outputs of the
RGU that are activated by the COLD reset, see Table 246
reset the register should be cleared by writing a 0 after read .
Table 63.**_RST_SRC register bit description
* = reset value
BitSymbolAccess Value Description
31 to 6reservedR-Reserved; do not modify. Read as logic 0
5COLDR/W1*Reset activated by COLD reset
4 to 0reservedR-Reserved; do not modify. Read as logic 0
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
. To be able to detect the next
DR
AFT
DRAFT
DR
F
T DRAF
The following reset source register description is applicable to all the reset outputs of the
RGU that are activated by the WARM reset, see Table 246
reset the register should be cleared by writing a 0 after read.
Table 64.**_RST_SRC register bit description
* = reset value
BitSymbolAccess Value Description
31 to 7reservedR-Reserved; do not modify. Read as logic 0
6WARMR/W1*Reset activated by WARM reset
5 to 0reservedR-Reserved; do not modify. Read as logic 0
3.3.2.7RGU bus-disable register
The BUS_DISABLE register prevents any register in the CGU from being written to.
Table 65.BUS_DISABLE register bit description
* = reset value
BitSymbolAccess Value Description
31 to 1reservedR-Reserved; do not modify. Read as logic 0
0RRBUSR/WBus write-disable bit
. To be able to detect the next
1No writes to registers within RGU are possible
(except the BUS_DISABLE register)
0*Normal operation
3.3.3Power Management Unit (PMU)
The PMU allows definition of the power mode for each individual clock leaf. The clock
leaves are divided into branches as follows:
User manualRev. 01.02. — 8 November 2007 74 of 263
NXP Semiconductors
3.3.3.1PMU clock-branch run mode
• the clock should be running
• the clock leaf should be disabled by the AHB automatic-switching setting
• the leaf should follow the system in entering sleep mode and waiting for a wake-up
All these settings can be controlled via register CLK<branch>_<leaf>_CFG.
The following clock leaves are exceptions to the general rule:
• safe_clk – sleep mode and AHB automatic switching are not allowed and cannot be
• sys_clk_cpu – cannot be disabled
• sys_clk – cannot be disabled
• sys_clk_pcrt – cannot be disabled
Clocks that have been programmed to enter sleep mode follow the chosen setting of the
PD field in register PM. This means that with a single write-action all of these domains can
be set either to sleep or to wake up.
disabled
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
Since application of configuration settings may not be inst antaneous, the current setting
can be read in register CLK<branch>_<leaf>_STAT. The registers
CLK<branch>_<leaf>_STAT indicate the configured settings and in field STATEM_STAT
the current setting. The possible states are:
• run – normal clock enabled
• wait – request has been sent to AHB to disable the clock but is waiting to be granted
• sleep0 – clock disabled
• sleep1 – clock disabled and request removed
3.3.3.2PMU clock-branch overview
Within each clock branch the PMU keeps an overview of the power state of the separate
leaves. This indication can be used to determine whether the clock to a branch can be
safely disabled. This overview is kept in register BASE_STAT and contains one bit per
clock branch.
3.3.3.3PMU override gated clock
Some peripherals or subsystems have a feature called the gated clock built in to reduce
power consumption. This means that the peripheral can (in)activate its own clock source.
To disable this feature the Gate-Override control bit can be set. When it is set the branch
clock runs under control of the RUN, AUTO and PD bits.
Some of the clock leaves have a local clock gating mechanism. The PMU allows central
overriding of this feature via the GATEOVR field of registers CLK<branch>_<leaf>_CFG
of the PMU.
Some of the clock leaves have a local clock gating mechanism. The PMU allows central
overriding of this feature via the GATEOVR field of registers CLK<branch>_<leaf>_CFG
of the PMU.
User manualRev. 01.02. — 8 November 2007 79 of 263
NXP Semiconductors
3.3.5Power mode register (PM)
This register contains a single bit, PD, which when set disables all output clocks with
wake-up enabled. Clocks disabled by the power-down mechanism are reactivated when a
wake-up interrupt is detected or when a 0 is written to the PD bit.
T able 75.PM register bit description
* = reset value
BitSymbolAccess Value Description
31 to 1reservedR-Reserved; do not modify. Read as logic 0
0PDR/WInitiate power-down mode:
3.3.6Base-clock status register
Each bit in this register indicates whether the specified base clock can be safely switched
off. A logic zero indicates that all branch clocks generated from this base clock are
disabled, so the base clock can also be switched off. A logic 1 value indicates that there is
still at least one branch clock running.
Table 76.BASE_STAT register bit description
* = reset value
BitSymbolAccess Value Description
31 to 12 reservedR-Reserved; do not modify. Read as logic 0
1 1reservedR1*Reserved
10BASE10_STATR1*Indicator for BASE_CLK_TESTSHELL
9BASE9_STATR1*Indicator for BASE_ADC_CLK
8BASE8_STATR1*Indicator for BASE_TMR_CLK
7BASE7_STATR1*Indicator for BASE_SPI_CLK
6BASE6_STATR1*Indicator for BASE_UART_CLK
5reservedR1*Reserved
4BASE4_STATR1*Indicator for BASE_MSCSS_CLK
3BASE3_STATR1*Indicator for BASE_IVNSS_CLK
2BASE2_STATR1*Indicator for BASE_PCR_CLK
1BASE1_STATR1*Indicator for BASE_SYS_CLK
0BASE0_STATR1*Indicator for BASE_SAFE_CLK
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
1Clocks with wake-up mode enabled
(WAKEUP=1) are disabled
0*Normal operation
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.3.7PMU clock configuration register for output branches
Each generated output clock from the PMU has a configuration register.
Table 77.CLK_CFG_*** register bit description
* = reset value
BitSymbolAccess Value Description
31 to 3reservedR-Reserved; do not modify. Read as logic 0
31 to 6reservedR-Reserved; do not modify. Read as logic 0
5GATEOVR G2R/W1Set overri de gated clock
User manualRev. 01.02. — 8 November 2007 80 of 263
[1]
NXP Semiconductors
Table 77.CLK_CFG_*** register bit description
* = reset value
BitSymbolAccess Value Description
4GATEOVR G1R/W1Set overri de gated clock
3GATEOVR G0R/W1Set overri de gated clock
2WAKEUP
1AUTO
0RUN
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
…continued
0*Normal operation
0*Normal operation
[2]
[2]
[3]
R/W1The branch clock is ’wake-up enabled’. When
the PD bit in the Power Mode register (see
Section 3.3.5
wake-up enabled are switched off. These
clocks will be switched on if a wake-up event is
detected or if the PD bit is cleared. If register bit
AUTO is set, the AHB disable protocol must
complete before the clock is switched off.
0*PD bit has no influence on this branch clock
R/W1Enable auto (AHB disable mechanism). The
PMU initiates the AHB disable protocol before
switching the clock off. This protocol ensures
that all AHB transactions have been completed
before turning the clock off
0*No AHB disable protocol is used.
R/W1*The WAKEUP, PD (and AUTO) control bits
determine the activation of the branch clock. If
register bit AUTO is set the AHB disable
protocol must complete before the clock is
switched off.
0Branch clock switched off
) is set, and clocks which are
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
DRAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
[1]
[1]
F
T DRAF
AFT
DR
[1] Not implemented for all branch clocks: read returns "0". When implemented the number of bits varies
depending on branch-clock requirements.
[2] Tied off to logic LOW for some branch clocks. All writes are ignored for those with tied bits.
[3] Tied off to logic HIGH for some branch clocks. All writes are ignored for those with tied bits.
3.3.8Status register for output branch clock
Like the configuration register, each generated output clock from the PMU has a status
register. When the configura tion register of an output clock is written to the value of the
actual hardware signals may not be updated immediately. This may be due to the auto or
wake-up mechanism. The status register shows the current value of these signals.
Table 78.CLK_STAT_*** register bit description
* = reset value
BitSymbolAccess Value Description
31 to 10 reservedR-Reserved; do not modify. Read as logic 0
[1] Not implemented for all branch clocks: read returns "0". When implemented, the number of bits varies
depending on branch-clock requirements.
3.4System Control Unit (SCU)
The SCU controls some device functionality that is not part of any other block. Settings
made in the SCU influence the complete system.
The SCU manages the port-selection registers, and the SCU control unit defines some
basic device-operation configurations. The function of each I/O pin can be configured. Not
all peripherals of the device can be used at the same time, so the wanted functions are
chosen by selecting a function for each I/O pin.
The two functions are covered in more detail in the following sections.
User manualRev. 01.02. — 8 November 2007 82 of 263
NXP Semiconductors
3.4.1SCU register overview
The System Control Unit registers are shown in Table 79.
The System Control Unit registers have an offset to the base address SCU RegBase
which can be found in the memory map.
Table 79.SCU register overview and port BASE offsets
NameAddress
SFSP0_BASE000hR/W0000 0000hFunction-select port 0 base
SFSP1_BASE100hR/W0000 0000hFunction-select port 1 base
SFSP2_BASE200hR/W0000 0000hFunction-select port 2 base
SFSP3_BASE300hR/W0000 0000hFunction-select port 3 base
-C00hR2000 0000hReserved; do not modify.
-C04hR-Reserved; do not modify.
-C08hR2000 0000hReserved; do not modify.
-C0ChR/W2000 0000hReserved; do not modify.
-D00hR0000 0000hReserved; do not modify.
-D04hR-Reserved; do not modify.
-D08hR0000 0000hReserved; do not modify.
-D0ChR0000 0000hReserved; do not modify.
-FF4hR0000 0000hReserved; do not modify.
-FFChRA09B 2000hReserved; do not modify.
offset
DRAFT
Preliminary UM
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
DRAFT
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
T DRAFT DRAFT DRAFT DRA
Access Reset valueDescriptionReference
address
address
address
address
Read as logic 0
-
Read as logic 0
Read as logic 0
Read as logic 0
Read as logic 0
Read as logic 0
Read as logic 0
Read as logic 0
Read as logic 0
Read as logic 0
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.4.2SCU port function-select registers
The port function-select register configures the pin functions individually on the
corresponding I/O port. For an overview of pinning, see Ref. 1
individual register. Each port has its SFSPn_BASE register as defined above in Table 79
n runs from 0 to 3, m runs from 0 to 31.
Table 80
shows the address locations of the SFSPn_m registers within a port memory
User manualRev. 01.02. — 8 November 2007 83 of 263
. Each port pin has its
.
NXP Semiconductors
Table 80.SCU register overview
Port 2 contains only pins 0 to 27, so for x = 2: reserved; do not modify, read as logic 0
Port 3 contains only pins 0 to 15, so for x = 3: reserved; do not modify, read as logic 0
NameAddress
SFSPn_000hR/W0000 0000hFunction-select port n, pin
SFSPn_104hR/W0000 0000hFunction-select port n, pin
SFSPn_208hR/W0000 0000hFunction-select port n, pin
SFSPn_30ChR/W0000 0000hFunction-select port n, pin
SFSPn_410hR/W0000 0000hFunction-select port n, pin
SFSPn_514hR/W0000 0000hFunction-select port n, pin
SFSPn_618hR/W0000 0000hFunction-select port n, pin
SFSPn_71ChR/W0000 0000hFunction-select port n, pin
SFSPn_820hR/W0000 0000hFunction-select port n, pin
SFSPn_924hR/W0000 0000hFunction-select port n, pin
SFSPn_1028hR/W0000 0000hFunction-select port n, pin
SFSPn_112ChR/W0000 0000hFunction-select port n, pin
SFSPn_1230hR/W0000 0000hFunction-select port n, pin
SFSPn_1334hR/W0000 0000hFunction-select port n, pin
SFSPn_1438hR/W0000 0000hFunction-select port n, pin
SFSPn_153ChR/W0000 0000hFunction-select port n, pin
SFSPn_16
SFSPn_17
SFSPn_18
SFSPn_19
SFSPn_20
SFSPn_21
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
User manualRev. 01.02. — 8 November 2007 84 of 263
NXP Semiconductors
Table 80.SCU register overview
Port 2 contains only pins 0 to 27, so for x = 2: reserved; do not modify, read as logic 0
Port 3 contains only pins 0 to 15, so for x = 3: reserved; do not modify, read as logic 0
NameAddress
SFSPn_2258hR/W0000 0000hFunction-select port n, pin
SFSPn_235ChR/W0000 0000hFunction-select port n, pin
SFSPn_2460hR/W0000 0000hFunction-select port n, pin
SFSPn_2564hR/W0000 0000hFunction-select port n, pin
SFSPn_2668hR/W0000 0000hFunction-select port n, pin
SFSPn_276ChR/W0000 0000hFunction-select port n, pin
SFSPn_2870hR/W0000 0000hFunction-select port n, pin
SFSPn_2974hR/W0000 0000hFunction-select port n, pin
SFSPn_3078hR/W0000 0000hFunction-select port n, pin
SFSPn_317ChR/W0000 0000hFunction-select port n, pin
offset
DRAFT
Preliminary UM
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
DRAFT
LPC2917/19 - ARM9 microcontroller with CAN and LIN
F
T DRAFT DRAFT DRAFT DRA
…continued
Access Reset valueDescriptionReference
see Table 81
22 register
see Table 81
23 register
see Table 81
24 register
see Table 81
25 register
see Table 81
26 register
see Table 81
27 register
see Table 81
28 register
see Table 81
29 register
see Table 81
30 register
see Table 81
31 register
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Table 81 shows the bit assignment of the SFSPn_m registers.
Table 81.SFSPn_m register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 5reservedR-Reserved. Read as logic 0
4 to 2PAD_TYPER/WInput pad type
000*Anal og input
001Digital input without internal pull up/down
010Not allowed
011Digital input with internal pull up
100Not allowed
101Digital input with internal pull down
110Not allowed
111Digital input with bus keeper
1 to 0FUNC_SEL[1:0]R/WFunction-select; for the function-to-port-pin
mapping tables
00*Select pin function 0
01Select pin function 1
10Select pin function 2
11Select pin function 3
User manualRev. 01.02. — 8 November 2007 85 of 263
NXP Semiconductors
[1] These bits control the input section of the I/O buffer. The FUNC_SEL bits will define if a pin is input or
[2] The ‘analog’ connection tow ards the ADC is always enabled. Use PAD_TYPE = 000 when used as analog
[3] When pull-up is activated the input is not 5 V -tolerant.
[4] Each pin has four functions.
3.4.2.1SCU port-selection registers
Functional description: The digital I/O pins of the device are divided into four ports. For
each pin of these ports one out of four functions can be chosen. Refer to Figure 32
schematic representation of an I/O-pin. The I/O functionality is dependent on the
application.
The function of an I/O can be changed ‘on the fly’ during run-time. By default it is assigned
to function 0, which is the GPIO. For each pin of these ports a programmable pull-up and
pull-down resistor (R) is present.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
output depending on the function selected. For GPIO mode the direction is controlled by the direction
register, see Section 3.11.5
bits also for functions of type input.
input to avoid the input buffer oscillating on slow analog-signal transitions or noise. The digital input buffer is
switched off.
. Note that input pad type must be set correctly in addition to the FUNC_SEL
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
. for a
DR
AFT
DRAFT
DR
F
T DRAF
SFSPx_y
Function 0
Function 1
Function 2
Function 3
PAD_TYPE
FUNC_SELRESERVED
Vdd
R
R
VssVss
Fig 32. Schema t ic representation of an I/O pin
Programming example: The driver provides two functions for port selection:
• tmhwSCU_SetPortFunction: sets a specified port (per pin ) to function 0, 1, 2 or 3 a nd
defines the state of the I/O pad (floating or pull-up).
• tmhwSCU_GetPortFunction: gets current function and state of I/O pad per pin of a
specified port.
For specification of the functions for each pin, see Ref. 1
User manualRev. 01.02. — 8 November 2007 86 of 263
.
NXP Semiconductors
3.5Chip and feature identification (CFID) module
3.5.1Functional description
The CFID module contains registers that show and control the functionality of the chip. It
contains an ID to identify the silicon and registers containing information about the
features enabled/disabled on the chip. For more information refer to the datasheet Ref. 1
3.5.1.1Block description
• The CFID module has no external pins.
• Registers have an offset to the base address CFID RegBase. Details can be found in
• The chip identification register contains th e unique ID of the LPC2917/19. The value is
• The package information register (FEAT0) contains a code to identify the package of
• The SRAM configuration register (FEAT1) contains a code to identify the configured
• The flash configuration register (FEAT2) contains a code to identify the configured
LPC2917/19 - ARM9 microcontroller with CAN and LIN
the memory map Ref. 1
.
equal to the JTAG/IEEE 1149.1 boundary-scan ID.
the LPC2917/19.
size of the internal SRAM of the LPC2917/19.
type of the CFID module.
DRAFT
Preliminary UM
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.5.2CFID register overview
The CFID registers are shown in Table 82.
The CFID registers have an offset to the base address CFID RegBase which can be
User manualRev. 01.02. — 8 November 2007 87 of 263
NXP Semiconductors
T able 83.CHIPID register bit description
BitSymbolAccess ValueDescription
27 to 12 PART_NRR09CEhIndicates LPC2917/19
1 1 to 1MANUFACTURER_ID[10:0] R15hIndicates NXP
0reservedR1hReserved
3.5.2.2Package information register
This contains a code to identify the package of the LPC2917/19.
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
…continued
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 84
Table 84.FEAT0 register bit description
BitSymbolAccess ValueDescription
31 to 4reservedR-Reserved; do not modify. Read as
3 to 0PACKAGE_ID[3:0]RIndicates the package type
shows the bit assignment of the FEAT0 register.
3.5.2.3SRAM configuratio n regi st er
This contains a code to identify the configured size of the internal SRAM of the
LPC2917/19.
Table 85
Table 85.FEAT 1 register bit description
BitSymbolAccess ValueDescription
31 to 29 reservedR-Reserved; do not modify. Read as logic 0
28 to 24 DTCM_SIZE[4:0]0010116 kbytes
23 to 21 reservedRReserved; do not modify. Read as logic 0
20 to 16 ITCM_SIZE[4:0]0010116 kbytes
15 to 8reservedRReserved; do not modify. Read as logic 0
7 to 0SRAM_SIZE[7:0]00111111Indicates the size of internal SRAM
shows the bit assignment of the FEAT1 register.
logic 0
0010reserved
0011reserved
0100LQFP144
48 kB
3.5.2.4Flash configuration register
This contains a code to identify the configur ed type of the CFID module. It can be use d by
software to detect different hardware versions of the device. Table 86
shows the bit
assignment of the FEAT2 register.
Table 86.FEAT2 register bit description
BitSymbolAccess ValueDescription
31 to 30 reservedR-Reserved; do not modify. Read as logic 0
29 to 28 PAGE_SIZE[1:0]0132 fla s h-words
27 to 26 reservedRReserved; do not modify. Read as logic 0
25 to 24 WORD_SIZ E[1:0]11128 bits
User manualRev. 01.02. — 8 November 2007 88 of 263
NXP Semiconductors
EVENT INPUTMASK
APRATRMASK
INT
CLR
R
S
R
INT
SET
MASK
SET
MASK
CLR
P
E
N
D
Interrupt
(VIC)
wake-up
(CGU)
Table 86.FEAT2 register bit description
BitSymbolAccess ValueDescription
23 to 16 LARGE_SECTORS[7:0]0B
15 to 8reservedRReserved; do not modify. Read as logic 0
7 to 0SMALL_SECTORS[7:0]088 × 8-kbyte sectors
3.6Event Router (EV)
3.6.1Event Router functional description
The Event Router provides bus-controlled routing of input events to the VIC for use as
interrupt or wake-up signals to the CGU. Event inputs are connected to internal
peripherals and to external interrupt pins. All event inputs are describ ed in Ref. 1
Events are divided into three groups:
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
For 768-kbyte flash (11 × 64-kbyte
sectors)
07
For 512-kbyte flash (7 × 64-kbyte sectors)
.
DR
AFT
DRAFT
DR
F
T DRAF
• Dedicated external interrupts.
EXTINT0..7
• CAN and LIN receive-pin events
RXDC0..5, RXDL..3
• Internal LPC2917/19 events
General CAN controller event, VIC IRQ and FIQ even ts
The CAN and LIN receive-pin events can be used as extra external interrupt pins when
CAN and/or LIN functionality is not needed.
A schematic representation of the Event Router is shown in Figure 33
.
Fig 33. Schema t ic representation of the Event Router
User manualRev. 01.02. — 8 November 2007 89 of 263
NXP Semiconductors
Input events are processed in event slices; one for each event signal. Each of these slices
generates one event signal and is visible in the RSR (Raw S tatus Register). These event s
are then AND-ed with enables from the MASK register to give PEND (PENDing register)
event status. If one or more events are pending the output signals are active.
An event input slice is controlled through bit s in the APR (Activation Polarity Register), the
ATR (Activation Type Register), INT_SET (INTerrupt SET) and INT_CLR (INTerrupt
CLeaR).
• The polarity setting (APR) conditionally inverts the interrupt input event.
• The activation type setting (ATR) selects between latched/edge or direct/level event.
• The resulting interrupt event is visible through a read-action in the RSR.
• The RSR is AND-ed with the MASK register and the result is visible in the PEND
• The wake-up (CGU) and interrupt (VIC) outputs are active if one of the events is
register.
pending.
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.6.2Event Router register overview
The event-router registers are shown in Table 87. These registers have an offset to the
base address ER RegBase which can be found in the memory map.
Table 87.Event Router register overview
Address
offset
C00hR0000 0000hPENDEvent status registersee Table 88
C20hW-INT_CLREvent-status clear registersee Table 89
C40hW-INT_SETEvent-status set registersee Table 90
C60hR07FF FFFFhMASKEvent-enable registersee Table 91
C80hW-MASK_CLREvent-enable clear register see Table 92
CA0hW-MASK_SETEvent-enable set registersee Table 93
CC0hR/W01C0 00FFhAPRActivation polarity registersee Table 94
CE0hR/W07FF FFFFhATRActivation type registersee Table 95
D00hR-reservedReserved; do not modifyD20hR/W0000 0000hRSRRaw-status registersee Table 96
Access Reset valueNameDescriptionReference
3.6.3Event status register
The event status register determines when the Event Router fo rwards an interrupt request
to the Vectored Interrupt Controller, if the corresponding event enable has been set.
User manualRev. 01.02. — 8 November 2007 90 of 263
shows the bit assignment of the PEND register .
NXP Semiconductors
Table 88.PEND register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 27 reservedR-Reserved; do not modify. Read as logic 0
26PEND[26]R1An event has occurred on a corresponding pin,
:::::
0PEND[0]R1An event has occurred on a corresponding pin
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
or logic 1 is written to bit 26 in the INT_SET
register
0*No event is pending or logic 1 has been written
to bit 26 in the INT_CLR register
or logic 1 is written to bit 0 in the INT_SET
register
0*No event is pending or logic 1 has been written
to bit 0 in the INT_CLR register
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.6.4Event-status clear register
The event-status clear register clears the bits in the event status register.
Table 89
Table 89.INT_CLR register bit description
BitSymbolAccess ValueDescription
31 to 27 reservedR-Reserved; do not modify. Read as logic 0
26INT_CLR[26]W1Bit 26 in the event status register is cleared
:::::
0INT_CLR[0]W1Bit 0 in the event status register is cleared
shows the bit assignment of the INT_CLR register.
3.6.5Event-status set register
The event-status set register sets the bits in the event status register.
Table 90
Table 90.INT_SET register bit description
BitSymbolAccess ValueDescription
31 to 27 reservedR-Reserved; do not modify. Read as logic 0
26INT_SET[26]W1Bit 26 in the event status register is set
:::::
0INT_SET[0]W1Bit 0 in the event status register is set
shows the bit assignment of the INT_SET register.
0Bit 26 in the event status register is unchanged
0Bit 0 in the event status register is unchanged
0Bit 26 in the event status register is unchanged
0Bit 0 in the event status register is unchanged
3.6.6Event enable register
The event enable register determines when the Event Router sets the event status and
forwards this to the VIC if the corresponding event-enable has been set.
User manualRev. 01.02. — 8 November 2007 92 of 263
NXP Semiconductors
3.6.9Activation polarity register
The APR is used to configure which level is the active state for the event source.
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 94
Table 94.APR register bit description
BitSymbolAccess ValueDescription
31 to 27 reservedR-Reserved; do not modify. Read as logic 0
26APR[26]R/W1
:::::
[1] Reset value is logic 1 for APR[24:22] and APR[7:0]; reset value is logic 0 for APR[26:25] and APR[21:8].
shows the bit assignment of the APR register.
APR[0]R/W1
3.6.10Activation type register
The A TR is used to co nfigure whether an even t is used directly or is latched. If the event i s
latched the interrupt persists after its source has become inactive until it is cleared by an
interrupt-clear write action. The Event Router includes an edge-detection circuit which
prevents re-assertion of an event interrupt if the input remains at active level after the latch
is cleared. Level-sensitive events are expected to be held and removed by the event
source.
[1]
[1]
0
[1]
[1]
0
The corresponding event is HIGH sensitive
(HIGH-level or rising edge)
The corresponding event is LOW sensitive
(LOW-level or falling edge)
The corresponding event is HIGH sensitive
(HIGH-level or rising edge)
The corresponding event is LOW sensitive
(LOW-level or falling edge)
Table 95
T able 95.ATR register bit description
* = reset value
BitSymbolAccess ValueDescription
31 to 27 reservedR-Reserved; do not modify. Read as logic 0
26ATR[24]R/W1*Corresponding event is latched
:::::
0ATR[0]R/W1*Corresponding event is latched
shows the bit assignment of the ATR register.
3.6.11Raw status register
The RSR shows unmasked events including latched events. Level-sensitive events are
removed by the event source: edge-sensitive events need to be cleared via the eventclear register.
User manualRev. 01.02. — 8 November 2007 93 of 263
NXP Semiconductors
Table 96.RSR register bits
BitSymbolAccess ValueDescription
31 to 27 reservedR-Reserved; do not modify. Read as logic 0
26RSR[26]R1Corresponding event has occurred
:::::
0RSR[0]R1Corresponding event has occurred
3.7Serial Peripheral Interface (SPI)
The LPC2917/19 contains three Serial Peripheral Interface (SPI) modules to enable
synchronous serial communication with slave or master peripherals that have either
Motorola SPI or Texas Instruments synchronous serial interfaces.
The key features are:
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
0*Corresponding event has not occurred
0*Corresponding event has not occurred
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
• Master or slave operation
• Supports up to four slaves in sequential multi-slave operation
• Programmable clock bit rate and prescale based on SPI source clock
(BASE_SPI_CLK), independent of system clock
• Separate transmit and receive FIFO memory buffers; each 16 bits wide by
32 locations deep
• Programmable choice of interface operation: Motorola SPI or Texas Instruments
synchronous serial interfaces
• Programmable data-frame size from four to 16 bits
• Independent masking of transmit FIFO, receive FIFO and receive-overrun interrupts
• Serial clock rate master mode: f
• Serial clock rate slave mode: f
• Internal loop-back test mode
3.7.1SPI functional description
The SPImodule performs serial-to-parallel conversion on data received from a peripheral
device. The transmit and receive paths are buffered with FIFO memories (16 bits wide x
32 words deep). Serial data is transmitted on SPI_TxD and received on SPI_RxD.
3.7.1.1Modes of operation
The SPI module can operate in:
serial_clk
serial_clk
≤ f
= f
CLK_SPI*
CLK_SPI*
/2
/4
• Master mode:
– Normal transmission mode
– Sequential-slave mode
User manualRev. 01.02. — 8 November 2007 94 of 263
NXP Semiconductors
In normal transmission mode software intervention is needed every time a new slave
needs to be addressed. Also some interrupt handling is required.
In normal transmission mode software programs the settings of the SPI module, writes
data to the transmit FIFO and then enables the SPI module. The SPI module transmits
until all data has been sent, or until it gets disabled with data still unsent. When data
needs to be transmitted to another slave software has to re-program the settings of the
SPI module, write new data and enable the SPI module again.
Remark: When reprogramming any of its settings the SPI module needs to be disabled
first, then enabled again after changing the settings. Transmit data can also be added
when the SPI module is still enabled: disabling is not necessary in this case.
Sequential-slave mode
This mode reduces software intervention and interrupt load.
In this mode it is possible to sequentially transmit data to different slaves without having to
reprogram the SPI module between transfers. The purpose of this is to minimize
interrupts, software intervention and bus tra ffic. This mode is only applicable when the SPI
module is in master mode.
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
In the example in Figure 34
which are sent data in sequential-slave mode. Three elements are transferred to slave 1,
two to slave 2, three to slave 3 and finally one to slave 4, after which the SPI module
disables itself. When it gets enab led a gain the sa me d at a is tra nsmitted to the four slaves.
Before entering this mode the transmit data needs to be present in the transmit FIFO. No
data may be added af ter entering seq uential-slave mode . When the dat a to b e transferred
needs to be changed the transmit FIFO needs to be flushed and sequential-slave mode
has to be left and entered again to take over the new data present in the transmit FIFO.
This is necessary because the FIFO contents are saved as a side-effect of entering
sequential-slave mode from normal transmission mode. The data in the transmit FIFO will
be saved to allow transmitting it repeatedly without the need to refill the FIFO with the
same data.
All programming of the settings necessary to adapt to all slaves has to be done before
enabling (starting the transfer) the SPI module in sequential-slave mode. Once a transfer
has started these settings cannot be changed until the SPI module has finished the
transfer and is automatically disabled again. The use of only one slave in sequential-slave
mode is possible.
Once a sequential-slave mode transfer has started it will complete even if the SPI module
is disabled before the transfers are over . When a transfer is finished the SPI module
disables itself and request a sequential-slave mode ready interrupt.
the SPI module supports addressing of four slaves, all of
User manualRev. 01.02. — 8 November 2007 95 of 263
NXP Semiconductors
1
2
3
1
2
1
2
3
1
Transmit FIFO
Slave 1
Slave 2
Slave 3
Slave 4
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
Fig 34. Sequential-slave mode: example
It is possible to temporarily suspend or skip one or more of the slaves in a transfer. To do
this the data in the transmit FIFO does not need to be flushed: during the transfer it is
skipped and nothing happens on the serial interface for the exact time that would have
been used by transferring to the skipped slave. In the receive FIFO dummy zero-filled
words are written, their number being equal to the number of words that would have been
received by the suspended slave. When suspending slaves it is important to keep the
corresponding SLVn_SETTINGS. The NUMBER_WORDS field is necessary to skip the
data for this slave and the oth er settings a re neede d to cr eate the delay of the suspende d
transfer on the serial interface. Suspending a slave does not change anything in the
duration of a sequential-slave transfer.
A slave can also be completely disabled. In this case the transmit FIFO may not hold any
data for this slave, which means the transmit FIFO may need to be flushed and
reprogrammed. The SLVn_SETTINGS for a disabled slave are ignored.
3.7.1.2Slave mode
The SPI module can be used in slave mode by setting the MS_MODE bit in the
SPI_CONFIG register. The settings of the slave can be programmed in the
SLV0_SETTINGS registers that would correspond to slave 0 (offsets 02h4 and 028h).
Only slave 0 can be enabled by writing 01h to the SLV_ENABLE register and setting the
update_enable bit in the SPI_CONFIG register. A slave can only be programmed to be in
normal transmission mode.
3.7.1.3SPI interrupt bit description
Table 109
the bit number in the interrupt registers. For an overview of the interrupt registers see
Table 98
registers see Section 2.4
gives the interrupts for the Serial Peripheral Interface. The first column gives
. For a general explanation of the interrupt concept and a description of the
User manualRev. 01.02. — 8 November 2007 97 of 263
NXP Semiconductors
3.7.3SPI configuration register
The SPI configuration register configures SPI operation mode.
Table 99.SPI_CONFIG register bit des criptio n
* = reset value
BitSymbolAccess Value Description
31 to 16 INTER_SLAVE_DLYR/WThe minimum delay between two transfers
15 to 8reservedR-Reserved; do not modify. Read as logic 0
7UPDAT E_ENABLER/WUpdate enable bit
6SOFTWARE_RESET R/WSoftware reset bit.
5TIMER_TRIGGERR/WTimer trigger-block bit
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
to different slaves on the serial interface
(measured in clock cycles of CLK_SPIx)
The minimum value is 1.
0001h*
This must be set by software when the
SLV_ENABLE register has been
programmed. It will be automatically cleared
when the new value is in use.
In sequential-slave mode the newly
programmed value will be used when the
pending sequential-slave transfer finishes.
In normal transmission mode the newly
programmed value will be used right away
(after a clock-domain synchronization delay)
1The newly programmed value in th e
SLV_ENABLE register is not used for
transmission yet. As soon as the value is
used this bit is cleared automatically.
0*The current value in the SLV_ENABLE
register is used for transmission. A new
value may be programmed. As soon as
update enable is cleared again the new
value will be used for transmission
1Writing 1 to this bit resets the SPI module
completely. This bit is self-clearing
0*
When set the trigger pulses received from a
timer (outside the SPI) enable the SPI
module; otherwise they are ignored.
NOTE: the SPI module can only be enabled
by the timer when in sequential-slave mode,
otherwise the trigger pulses are ignored.
Timer2 Match Outputs:
Tmr2, Match0 --> SP10, trigger in
Tmr2, Match1 --> SP11, trigger in
Tmr2, Match2 --> SP12, trigger in
1Trigger pulses enable SPI module
0*Trigger pulses are ignored
User manualRev. 01.02. — 8 November 2007 99 of 263
NXP Semiconductors
Table 100. SLV_ENABLE register bit description
* = reset value
BitSymbolAccess Value Description
31 to 8 r eservedR-Reserved; do not modify. Read as logic 0
6 and 7 SLV_ENABLE_3R/WSlave enable slave 3
4 and 5 SLV_ENABLE_2R/WSlave enable slave 2
3 and 2 SLV_ENABLE_1R/WSlave enable slave 1
1 and 0 SLV_ENABLE_0R/WSlave enable slave 0
DRAFT
Preliminary UM
LPC2917/19 - ARM9 microcontroller with CAN and LIN
00*The slave is disabled
01The slave is enabled
10Not supported
1 1The slave is suspended
00*The slave is disabled
01The slave is enabled
10Not supported
1 1The slave is suspended
00*The slave is disabled
01The slave is enabled
10Not supported
1 1The slave is suspended
00*The slave is disabled
01The slave is enabled
10Not supported
1 1The slave is suspended
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
[1]
[1]
[1]
[1]
DR
AFT
DRAFT
DR
F
T DRAF
[1] In normal transmission mode only one slave may be enabled and the others should be disabled: in
sequential-slave mode more than one slave may be enabled. Slaves can also be suspended, which means
they will be skipped during the transfer. This is used to avoid sending data to a slave while there is data in
the transmit FIFO for that slave, thus skipping data in the transmit FIFO.
3.7.5SPI transmit-FIFO flush register
The transmit-FIFO flush register forces transmission of the transmit FIFO contents.
Table 101. TX_FIFO_FLUSH register bit description
BitSymbolAccess Value Description
31 to 1 reservedR-Reserved; do not modi fy. Read as logic 0
0TX_FIFO_FLUSHW1Flush transmit FIFO
In sequential-slave mode the transmit FIFO
keeps its data by default. This means that the
FIFO needs to be flushed before changing its
contents.
3.7.6SPI FIFO data register
The FIFO data register is used to write to the transmit FIFO or read from the receive FIFO.