The LPC29xx combine an 125 MHz ARM968E-S CPU core, Full Speed USB 2.0 OTG
and device, CAN and LIN, up to 56 kB SRAM, up to 768 kB flash memory, external
memory interface, two or three 10-bit ADCs, and multiple serial and parallel interfaces in a
single chip targeted at consumer, industrial, medical, and communication. To optimize
system power consumption, the LPC29xx ha s a very flexible Clock Generation Unit
(CGU) that provides dynamic clock gating and scaling.
2.About this user manual
This document describes the following par ts: LPC2917/01, LPC2919/01, LPC2921,
LPC2923, LPC2925, LPC2927, LPC2929, LPC2930, a nd LPC29 39. Differences between
the various parts as they apply to each block or peripheral are listed at the beginning of
each chapter. For an overview of features see Table 1–2
DRAFT
.
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
F
T DRAFT DRAFT DRAFT DRA
DR
DRAFT
3.General features
Remark: See Table 1–2 for feature details for each LPC29xx part.
• ARM968E-S processor running at frequencies of up to 125 MHz maximum.
• Multi-layer AHB system bus at 125 MHz with four separate layers.
• On-chip memory:
– Two Tightly Coupled Memories (TCM), up to 32 kB Instruction (ITCM), up to 32 kB
– Two separate internal Static RAM (SRAM) instances; 32 kB SRAM and 16 kB
– 8 kB ETB SRAM.
– Up to 768 kB flash-program memory with 16 kB EEPROM.
• Dual-master , eight-channel GPDMA controller on the AHB multilayer matrix which can
be used with the SPI interfaces and the UARTs, as well as for memory-to-memory
transfers including the TCM memories.
• External Static Memory Controller (SMC) with eight memory banks; up to 32-bit data
bus; up to 24-bit address bus.
• Serial interfaces:
– USB 2.0 full-speed device/OTG controller with dedicated DMA controller and
– Two-channel CAN controller supporting Full-CAN and extensive message filtering
– Two LIN master controllers with full hardware support for LIN communication.
– Two 550 UARTs with 16-byte Tx and Rx FIFO depths, DMA support, and RS485
Data TCM (DTCM).
SRAM.
on-chip PHY for device and Host (LPC2930/39 only) functio ns.
• Up to 108 general-purpose I/O pins with programmable pull-up, pull-down, or bus
• Vectored Interrupt Controller (VIC) with 16 priority levels.
• Up to 24 level-sensitive external interrupt pins, including CAN and LIN wake-up
• Configurable clock-out pin for driving external system clocks.
• Processor wake-up from power-down via external interrupt pins; CAN or LIN activity.
• Flexible Reset Generator Unit (RGU) able to control resets of individual modules.
• Flexible Clock-Generation Unit (CGU) able to control clock frequency of individual
• Highly configurable system Power Management Unit (PMU):
• Standard ARM test and debug interface with real-time in-circuit emulator.
• Boundary-scan test supported.
• ETM/ETB debug functions with 8 kB of dedicated SRAM also accessible for
• Dual power supply:
DRAFT
Chapter 1: LPC29xx Introductory information
– Three full-duplex Q-SPIs with four slave-select lines; 16 bits wide; 8 locations
deep; Tx FIFO and Rx FIFO.
2
– Two I
– Up to three ADCs: Two 10-bit ADCs, 8-channels each, with 3.3 V measurement
– Multiple trigger-start option for all ADCs: timer, PWM, other ADC and external
– Four 32-bit timers each containing four capture-and-compare registers linked to
– Four six-channel PWMs (Pulse-Width Modulators) with capture and trap
– Two dedicated 32-bit timers to schedule and synchronize PWM and ADC.
– Quadrature encoder interface that can monitor one external quadrature encoder.
– 32-bit watchdog with timer change protection, running on safe clock.
keeper.
features.
modules:
– On-chip very low-power ring oscillator; fixed frequency of 0.4 MHz; always on to
– On-chip crystal oscillator with a recommended operating range from 10 MHz to
– On-chip PLL allows CPU operation up to a maximum CPU rate of 125 MHz.
– Generation of up to 11 base clocks.
– Seven fractional dividers.
clock control of individual modules.
allows minimization of system operating power consumption in any configuration.
application code and data storage.
C-bus interfaces.
range and one, 8-channel 10-bit ADC with 5.0 V measurement range provide a
total of up to 24 analog inputs, with conversion times as low as 2.44 μs per
channel. Each channel provides a compare function to minimize interrupts.
signal input.
I/Os.
functionality.
provide a Safe_Clock source for system monitoring.
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
Grey-shaded blocks represent peripherals with connections to the GPDMA.
NXP Semiconductors
6.Functional blocks
This chapter gives an overview of the functional blocks, clock domains, and power modes.
See Table 1–2
The functional blocks are explained in detail in the following chapters. Several blocks are
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 respond s to sleep and wake-up
events).
CGU0Clock Generation UnitControls clock sources and clock
CGU1clock generation unitUSB clocks and clock out
RGUreset generation unitPMU power management unit-
interface
DRAFT
Chapter 1: LPC29xx Introductory information
…continued
-
domains
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
UM10316
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
7.Architectural overview
The LPC29xx consists of:
• An ARM968E-S processor with real-time emulation support
• An AMBA multi-layer Advanced High-performance Bus (AHB) for interfacing to the
on-chip memory controllers
• Two DTL buses (an universal NXP interface) for interfacing to the interrupt controller
and the Power, Clock and Reset Control cluster (also called subsystem).
• Three ARM Peripheral Buses (APB - a compatible superset of ARM's AMBA
advanced peripheral bus) for connection to on-chip peripherals clustered in
subsystems.
• One ARM Peripheral Bus for event router and system control.
The LPC29xx configures the ARM968E-S processor in little-endian byte order. All
peripherals run at their own clock frequency to optimize the total system power
consumption. The AHB2APB bridge used in the subsystems contains a write-ahead buffer
one transaction deep. This implies that when the ARM968E-S issues a buff ered write
action to a register located on the APB side of the bridge, it continues even though the
actual write may not yet have taken place. Completion of a second write to the same
subsystem will not be executed until the first write is finished.
8.ARM968E-S processor
The ARM968E-S is a general purpose 32-bit RISC processor, which offers high
performance and very low power consumption. The ARM architecture is based on
Reduced Instruction Set Computer (RISC) principles, and the instruction set and related
decode mechanism are much simpler than those of microprogrammed Complex
Instruction Set Computers (CISC). This simplicity results in a high instruction throughput
and impressive real-time interrupt respon se fro m a sm all and co st- effective con tr olle r
core.
Amongst the most compelling features of the ARM968E-S are:
• Separate directly connected instruction and data Tightly Coupled Memory (TCM)
• Write buffers for the AHB and TCM buses
• Enhanced 16 × 32 multiplier capable of single-cycle MAC operations and 16-bit fixed-
Pipeline techniques are employed so that all pa rts of the p rocessing and memory systems
can operate continuously. The ARM968E-S is based on the ARMv5TE five-stage pipeline
architecture. Typica lly, in a three-stage pipeline architecture, while one instruction is being
executed its successor is being decoded and a third instruction is being fetched from
memory. In the five-stage pipeline additional stages are added for memory access and
write-back cycles.
The ARM968E-S processor also employs a unique architectural strategy known as
THUMB, which makes it ideally suited to high-volume applications with memory
restrictions or to applications where code density is an issue.
DRAFT
Chapter 1: LPC29xx Introductory information
interfaces
point DSP instructions to accelerate signal-processing algorithms and applications.
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
UM10316
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRAFT
DRA
F
DR
AFT
DR
T DRAF
The key idea behind THUMB is that of a super-reduced instruction set. Essentially, the
ARM968E-S processor has two instruction sets:
• Standard 32-bit ARMv5TE set
• 16-bit THUMB set
The THUMB set's 16-bit instruction length allows it to approach twice the density of
standard ARM code while retaining most of the ARM's performance advantage over a
traditional 16-bit controller using 16-bit registers. This is possible because THUMB code
operates on the same 32-bit register set as ARM code.
THUMB code can provide up to 65 % of the code size of ARM, and 160 % of the
performance of an equivalent ARM controller connected to a 16-bit memory system.
The ARM968E-S processor is described in detail in the ARM968E-S data sheet.
9.On-chip flash memory system
The LPC29xx includes up to 768 kB flash memory. This memory can be used for both
code and data storage. Flash memory can be programmed in- system via a serial port
(e.g., CAN).
10. On-chip static RAM
In addition to the two 16 kB or 32 kB TCMs, the LPC29xx includes two static RAM
memories: one of up to 32 kB and one of 16 kB. Both may be used for code and/or data
storage.
The memory configuration varies for the different LPC29xx parts (see Table 2–6). In
addition to the memory blocks, peripheral register blocks in memory region 7 are available
only if the peripheral is implemented. See Table 2–7
peripheral registers are available on all LPC29xx parts.
The LPC29xx uses an AHB multilayer bus with the CPU and the GPDMA as the bus
masters. The AHB slaves are connected to the AHB-lite multilayer bus.The ARM968E-S
CPU has access to all AHB slaves and hence to all address regions.
The ARM9 processor has a 4 GB of address space. The LPC29xx has divided this
memory space into eight regions of 512 MB each. Each region is used for a dedicated
purpose.
An exception to this is region 0; several of the other regions (or a part of it) can be
shadowed in the memory map at this region. This shadowing can be controlled by
software via the programmable re-mapping registers (see Table 6–64
Table 8.LPC29xx memory regions
Memory region #AddressDescription
00x0000 0000TCM area and shadow area
10x2000 0000embedded flash area
20x4000 0000external static memory area
30x6000 0000external static memory controller area
40x8000 0000internal SRAM area
50xA000 0000not used
60xC000 0000not used
70xE000 0000bus-peripherals area
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 2: LPC29xx memory mapping
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
).
DR
AFT
DRAFT
DR
F
T DRAF
Figure 2–6 gives a graphical overview of the LPC29xx memory map.
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
Fig 6.LPC29xx system memory map: graphical overview
(1) See Section 2–1 for part-specific implementation. Gray-shaded memory regions are accessible by the GPDMA controller.
Chapter 2: LPC29xx memory mapping
DRAFT
D
RAFT DRA
D
RAFT DRAFT DRAFT DRAFT DRAFT D
UM10316
F
T DRAFT DRAFT DRAFT DRA
DRA
F
T DRAF
DR
D
RAFT
DRAFT
DR
AFT
DRAFT
DR
AFT
NXP Semiconductors
Region #0:TCM area
0x0000_0000 - 0x1FFF_FFFF
(Offset Address
0x0000 0000
0x1FFF FFFF
0x0000 4000/0
0x0040 0000
I-TCM region aliasses
I-TCM (16/32 kByte)
0x0080 0000
D-TCM region aliasses
D-TCM (16 kByte)
region #0 no physical memory
0x0040 4000/0
3.1 Region 0: TCM/shadow area
The ARM968E-S processor has its exception vectors located at address logic 0. Since
flash is the only non-volatile memory available in the LPC29xx, 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 enable d, the Tightly Coupled
Memories (TCMs) occupy fixed address locations in region 0 as indicated in Figure 2–6
Information on how to enable the TCMs can be found in the ARM documentation, see
Ref. 31–2
To enable memory re-mapping, the LPC29xx AHB system memory map provides a
shadow area (region 0) starting at address log ic 0 . This is a vir tual memo ry re gio n, i.e. no
actual memory is present at the shadow area addresses. A selectable region of the AHB
.
.
system memory map is, apart from its own specific region, also accessible via this shadow
area region.
NXP Semiconductors
+ 0x00000000
+ 0x1FFFFFFF
+ 0x00200000
FLASH IF1
Configuration Area (4 Kbyte)
+ 0x00200FFF
Embedded FLASH
memory area
512 Kbyte -
768 Kbyte
+ 0x0007FFFF - 0x000BFFF
After reset, the region 1 embedded flash area is always available at the shadow area.
After booting, any other region of the AHB system memory map (e.g. internal SRAM) can
be re-mapped to region 0 by means of the shadow memory mapping register. For more
details about the shadow area see Table 6–64
3.2 Region 1: embedded flash area
Figure 2–8 gives a graphical overview of the embedded flash memory map.
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
DR
DRAFT
Chapter 2: LPC29xx memory mapping
F
T DRAFT DRAFT DRAFT DRA
.
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Fig 8.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 LPC29xx contains only one embedded flash
instance, the memory aperture per instance is defined at 4 Mbyte.
3.3 Region 2: external static memory area
Region 2 is reserved for the external static memory. The LPC29xx provides I/O pins for
eight bank-select signals and 24 address lines. This implies that eight memory banks of
3.4 Region 3: external static memory controller area
The external Static-Memory Controller configuration area is located at region 3
3.5 Region 4: internal SRAM area
Figure 2–6 gives a graphical overview of the internal SRAM memory map.
NXP Semiconductors
Region 4 is reserved for internal SRAM. The LPC29xx has two internal SRAM instances.
Instance #0 is 32 kB, instance #1 is 16 kB. See Section 7–1
3.6 Regions 5 and 6
Regions 5 and 6 are not used.
3.7 Region 7: bus-peripherals area
Figure 2–6 gives a graphical overview of the bus-peripherals area memory map.
Region 7 is reserved for all stand-alone memory-mapped bus peripherals.
The lower part of region 7 is again divided into APB clusters, also referred to as
subsystems in this User Manual. A APB cluster is typically used as the address space for
a set of APB peripherals connected to a single AHB2APB bridge, the slave on the AHB
system bus. The clusters are aligned on 256 kB boundaries. In the LPC29xx four APB
clusters are in use: General SubSystem (GeSS), Peripheral SubSystem (PeSS) ,
Networking SubSystem (IVNSS), and the Modulation and Sampling SubSystem
(MSCSS). The APB peripherals are aligned on 4 kB boundaries inside the APB clusters.
D
RAFT
UM10316
F
T DRAFT DRAFT DRAFT DRA
D
RAFT DRA
.
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
Chapter 2: LPC29xx memory mapping
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
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 LPC29xx 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.
4.Memory-map operating concepts
The basic concept in the LPC29xx 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, elim inating the need
to have portions of the code designed to run in different address ranges.
Because of the location of the exception-handler vectors on the ARM9 processor (at
addresses 0000 0000h through 0000 001Ch: see Table 2–9
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 LPC29xx 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 both 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.
) By default, after reset, the
Within the address space of an existing peripheral a dat a-abort exception is not gen erated
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 sp ace are not defined in the LPC29xx
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.
The CGU0 is part of the Power Control, Clock, and Reset control (PCR) block and
provides the clocks for all subsystems. A second, dedicated CGU1 provides the clocks for
the USB block and a clock output. The CGU1 has two clock inputs to its PLL which are
internally connected to two base clocks in the CGU0.
Both CGUs are functionally identical and have their own PLL and fractional divider
registers.
The following clock output branches are generated (Table 3–12
Table 12.CGU0 base clocks
Number NameFrequency
0BASE_SAFE_CLK0.4base safe clock (always on) for WDT
1BASE_SYS_CLK125base system clock; ARM and AHB clock
2BASE_PCR_CLK0.4
3BASE_IVNSS_CLK125base IVNSS subsystem clock for
4BASE_MSCSS_CLK125base MSCSS subsystem clock for
5BASE_ICLK0_CLK125base internal clock 0, for CGU1
6BASE_UART_CLK125base UART clock
7BASE_SPI_CLK50base SPI clock
8BASE_TMR_CLK125base timers clock
9BASE_ADC_CLK4.5 base ADCs clock
10test clock; reserved-this is an internal clock used for testing
1 1BASE_ICLK1_CLK125base internal clock 1, for CGU1
(MHz)
[2]
[1]
Description
base PCR subsystem clock; for power
control subsystem
networking subsystem (CAN, LIN, and
I2C)
modulation and sampling control
subsystem.
only. This clock is running at start-up and
should be disabled in the PMU (see
Table 5–51
configuration registers).
):
for the test shell clock
[1] Maximum frequency that guarantees stable operation of the LPC29xx.
[2] Fixed to low-power oscillator.
3.1 Controlling the XO50M oscillator (external oscillator)
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-25 MHz), 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.
3.2 Controlling the PL160M PLL
The structure of the PLL clock path is shown in Figure 3–12.
The PLL reference input clock is provided by the external oscillator (XO50M). The PLLs
accept an input clock frequency in the range of 10 MHz to 25 MHz only. 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.
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 3: LPC29xx Clock Generation Unit (CGU)
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
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
= MDIV × F
clkin
= F
/ 2×PDIV
cco
Values of the dividers are chosen with the following process:
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
cco
clkin
= 2×P / F
clkout
with M = F
clkout
clkout
/ F
clkin
4. Verify that all frequencies and divider values conform to the limits
In direct mode, the following relations are verified:
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 ou tput 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 registe r, 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.
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 stretch ed 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.4 Controlling the clock output
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.
DRAFT
Chapter 3: LPC29xx Clock Generation Unit (CGU)
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
UM10316
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
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.5 Reading 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.6 Frequency 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
PCR block clock CLK_PCR.
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.
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.
If this is enabled, the absence of any clock source can trigger a hardware interrupt.
3.8 Bus 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 ifie d.
3.9 Clock-path programming
The following flowchart shows the sequence for programing a complete clock path:
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 3: LPC29xx Clock Generation Unit (CGU)
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Fig 13. Programming the clock path
4.CGU1 functional description
The CGU1 block is functionally identical to the CGU0 block and generates two clocks for
the USB interface and a dedicated output clock. The CGU1 block uses its own PLL and
fractional dividers. The PLLs used in CGU0 and CGU1 are identical.
The clock input to the CGU1 PLL is provided by one of two base clocks generated in the
CGU0: BASE_ICLK0_CLK or BASE_INT1CLK. The base clock not used for the PLL can
be configured to drive the output clock directly.
The CGU1 provides the following three base clocks (Table 3–13
Table 13.CGU1 base clocks
Base clockParts of the device clocked by this branch clock
XTAL_OSC_STATUSR0x01CCrystal-oscillator status register0x0000 0001 see Table 3–18
XTAL_OSC_CONTROL R/W0x020Crystal-oscillator control register0x0000 0005 see Table 3–19
PLL_STATUSR0x024PLL status register0x0005 1103 see Table 3–20
PLL_CONTROLR/W0x028PLL control register0x0005 1103 see Table 3–21
FDIV_STATUS_0R0x02CFDIV 0 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_0R/W0x030FDIV 0 frequency-divider control register0x0000 1001 see Table 3–23
FDIV_STATUS_1R0x034FDIV 1 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_1R/W0x038FDIV 1 frequency-divider control register0x0000 1001 see Table 3–23
FDIV_STATUS_2R0x03CFDIV 2 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_2R/W0x040FDIV 2 frequency-divider control register0x0000 1001 see Table 3–23
FDIV_STATUS_3R0x044FDIV 3 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_3R/W0x048FDIV 3 frequency-divider control register0x0000 1001 see Table 3–23
FDIV_STATUS_4R0x04CFDIV 4 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_4R/W0x050FDIV 4 frequency-divider control register0x0000 1001 see Table 3–23
FDIV_STATUS_5R0x054FDIV 5 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_5R/W0x058FDIV 5 frequency-divider control register0x0000 1001 see Table 3–23
FDIV_STATUS_6R0x05CFDIV 6 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_6R/W0x060FDIV 6 frequency-divider control register0x0000 1001 see Table 3–23
SAFE_CLK_STATUSR0x064Output-clock status register for
SAFE_CLK_CONFR/W0x068Output-clock configuration register for
SYS_CLK_STATUSR0x06COutput-clock status register for
SYS_CLK_CONFR/W0x070Output-clock configuration register for
PCR_CLK_STATUSR0x074Output-clock status register for
PCR_CLK_CONFR/W0x078Output-clock configuration register for
IVNSS_CLK_STATUSR0x07COutput-clock status register for
IVNSS_CLK_CONFR/W0x080Output-clock configuration register for
MSCSS_CLK_STATUSR0x084Output-clock status register for
MSCSS_CLK_CONFR/W0x088Output-clock configuration register for
ICLK0_CLK_CONFR/W0x08COutput-clock configuration register for
ICLK1_CLK_STATUSR0x090Output-clock status register for
UART_CLK_STATUSR0x094Output-clock status register for
Table 15. Register overview: CGU1 (CGU1 base address: 0xFFFF B000) …continue d
NameAccess Address
offset
RDETR0x018Clock detection register0x0000 0FE3 see Table 3–17
PLL_STATUSR0x01CPLL status register0x0005 1103 see Table 3–20
PLL_CONTROLR/W0x020PLL control register0x0005 1103 see Table 3–21
FDIV_STATUS_0R0x024FDIV 0 frequency-divider status register0x0000 1001 see Table 3–22
FDIV_CONF_0R/W0x028FDIV 0 frequency-divider control register0x0000 1001 see Table 3–23
USB_CLK_STATUSR0x02COutput-clock status register for
USB_CLK_CONFR/W0x030Output-clock configuration register for
USB_I2C_CLK_STATUSR0x034Output-clock status register for
USB_I2C_CLK_CONFR/W0x38Output-clock configuration register for
OUT_CLK_STATUSR0x03COutput-clock status register for
OUT_CLK_CONFR/W0x040Output-clock configuration register for
BUS_DISABLER/W0xFF4Bus disable register0x0000 0000 see Table 3–30
DescriptionReset valueReference
0x0000 0000 see Table 3–26
BASE_USB_CLK
0x0000 0000 see Table 3–27
BASE_USB_CLK
0x0000 0000 see Table 3–26
BASE_I2C_USB_CLK
0x0000 0000 see Table 3–27
BASE_I2C_USB_CLK
0x0000 0000 see Table 3–26
BASE_OUT_CLK
0x0000 0000 see Table 3–27
BASE_OUT_CLK
DRAFT
DRA
F
DR
AFT
DR
T DRAF
5.1 Frequency 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. When
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 frequency.
Remark: The clock selection in this register depends on whether the register is used for
CGU0 or CGU1. In the CGU0, the low-power oscillator (LP_OSC) or the external crystal
oscillator can be selected as input. In the CGU1, the two CGU0 base clocks
BASE_ICLK0_CLK and BASE_ICLK1_CLK, can be selected instead. CGU1 has only one
fractional divider register.
Table 16.FREQ_MON register bit description (FREQ_MON, address 0xFFFF 8014 (CGU0)
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELR/WClock-source selection for the clock to be
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.
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’.
Remark: The clock selection in this register depends on whether the register is used for
CGU0 or CGU1. In the CGU0, the low-power oscillator (LP_OSC) or the external crystal
oscillator can be selected as input. In the CGU1, the two CGU0 base clocks
BASE_ICLK0_CLK and BASE_ICLK1_CLK, can be selected instead. In the CGU1, only
one fractional divider register is used.
Table 17.RDET register bit description (RDET, address 0xFFFF 8018 (CGU0) or 0xFFFF
* = reset value
BitSymbolAccess Value Description
1XTAL_PRESENT
0LP_OSC_PRESEN
5.3 Crystal-oscillator status register (CGU0)
The register XTAL_OSC_STATUS reflects the status bits for the crystal oscillator.
Table 18.XTAL_OSC_STATUS register bit description (XTAL_OSC_STATUS, address
* = reset value
BitSymbolAccess Value Description
31 to 3reservedR-Reserved
2HFROscillator HF pin
1BYPASSRConfigure crystal operation or external clock
0ENABLEROscillator-p ad enable
B018 (CGU1))
(CGU0) or
BASE_ICLK0_CLK_
PRESENT (CGU1)
T (CGU0) or
BASE_ICLK1_CLK_
PRESENT (CGU1)
0xFFFF 801C)
…continued
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
DRAFT
Chapter 3: LPC29xx Clock Generation Unit (CGU)
F
T DRAFT DRAFT DRAFT DRA
RActivity-detection register for crystal
-oscillator output
1*Clock present
0Clock not present
RActivity-detection register for LP_OSC
1*Clock present
0Clock not present
1*Oscillator high-frequency 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
DR
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
5.4 Crystal oscillator control register (CGU0)
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 19. XTAL_OSC_CONTROL register bit description (XTAL_OSC_CONTROL, address
T able 19. XTAL_OSC_CONTROL register bit description
* = reset value
BitSymbolAccess Value Description
2HFR/WOscillator HF pin
1BYPASSR/WConfigure crystal operation or external-clock
0ENABLER/WOscillator-pad enable
address 0xFFFF 8020)
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 3: LPC29xx Clock Generation Unit (CGU)
F
T DRAFT DRAFT DRAFT DRA
…continued(XTAL_OSC_CONTROL,
1*Oscillator high-frequency mode (crystal or
external clock source 15 to 25 MHz)
0Oscillator low-frequency mode (crystal or
external clock source 1 to 20 MHz)
input pin XIN_OSC
0*Operation with crystal connected
1Bypass mode. Use this mode when an external
clock source is used instead of a crystal
0Power-down
1*Enable
[1]
[1]
DR
AFT
DRAFT
DRA
[2]
[2]
DR
AFT
DRAFT
DR
F
T DRAF
[1] Do not change the BYPASS and ENABLE bits in one write-action: this will result in unstable device
operation!
[2] For between 15 MHz to 20 MHz the state of the HF pin is don’t care, see also the crystal specification notes
in Ref. 31–1
. Section 11 (Oscillator).
5.5 PLL status register (CGU0 and CGU1)
The register PLL_STATUS reflects the status bits of the PLL.
Table 20.PLL_STATUS register bit description (PLL_STATUS, address 0xFFFF 8024
(CGU0) and 0xFFFF B024 (CGU1))
* = reset value
BitSymbolAccess Value Description
31 to 1reservedR-Reserved; do not modify. Read as logic 0, write
as logic 0
0LOCKRIndicates if the PLL is in lock or not.
1In lock
0*Not in lock
5.6 PLL control register (CGU0 and CGU1)
The PLL_CONTROL register contains the control bits for the PLL. In the CGU0, only the
crystal oscillator is allowed as an input to the PLL. In the CGU1, both internal base clocks,
BASE_ICLK0_CLK and BASE_ICLK1_CLK, can be inputs to 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.
The feedback-divider division ratio is controlle d by M SEL[ 4: 0] in the PLL _ CON 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:
To select the appropriate values for M and P:
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 3: LPC29xx Clock Generation Unit (CGU)
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
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
cco
clkin
= 2 × P × f
clkout
clkout PLL
with M = f
clkout/fclkin
4. Verify that all frequencies and divider values conform to the limits specified.
Frequency selection, 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:
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 21. PLL_CONTROL register bit description (PLL_CONTROL, address 0xFFFF 8028
(CGU0) and 0xFFFF B028 (CGU1))
* = 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.
0x00*Not used (CGU0) or BASE_ICLK0_CLK
(CGU1)
0x01Crystal oscillator (CGU0) or BASE_ICLK1_CLK
T able 21. PLL_CONTROL register bit description (PLL_CONTROL, address 0xFFFF 8028
* = reset value
BitSymbolAccess Value Description
23 to 16 MSEL[4:0]R/WFeedback-divider division ratio (M)
15 to 12 reservedRReserved
11AUTOBLOKW1Enables auto-blocking of clock when
10reservedR-Reserved
9 and 8 PSEL[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
Chapter 3: LPC29xx Clock Generation Unit (CGU)
(CGU0) and 0xFFFF B028 (CGU1)) …continued
000001
000012
000103
000114
00100*5
::
1111132
programming changes
0No action
002
01*4
108
1116
0*Clock output goes through post-divider
1Clock signal goes directly to outputs
0*PLL +120° and PLL +240
1PLL +120
0CCO clock sent to post-dividers (only for test
modes)
1*PLL input clock sent to post-dividers
0Normal mode
1*Power-down mode
DRAFT
°
and PLL +240° outputs enabled
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
[2]
D
RAFT
UM10316
F
[1]
°
outputs disabled
DRAFT
T DRAFT DRAFT DRAFT DRA
[1]
DR
AFT
DRA
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.
There is one status register FDIV_STATUS_n for each frequency divider (n = 0..6 for
CGU0). Note that there is only one frequency divider in the CGU1. The status bits reflect
the inputs to the FDIV as driven from the control register
Table 22.FDIV_STATUS_n register bit description (FDIV_STATUS_0 to 6, address 0xFFFF
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELRSelected source clock for FDIV n
23 to 12 LOADRLoad value
11 to 0DENOMINATORRDenominator or modulo value.
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
DR
DRAFT
Chapter 3: LPC29xx Clock Generation Unit (CGU)
F
T DRAFT DRAFT DRAFT DRA
802C/34/3C/44/4C/54/5C (CGU0) and FDIV_STATUS_0, address 0xFFFF B024
(CGU1))
0x00h*LP_OSC (CGU0) or (BASE_ICLK0_CLK)
(CGU1)
0x01hCrystal oscillator (CGU0) or
(BASE_ICLK1_CLK) (CGU1)
0x02hPLL
0x03hPLL +120
0x04hPLL +240
0x05 to
0xFF
0x1*
0x1*
Not used
0
0
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
5.8 Frequency divider configuration register
There is one control register FDIV_CONF_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.
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 23.FDIV_CONF_n register bit description (FDIV_CONF_n, address 0xFFFF
* = reset value
BitSymbolAccess Value Description
31 to 24 CLK_SELR/WSelected source clock for FDIV n
23 to 12 LOADR/WLoad value
11 to 0DENOMINATORR/WDenominator or modulo value.
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 3: LPC29xx Clock Generation Unit (CGU)
F
T DRAFT DRAFT DRAFT DRA
8030/38/40/48/50/58/60 (CGU0) and FDIV_CONF_0, address 0xFFFF B028 (CGU1))
0x00h*LP_OSC (CGU0) or (BASE_ICLK0_CLK)
(CGU1)
0x01hCrystal oscillator (CGU0) or
(BASE_ICLK1_CLK) (CGU1)
0x02hPLL
0x03hPLL +120
0x04hPLL +240
0x05 to
0xFF
0x1*
0x1*
Invalid
0
0
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
5.9 Output-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
Section 3–5.11
T able 24.SAFE_CLK_STA TUS (address 0xFFFF 8064), PCR_CLK_ST A TUS (address 0xFFFF
* = reset value
BitSymbolAccess Value Description
31 to 5reservedR-Reserved
4 to 2IDIVR000*In teger divide value
1 to 0reservedR-Reserved.
.
0074) register bit description
5.10 Output-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 generators for
BASE_SAFE_CLK and BASE_PCR_CLK, which are described here. For the other
outputs see Section 3–5.12
23 to 5reservedR-Reserved; do not modify, read as logic 0, write
4 to 2IDIVR/W000*Integer divide va lue
1 to 0reservedR-Reserved; do not modify. Read as logic 0, write
5.1 1 Output-clock status register for CGU0 clocks
Chapter 3: LPC29xx Clock Generation Unit (CGU)
8078) register bit description
0x0*LP_OSC
0x01 to
0xFF
DRAFT
Invalid: the hardware will not accept these
values when written
as logic 0
as logic 0
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
UM10316
F
T DRAFT DRAFT DRAFT DRA
DR
DRAFT
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
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–5.9
31 to 5reservedR-Reserved
4 to 2IDIVR000*In teger divide value
1RTXR0*Clock-disable polarity
0PDR0*Power-down clock slice
.
5.12 Output-clock configuration register for CGU0 clocks
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–5.10
XX = SYS, IVNSS, MSCSS, UART, SPI, TMR or ADC, ICLK0/1_CLK
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.
5.14 Output-clock configuration register for CGU1 clocks
There is one configuration register for each CGU1 output clock generated. All output
generators have the same register bits. The CG U1 output clo ck can be generated directly
from the two CGU0 base clocks BASE_ICLK0_CLK and BASE_ICLK1_CLK or from the
CGU1 PLL.
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.
T able 30. BUS_DISABLE register bit description (BUS_DISABLE, address 0xFFFF 8FF4
* = reset value
BitSymbolAccess Value Description
31 to 1reservedR-Reserved; do not modify. Read as logic 0, write
0RRBUSR/WBus write-disable bit
5.16 CGU0 interrupt bit description
Table 3–31 gives the interrupts for the CGU0. The first column gives the bit number in the
interrupt registers. For a general explanation of the interrupt concept and a description of
the registers see Section 10–5
Table 31.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
Reset outputReset sourceParts of the device reset when activated
QEI_RSTWARM_RSTQuadrature encoder
DMA_RSTWARM_RSTGPDMA controller
USB_RSTWARM_RSTUSB controller
VIC_RSTWARM_RSTVectored Interrupt Controller (VIC)
AHB_RSTWARM_RSTCPU and AHB Bus infrastructure
Generation of reset outputs is controlled using registers RESET_CTRL0 and
RESET_CTRL1. 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 is monitored by the RESET_STATUS0 to 3 registers and indicates one of
the following reset causes (see Table 4–37
DRAFT
Chapter 4: LPC29xx Reset Generation Unit (RGU)
…continued
to Table 4–40):
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT DRA
D
RAFT
UM10316
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
• No reset has taken place
• Watchdog reset
• Reset generated by software via RGU register
• Other cause
The second level of granularity is monitored by one individual register for each reset
output in which the detailed reset cause is indicated (see Table 4–43
Detailed reset causes depend on the reset hierarchy:
to Table 4–47).
• POR reset (does not have a reset source register as it can only be activated by POR)
• RGU reset
• Watchdog reset
• PCR (Power control, Clock, and Reset Subsystem) reset
• Cold reset
• Warm reset
3.1 Reset hierarchy
The different types of system reset can be ordered according to their sco pe. The hierarchy
is as follows (see Table 4–33
1. POR reset: resets everything in the microcontroller.
2. External reset: resets everything in the microcontroller except the OSC 1M oscillator.
3. RGU reset: resets RGU and then has the same effect as Watchdog reset.
4. Watchdog-triggered reset: triggers PCR reset.
5. PCR reset: triggers cold reset and resets Watchdog and flash controller.
6. Cold reset: triggers warm reset and resets GPIO, external memory controller, flash
controller, SRAM controller, the SCU, and the CFID.
7. Warm reset: Resets non-memory peripherals (UART, ADC, I2C, timers, etc.). Does
not reset memory controllers, SCU, CFID or Watchdog.
RESET_CTRL0W0x100Reset control register 0-see Table 4–35
RESET_CTRL1W0x104Reset control register 1-see Table 4–36
RESET_STATUS0R/W0x110Reset status register 00x140see Table 4–37
RESET_STATUS1R/W0x114Reset status register 10x0see Table 4–38
RESET_STATUS2R/W0x118Reset status register 20x5555 5555 see Table 4–39
RESET_STATUS3R/W0x11CReset status register 30x5555 5555 see Table 4–40
RST_ACTIVE_STATUS0R0x150Reset-Active Status register 00xFFFF
RST_ACTIVE_STATUS1R0x154Reset-Active Status register 10xFFFF
RGU_RST_SRCR/W0x404Source register for RGU reset0x0000 0000 see Table 4–43
PCR_RST_SRCR/W0x408Source register for PCR reset0x0000 0000 see Table 4–44
COLD_RST_SRCR/W0x40CSource register for COLD reset0x0000 0010 see Table 4–45
WARM_RST_SRCR/W0x410Source register for WARM reset0x0000 0020 see Table 4–46
SCU_RST_SRCR/W0x480Source register for SCU reset0x0000 0020 see Table 4–46
CFID_RST_SRCR/W0x484Source register for CFID reset0x0000 0020 see Table 4–46
FMC_RST_SRCR/W0x490Source register for EFC reset0x0000 0020 see Table 4–46
EMC_RST_SRCR/W0x494Source register for EMC reset0x0000 0020 see Table 4–46
SMC_RST_SRCR/W0x498Source register for SMC reset0x0000 0020 see Table 4–46
GESS_A2V_RST_SRCR/W0x4A0Source register for GeSS AHB2APB
PESS_A2V_RST_SRCR/W0x4A4Source register for PeSS AHB2APB
GPIO_RST_SRCR/W0x4A8Source register for GPIO reset0x0000 0040 see Table 4–47
UART_RST_SRCR/W0x4ACSource register for UART reset0x0000 0040 see Table 4–47
TMR_RST_SRCR/W0x4B0Source register for Timer reset0x0000 0040 see Table 4–47
SPI_RST_SRCR/W0x4B4Source register for SPI reset0x0000 0040 see Table 4–47
IVNSS_A2V_RST_SRCR/W0x4B8Source register for IVNSS AHB2APB
IVNSS_CAN_RST_SRCR/W0x4BCSource register for IVNSS CAN reset0x0000 0040 see Table 4–47
IVNSS_LIN_RST_SRCR/W0x4C0Source register for IVNSS LIN reset0x0000 0040 see Table 4–47
MSCSS_A2V_RST_SRCR/W0x4C4Source register for MSCSS AHB2APB
MSCSS_PWM_RST_SRCR/W0x4C8Source register for MSCSS PWM reset 0x0000 0040 see Table 4–47
MSCSS_ADC_RST_SRCR/W0x4CCSource register for MSCSS ADC reset 0x0000 0040 see Table 4–47
MSCSS_TMR_RST_SRCR/W0x4D0Source register for MSCSS Timer reset 0x0000 0040 see Table 4–47
I2C_RST_SRCR/W0x4D4Source register for I2C reset0x0000 0040 see Table 4–47
QEI_RST_SRCR/W0x4D8Source register for QEI reset0x0000 0040 see Table 4–47
DMA_RST_SRCR/W0x4DCSource register for DMA reset0x0000 0040 see Table 4–47
USB_RST_SRCR/W0x4E0Source register for USB reset0x0000 0040 see Table 4–47
VIC_RST_SRCR/W0x4F0Source register for VIC reset0x0000 0040 see Table 4–47
AHB_RST_SRCR/W0x4F4Source register for AHB reset0x0000 0040 see Table 4–47
BUS_DISABLER/W0xFF4Bus-disable register0x0000 0000 see Table 4–48
reservedR0xFF8Reserved0x0000 0000
reservedR0xFFCReserved0xA098 1000
DescriptionReset value Reference
bridge reset
bridge reset
…continued
0x0000 0040 see Table 4–47
0x0000 0040 see Table 4–47
DRAFT
DRA
F
DR
AFT
DR
T DRAF
4.1 RGU reset control register
The RGU reset control register allows software to activate and release individual reset
outputs. Each bit corresponds to an individual rese t outp ut, and wr itin g a ‘1 ’ activates that
output. The reset output is automatically de-activated after a fixed delay period.
Table 35.RESET_CONTROL0 register bit description(RESET_CONTROL0, address
0xFFFF 9100)
* = 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
Table 36.RESET_CONTROL1 register bit description (RESET_CONTROL1, 0xFFFF 9104)
* = reset value
BitSymbolAccess Value Description
31 and 30reservedR-Reserved; do not modify, write as
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 4–4.4
Table 40.RESET_STATUS3 register bit description (RESET_STATUS3, address
* = reset value
BitSymbolAccess Value Description
1 and 0IVNSS_LIN_RST_STATR/WReset IVNSS LIN status
4.3 RGU 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 41. RST_ACTIVE_STA TUS0 register bit description (RST_ACTIVE_ST ATUS0, address
* = 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
0xFFFF 911C)
0xFFFF 9150)
…continued
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 4: LPC29xx Reset Generation Unit (RGU)
F
T DRAFT DRAFT DRAFT DRA
00No reset activated since RGU last
came out of reset
01*Input reset to the RGU
10Reserved
11Reset control register
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
T able 42. RST_ACTIVE_STA TUS1 register bit description (RST_ACTIVE_ST ATUS1, address
0xFFFF 9154)
* = reset value
BitSymbolAccess Value Description
31 and 30reservedR-Reserved; do not modify
29AHB_RST_STATR1*Current state of AHB_RST
28VIC_RST_STATR1*Current state of VIC_RST
27 to 25reserved R-Reserved; do not modify
24USB_RST_STATW-Current state of DMA_RST
23DMA_RST_STATW-Current state of DMA_RST
22MSCSS_QEI_RST_STATW-Current state of MSCSS_QEI_RST
21IVNSS_I2C_RST_STATW-Current state of IVNSS_I2C_RST
20MSCSS_TMR_RST_STATR1*Current state of MSCSS_TMR_RST
19MSCSS_ADC_RST_STATR1*Current state of MSCSS_ADC_RST
18MSCSS_PWM_RST_STAT R1*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
T able 42. RST_ACTIVE_STA TUS1 register bit description (RST_ACTIVE_ST ATUS1, address
* = reset value
BitSymbolAccess Value Description
13SPI_RST_STATR1*Current state of SPI_RST
12TMR_RST_STATR1*Current state of TMR_RST
11U A RT_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
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
0xFFFF 9154)
…continued
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 4: LPC29xx Reset Generation Unit (RGU)
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
4.4 RGU reset source registers
The reset source register indicates for each RGU reset output which specific reset input
caused it to go active.
POR reset
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.
RGU reset
The following reset source register description is applicable to the RGU reset output of the
RGU, which is activated by the RST_N input pin or the POR reset, see Table 10–90
able to detect the source of the next PCR reset the register should be cleared by writing a
1 after read.
Table 43.RGU_RST_SRC register bit description (RGU_RST_SRC, address 0xFFFF 9404)
* = 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
PCR reset
. To be
The following reset source register description is applicable to the PCR reset output of the
RGU, which is activated by the Watchdog T imer or the RGU rese t, see Table 10–90
. To be
able to detect the source of the next PCR reset the register should be cleared by writing a
1 after read.
Table 44.PCR_RST_SRC register bit description (PCR_RST_SRC, address 0xF FFF 9408)
* = reset value
BitSymbolAccess Value Description
31 to 4reservedR-Reserved; do not modify. Read as logic 0
3WDT_TMRR/W0*Reset activated by Watchdog timer
2RGUR/W0*Reset activated by RGU reset
1 to 0reservedR-Reserved; do not modify. Read as logic 0
Cold reset
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 10–90
source of the next COLD reset the register should be cleared by writing a 0 after read.
T able 45. COLD_RST_SRC register bit descr iption (COLD_RST_SRC, address
* = 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
0xFFFF 940C)
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 4: LPC29xx Reset Generation Unit (RGU)
F
T DRAFT DRAFT DRAFT DRA
(WDT)
DR
AFT
DRAFT
DRA
. To be able to detect the
DR
AFT
DRAFT
DR
F
T DRAF
Peripherals activated by cold reset
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 10–90
. To be able to detect the next
reset the register should be cleared by writing a 0 after re ad.
Table 46.XX_RST_SRC register bit description (WARM_RST_SRC to SMC_RST_SRC,
addresses 0xFFFF 9410 to 0xFFFF 9498)
* = 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
Peripherals activated by warm reset
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 10–90
. To be able to detect the
next reset the register should be cleared by writing a 0 after read.
Table 47.YY_RST_SRC register bit description (GESS_A2V_RST_SRC to AHB_RST_SRC,
address 0xFFFF 94A0 to 0xFFFF 9FF4)
* = 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
The implementation of some branch clocks for power control depends on the peripheral
and memory configuration of each LPC29xx part, see Table 5–49
are available in all LPC29xx parts.
Table 49. Branch clocks implemented in LPC29xx (x = CLK_CFG_ or CLK_STAT_)
[1] The flash clock is connected to the boot ROM for the flashless LPC2930. The clock can be switched off to conserve power after the boot
process has completed.
2.Introduction
The PMU is part of the Power Control and Reset Subsystem (PCRSS) together with the
CGU0/1 (see Section 3–2
) and RGU (see Section 4–2).
3.PMU functional description
Table 50.Branch clock overview
Legend:
‘1’ Indicates that the related register bit is tied off to logic HIGH, all writes are ignored
‘0’ Indicates that the related register bit is tied off to logic LOW, all writes are ignored
‘+’ Indicates that the related register bit is readable and writable
Base clockBranch clock name/clock leafsImplemented switch on/off
Legend:
‘1’ Indicates that the related register bit is tied off to logic HIGH, all writes are ignored
‘0’ Indicates that the related register bit is tied off to logic LOW, all writes are ignored
‘+’ Indicates that the related register bit is readable and writable
Base clockBranch clock name/clock leafsImplemented switch on/off
Legend:
‘1’ Indicates that the related register bit is tied off to logic HIGH, all writes are ignored
‘0’ Indicates that the related register bit is tied off to logic LOW, all writes are ignored
‘+’ Indicates that the related register bit is readable and writable
Base clockBranch clock name/clock leafsImplemented switch on/off
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.
Since application of configuration settings may not be inst antaneous, the current setting
can be read in register CLK_STAT_<leaf>. The registers CLK_STAT_<leaf> 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.2 PMU 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.
CLK_STAT_USBR0x29C0x0000 0001 USB register interface status registersee Table 5–55
CLK_CFG_PCR_IPR/W0x3000x0000 0001 IP clock to PCR module configuration-
CLK_STAT_PCR_IPR0x3040x0000 0001 IP clock to PCR module-status
CLK_CFG_IVNSS_APBR/W0x4000x0000 0001 APB clock to IVNSS module-
CLK_STAT_IVNSS_APBR0x4040x0000 0001 APB clock to IVNSS module status-
CLK_CFG_CANCAR/W0x4080x0000 0001 IP clock to CAN gateway acceptance-
CLK_STAT_CANCAR0x40C0x0000 0001 IP clock to CAN gateway acceptance-
CLK_CFG_CANC0R/W0x4100x0000 0001 IP clock to CAN gateway 0
CLK_STAT_CANC0R0x4140x0000 0001 IP clock to CAN gateway 0 status
CLK_CFG_CANC1R/W0x4180x0000 0001 IP clock to CAN gateway 1
CLK_STAT_CANC1R0x41C0x0000 0001 IP clock to CAN gateway 1 status
CLK_CFG_I2C0R/W0x4200x0000 0001 IP clock to I2C0 configuration regi ster see Table 5–54
CLK_STAT_I2C0R0x4240x0000 0001 IP clock to I2C0 status registersee Table 5–55
CLK_CFG_I2C1R/W0x4280x0000 0001 IP clock to I2C1 configuration regi ster see Table 5–54
CLK_STAT_I2C1R0x42C0x0000 0001 IP clock to I2C1 status registersee Table 5–55
--0x430 0x43C
CLK_CFG_LIN0R/W0x4400x0000 0001 IP clock to LIN controller 0
CLK_STAT_LIN0R0x4440x0000 0001 IP clock to LIN controller 0 status
CLK_CFG_LIN1R/W0x4480x0000 0001 IP clock to LIN controller 1
CLK_STAT_LIN1R0x44C0x0000 0001 IP clock to LIN controller 1 status
--0x450
-0x4FC
CLK_CFG_MSCSS_APBR/W0x5000x0000 0001 APB clock to MSCSS module-
CLK_STAT_MSCSS_APBR0x5040x0000 0001 APB clock to MSCSS module-status
CLK_CFG_MTMR0R/W0x5080x0000 0001 IP clock to timer 0 in MSCSS
CLK_STAT_MTMR0R0x50C0x0000 0001 IP clock to timer 0 in MSCSS status
CLK_CFG_MTMR1R/W0x5100x0000 0001 IP clock to timer 1 in MSCSS
CLK_STAT_MTMR1R0x5140x0000 0001 IP clock to timer 1 in MSCSS status
CLK_CFG_PWM0R/W0x5180x0000 0001 IP clock to PWM 0 in MSCSS
CLK_STAT_PWM0R0x51C0x0000 0001 IP clock to PWM 0 in MSCSS status
CLK_CFG_PWM1R/W0x5200x0000 0001 IP clock to PWM 1 in MSCSS
CLK_STAT_PWM1R0x5240x0000 0001 IP clock to PWM 1 in MSCSS status
CLK_CFG_PWM2R/W0x5280x0000 0001 IP clock to PWM 2 in MSCSS
CLK_STAT_PWM2R0x52C0x0000 0001 IP clock to PWM 2 in MSCSS status
CLK_CFG_PWM3R/W0x5300x0000 0001 IP clock to PWM 3 in MSCSS
CLK_STAT_PWM3R0x5340x0000 0001 IP clock to PWM 3 in MSCSS status
CLK_CFG_ADC0_APBR/W0x5380x0000 0001 APB clock to ADC 0 in MSCSS
CLK_STAT_ADC0_APBR0x53C0x0000 0001 APB clock to ADC 0 in MSCSS status
CLK_CFG_ADC1_APBR/W0x5400x0000 0001 APB clock to ADC 1 in MSCSS
CLK_STAT_ADC1_APBR0x5440x0000 0001 APB clock to ADC 1 in MSCSS status
CLK_CFG_ADC2_APBR/W0x5480x0000 0001 APB clock to ADC 2 in MSCSS
CLK_STAT_ADC2_APBR0x54C0x0000 0001 APB clock to ADC 2 in MSCSS status
CLK_CFG_QEI_APBR/W0x5500x0000 0001 APB clock to QEI in MSCSS
CLK_STAT_QEI_APBR0x5540x0000 0001 APB clock to QEI in MSCSS status
reservedR/W0x558 -
0x5FF
CLK_CFG_OUT_CLKR0x6000x0000 0001 clock out configuration registersee Table 5–54
CLK_STAT_OUT_CLKR/W0x6040x0000 0001 clock out status registersee Table5–55
CLK_CFG_UART0R/W0x7000x0000 0001 IP clock to UART-0 configuration
CLK_STAT_UART0R0x7040x0000 0001 IP clock to UART-0 status registersee Table 5–55
CLK_CFG_UART1R/W0x7080x0000 0001 IP clock to UART 1 configuration
CLK_STAT_UART1R0x70C0x0000 0001 IP clock to UART 1 status registersee Table 5–55
CLK_CFG_SPI0R/W0x8000x0000 0001 IP clock to SPI 0 configuration register see Table 5–54
CLK_STAT_SPI0R0x8040x0000 0001 IP clock to SPI 0 status registersee Table 5–55
CLK_CFG_SPI1R/W0x8080x0000 0001 IP clock to SPI 1 configuration register see Table 5–54
CLK_STAT_SPI1R0x80C0x0000 0001 IP clock to SPI 1 status registersee Table 5–55
CLK_CFG_SPI2R/W0x8100x0000 0001 IP clock to SPI 2 configuration register see Table 5–54
CLK_STAT_SPI2R0x8140x0000 0001 IP clock to SPI 2 status registersee Table 5–55
CLK_CFG_TMR0R/W0x9000x0000 0001 IP clock to Timer 0 configuration
CLK_STAT_TMR0R0x9040x0000 0001 IP clock to Timer 0 status registersee Table 5–55
CLK_CFG_TMR1R/W0x9080x0000 0001 IP clock to Timer 1 configuration
CLK_STAT_TMR1R0x90C0x0000 0001 IP clock to Timer 1 status registersee Table5–55
CLK_CFG_TMR2R/W0x9100x0000 0001 IP clock to Timer 2 configuration
CLK_STAT_TMR2R0x9140x0000 0001 IP clock to Timer 2 status registersee Table 5–55
CLK_CFG_TMR3R/W0x9180x0000 0001 IP clock to Timer 3 configuration
CLK_STAT_TMR3R0x91C0x0000 0001 IP clock to Timer 3 status registersee Table5–55
CLK_CFG_ADC0R/W0xA000x0000 0001 IP clock to ADC 0 status registersee Table5–54
CLK_STAT_ADC0R0xA040x0000 0001 IP clock to ADC 0 status registersee Table 5–55
CLK_CFG_ADC1R/W0xA080x0000 0001 IP clock to ADC 1 status registersee Table5–54
CLK_STAT_ADC1R0xA0C0x0000 0001 IP clock to ADC 1 status registersee Table5–55
CLK_CFG_ADC2R/W0xA100x0000 0001 IP clock to ADC 2 configuration
CLK_STAT_ADC2R0xA140x0000 0001 IP clock to ADC 2 status registersee Table 5–55
CLK_CFG_TSSHELLR/W0xB000x0000 0001 IP clock to test clock configuration
CLK_STAT_TSSHELLR0xB040x0000 0001 IP clock to test clock status registersee Table 5–55
CLK_CFG_USB_I2CR/W0xC000x0000 0001 IP clock to USB I2C configuration
CLK_STAT_USB_I2CR0xC040x0000 0001 IP clock to USB I2C status registersee Table 5–55
CLK_CFG_USB_CLKR/W0xD000x0000 0001 IP clock to USB CLK configuration
Reset valueDescriptionReference
see Table 5–54
register
see Table 5–54
register
see Table 5–54
register
see Table 5–54
register
see Table 5–54
register
see Table 5–54
register
see Table 5–54
register
see Table 5–54
register.
Remark: This is an internal clock
used for testing only. It is running at
start-up and should be disabled using
this register.
CLK_STAT_USB_CLKR0xD040x0000 0001 IP clock to USB CLK status registersee Table 5–55
reserved-0xFF80x0000 0000 Reserved
reserved-0xFFC0xA0B6 0000 Reserved
Reset valueDescriptionReference
4.1 Power 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.
Table 52.PM register bit description (PM, address 0xFFFF A000)
* = reset value
BitSymbolAccess Value Description
31 to 1reservedR-Reserved; do not modify. Read as logic 0
0PDR/WInitiate power-down mode:
1Clocks with wake-up mode enabled
(WAKEUP=1) are disabled
0*Normal operation
DRAFT
DRA
F
DR
AFT
DR
T DRAF
4.2 Base-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 53.BASE_STAT register bit description (BASE_STAT, address 0xF FFF A004)
* = reset value
BitSymbolAccess Value Description
31 to 13 reservedR-Reserved; do not modify. Read as logic 0
12BASE12_STAR1*Indicator for BASE_USB_CLK
11BASE11_STATR1*Indicator for BASE_USB_I2C_CLK
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
5BASE5_STATR1*Indicator for BASE_OUT_CLK
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
4.3 PMU clock configuration register for output branches
Each generated output clock from the PMU has a configuration register.
T able 54.CLK_CFG_XXX register bit description (CLK_CFG_SAFE to CLK_CFG_USB_CLK,
* = reset value
BitSymbolAccess Value Description
31 to 3reservedR-Reserved; do not modify. Read as logic 0
2WAKEUP
1AUTO
0RUN
Chapter 5: LPC29xx Power Management Uni t (PM U)
addresses 0xFFFF A100 to 0xFFFF AD00)
[1]
[1]
[2]
R/W1The branch clock is ’wake-up enabled’. When
the PD bit in the Power Mode register (see
Section 5–4.1) is set, and clocks which are
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
DRAFT
D
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
F
T DRAFT DRAFT DRAFT DRA
DR
DRAFT
[1] Tied off to logic LOW for some branch clocks. All writes are ignored for those with tied bits.
[2] Tied off to logic HIGH for some branch clocks. All writes are ignored for those with tied bits.
4.4 Status register for output branch clock
Like the configuration register, each generated output clock from the PMU has a status
register. When the configuration 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.
The contents of this chapter apply to all LPC29xx parts. See Table 6–56 for available
GPIO pins for the port selection registers and for registers that are part specific.
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. 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 desired
functions are chosen by selecting a function for each I/O pin.
In addition, memory mapping features and AHB priority settings are controlled by the
SCU.
3.Register overview
The System Control Unit registers are shown in Table 6–57.
T able 57. Register overview: SCU (base address: 0xE000 1000)
The port function select register configures the pin functions individually on the
corresponding I/O port. For an overview of pinning, see Section 11–2
its individual register. Each port has its SFSPn_BASE register as defined above in
Table 6–57
Table 6–58
. n runs from 0 to 4, m runs from 0 to 31. For port 5, m runs from 0 to 15.
shows the address locations of the SFSPn_m registers within a port memory
Table 6–59 shows the bit assignment of the SFSPn_m registers (n runs from 0 to 4, m
runs from 0 to 31. For port 5, m runs from 0 to 15).
Remark: Note that on Reset the ADC pins P0[23] to P0[8] are set to digital inputs without
internal pull-up/down on reset. This guarantees that th ese pins are 5 V tolerant after reset,
even though the analog inputs to ADC1 and ADC2 ar e not. The default p ad type is analog
input for all other port pins (except P5[19:16]).
31 to 5reservedR-Reserved. Read as logic 0
4 to 2PAD_TYPE
[1]
R/WInput pad type
[2]
000*
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
output depending on the function selected. For GPIO mode the direction is controlled by the direction
register, see Table 16–200
addition to the FUNC_SEL bits.
that the ADC pins are 5 V tolerant after reset even though the analog pad of ADC1 and ADC2 is not 5 V
tolerant.
input to avoid the input buffer oscillating on slow analog-signal transitions or noise. The digital input buffer is
switched off.
…continued
mapping tables
00*Select pin function 0
01Select pin function 1
10Select pin function 2
11Select pin function 3
. Note that for functions of type input, the input pad type must be set correctly in
[5]
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Setting the FUNC_SEL bits in the SFSP5_16 register also determines the function of port
5[17]. If the USB_D−2 function is selected for P5[16], P5[17] is automatically assigned to
the USB_D+2 function. If P5[16] is GPIO, P5[17] is assigned to GPIO as well.
Table 60.SFSP5_16 function select register bit description (SFSP5_16, address
0xE000 1540)
* = reset value
BitSymbolAccessValueDescription
31 to 2reservedR-Reserved. Read as
logic 0
1 to 0FUNC_SEL[1 :0 ]R/WFunction-select; for the
function-to-port-pin
mapping tables
00*Select pin function GPIO
on P5[16]
01Select pin USB_D−2
10reserved
11reserved
Setting the FUNC_SEL bits in the SFSP5_18 register also determines the function of port
5[19]. If the USB_D−1 function is selected for P5[18], P5[19] is automatically assigned to
the USB_D+1 function. If P5[18] is selected GPIO, P5[19] is assigned to GPIO as well.
Table 61.SFSP5_18 function select register bit description (SFSP_5_18, address
* = reset value
BitSymbolAccessValueDescription
31:5---reserved
4VBUSR/WUSB mode
3 to 2---reserved
1 to 0FUNC_SEL[1:0]R/WFunction-select; for the
0xE000 1548)
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 6: LPC29xx System Control Unit (SCU)
F
T DRAFT DRAFT DRAFT DRA
0port 1 in host or device
mode
1port 1 in OTG mode
function-to-port-pin mapping
tables
00*Select pin function GPIO on
P5[18]
01Select pin USB_D−1
10reserved
11reserved
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.1.1 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 6–15
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.
Remark: Even though the default function is GPIO, the pad type has to be set to digit al in
the SFSPn_m registers in order to use the GPIO functionality (see Table 6–59
1Disables JTAG security and clears bit 1 on SEC_STA
0enables JTAG security
0---reserved
Table 63.Security status register bit description (SEC_STA, address 0xE000 1B04)
BitSymbol Access ValueDescription
31:2---reserved
1DISRJTAG security status
1JTAG security enabled
0JTAG security disabled
0---reserved
3.3 Shadow memory mapping registers
The shadow memory mapping register defines wh ich part of the memory region is present
in the shadow memory area. The shadow memory mapping start address is the pointer
within a region indicating the shadowing to the shadow area starting at location 0000
0000h. In this way a whole region or only a part of the flash, SRAM or extern a l mem o ry
bank can be remapped to the shadow area.
The SSMM0 register defines the memory mapping seen by the ARM CPU master, the
SSMM1 and SSMM2 register defines the memory mapping for the DMA0 and DMA1
masters, and the SSMM3 register for the USB master.
Table 64.SSMMx register bit description (SSMM0/1/2/3, addresses: 0xE000 1C00, 0xE000
* = reset value
BitSymbolAccess ValueDescription
31 to 10 SMMSA[21:0]R/W0x2000 0000* shadow memory map start address;
9 to 0reserved--reserved; do not modify, read as logic 0,
Chapter 6: LPC29xx System Control Unit (SCU)
1C04, 0xE000 1C08, 0xE000 1C0C)
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
memory start address for mapping (a part
of) a region to the shadow area; the start
address is aligned on 1 kB boundaries and
therefore the lowest 10 bits must be always
logic 0
write
as logic 0
DR
AFT
DRAFT
DR
F
T DRAF
3.4 AHB master priority registers
By default, AHB access is scheduled round-robin. However, the AHB access priority of
each of the AHB bus masters can be set by writing the priority integer value (highest
priority = 1, lowest priority = 4) to the master’s priority register SMPn.
All masters with the same priority are scheduled on a round-robin basis.
T able 65. SMPx register bit description (SMP0/1/2/3, addresses: 0xE00 0 1D00 (ARM),
The CFID module contains registers that show the functionality of the chip. It contains an
ID to identify the silicon and four registers containing information about the features
enabled or disabled for each part in the LPC29xx series.
[1] Factory setting. The reset value of the FEAT3 register depends on the setting of the JTAG security bit (see
Table 7–68
).
[1]
Registers CHIPID and FEAT0 to FEAT2 are factory preprogrammed and read-only. The
FEAT3 register contains the value of the JTAG security bit (see Table 7–68
). The JTAG
security bit can be defined by the user by writing to the index sector (see
Section 28–2.6.3
). The factory default setting allows JTAG access.
shows the event router connections for each LPC29xx part.
USB CAN/LIN (n = 0,1) I2C
(n = 0,1)
SPI
(m = 0,1,
2)
UART
(n = 0,1)
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
2.Event 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 described in Table 8–70
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 8–16
.
.
Fig 16. Schematic representation of the Event Router
Input events are processed in event slices; one for each even t 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 registe r 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 sett ing (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
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 8: LPC29xx event router
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
2.1 Event router pin connections
The event router module in the LPC29xx is connected to the pins listed below. The pins
are combined with other functions on the port pins of the LPC29xx. Table 8–70
pins connected to the event router, and also the corresponding bit position in the
event-router registers and the default polarity. Not all pin connections are available on all
parts. See Table 8–69
-13-12reservedLIN0 RXDLIN14LIN0 receive data input wake-up0
LIN1 RXDLIN15LIN1 receive data input wake-up0
SPI0 SDIIN16SPI0 data in0
SPI1 SDIIN17SPI1 data in0
SPI2 SDIIN18SPI2 data in0
UART0 RXDIN19UART0 receive data input0
for available pin connections depending on part number.
PENDR0xC00Event status register0x0000 0000 see Table 8–72
INT_CLRW0xC20Event-status clear register-see Table 8–73
INT_SETW0xC40Event-status set register-see Table 8–74
MASKR0xC60Event-enable register0x07FF FFFF see Table 8–75
MASK_CLRW0xC80Event-enable clear register -see Table 8–76
MASK_SETW0xCA0Event-enable set register-see Table 8–77
APRR/W0xCC0Activation polarity register0x01C0 00FF see Table 8–78
ATRR/W0xCE0Activation type register0x07FF FFFF see Table 8–79
reservedR0xD00Reserved; do not modify-RSRR/W0xD20Raw-status register0x0000 0000 see Table 8–80
offset
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
DRAFT
Chapter 8: LPC29xx event router
F
T DRAFT DRAFT DRAFT DRA
…continued
polarity
2
C serial clock0
DescriptionReset valueReference
DR
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
3.1 Event status register
The event status register determines when the Event Router forwar ds an interrupt request
to the Vectored Interrupt Controller, if the corresponding event enable has been set.
Table 8–72
Table 72. PEND register bit description (address 0xE000 2C00)
* = 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,
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
NXP Semiconductors
Table 72. PEND register bit description (address 0xE000 2C00)
* = reset value
BitSymbolAccess ValueDescription
:::::
0PEND[0]R1An event has occurred on a corresponding pin
3.2 Event-status clear register
The event-status clear register clears the bits in the event status register.
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 8: LPC29xx event router
F
T DRAFT DRAFT DRAFT DRA
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
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Table 8–73
Table 73.INT_CLR register bit description (address 0xE000 2C20)
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.
0Bit 26 in the event status register is unchanged
0Bit 0 in the event status register is unchanged
3.3 Event-status set register
The event-status set register sets the bits in the event status register.
Table 8–74
T able 74. INT_SET register bit description (address 0xE000 2C40)
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
3.4 Event 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.
The APR is used to configure which level is the active state for the event source.
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
Chapter 8: LPC29xx event router
F
T DRAFT DRAFT DRAFT DRA
DR
AFT
DRAFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
Table 8–78
Table 78.APR register bit description (address 0xE000 2CC0)
BitSymbolAccess ValueDescription
31 to 27 reservedR-Reserved; do not modify. Read as logic 0
26APR[26]R/W1
:::::
0APR[0]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.
[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)
3.8 Activation 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 sour ce 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.
Table 8–79
Table 79.ATR register bit description (address 0xE000 2CE0)
* = 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.
(edge-sensitive)
0Corresponding event is directly forwarded
(level- sensitive)
(edge-sensitive)
0Corresponding event is directly forwarded
(level-sensitive)
3.9 Raw 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.
The contents of this chapter apply to all LPC29xx parts. See Table 9–81 for interrupt
requests that are configuration dependent. All other interrupt reque sts are available in all
LPC29xx part s (see Table 9–88
Table 81.Available interrupt requests
PartUSB interrupts ADC interruptsFlash interrupts
LPC2921/23/2546 to 48, 50 17, 18 (ADC1/2)11
LPC2917/19/0145 to 5117, 18 (ADC1/2)11
LPC2927/2945 to 5116, 17, 18 (ADC0/1/2)11
LPC293045 to 5116, 17, 18 (ADC0/1/2)n/a
LPC293945 to 5116, 17, 18 (ADC0/1/2)11
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
D
RAFT
RAFT DRA
F
T DRAFT DRAFT DRAFT DRA
DR
DRAFT
).
2.VIC functional description
The VIC is a very flexible and powerful block for interrupting the ARM processor on
request. The VIC routes incoming interrupt requests from multiple source to the ARM
processor core. Figure 9–17
for each interrupt request input of the controller, and the various device peripherals are
connected to the interrupt request inputs. An extensive list of inputs can be found in
Table 9–88
.
shows the VIC connections. An interrupt ta rg et is con fi gur ed
Fig 17. Schematic representation of the VIC connections
The ARM core has two possible interrupt targets: IRQ and FIQ.
• The FIQ is designed to support a data transfer or channel process, and has sufficient
private registers to remove the need for register-saving in service routines. This
minimizes the overhead of context switching. FIQ should not enable interrupt during
execution: if needed an IRQ should be used for this purpose.
NXP Semiconductors
Active
High/Low
Priority Mask
FIQ
Priority
Target
IRQ/FIQ
Pending 1
FIQ
IRQ
VECTOR FIQ
VECTOR IRQ
Active
High/Lo w
Enable
Priority
Target
IRQ/FIQ
Pending N
Interrupt Request N
Interrupt Request 1
INT 1
INT N
Interrupt Selection
Priority Mask
IRQ
Enable
• The IRQ exception has a lower priority than FIQ and is ma ske d ou t wh en an FI Q
The VIC also provides IRQ and FIQ wake-up events to the Event Router. This enables the
system to wake up upon an interrupt. See also Section 10–5
structure.
If the level-sensitive interrupt request line of the VIC is enabled (depending on the polarity
setting), the request is forwarded to the interrupt selection. The interrupt selection part
selects the interrupt request line with the highest priority, based on the target and priority
of the interrupt request and priority masks.
The VIC introduces an interrupt latency (measured from asser tion of an INT_N signal to
an assertion of IRQ/FIQ) of less than two periods of the system clock.
The INT_VECTOR register can be used to identify th e interru pt request line that needs to
be served. It can be used as an interrupt vector to the interrupt service routine. In
T ABLE_ADDR the of fset of the vector t able can be programmed. T ogether with the INDEX
this information forms a vector.
The IRQ or FIQ generates a corresponding exception on the ARM core. The exception
handler should read the INT_VECTOR register to determine the highest-priority interrupt
source. This functionality should be implemented in a dispatcher, usually in the assembler.
This dispatcher performs the following steps:
1. Put all registers that are used (according to the ARM-Procedure-Call Standard) on
stack.
2. Determine the interrupt source by reading The INT_VECTOR register
3. Call the interrupt service routine
4. Get all (saved) registers back from the stack
5. End the interrupt service routine by restoring the Program Counter register (PC).
2.2 Nested interrupt service routine
1. Put all registers that are used (according to the ARM-Procedure-Call Standard) on
stack.
2. Determine the interrupt source by reading The INT_VECTOR register
3. Raise the priority-masking threshold to the priority level of the interrupt request to be
served
4. Re-enable interrupt in the processor
5. Call the interrupt service routine
6. Restore the saved priority mask
7. Get all (saved) registers back from the stack
8. End the interrupt se rvic e ro utine by restoring the program counter.
3.VIC programming example
The VIC driver provides an API to set up an interrupt source with all its parameters. All this
information ends up in the INT_REQUEST register of the VIC.
In most cases interrupt handling is controlled by some kind of OS. Installation of interrupt
vector tables depends on this.
NameAccess Address DescriptionReset value Reference
INT_REQUEST_39R/W0x49CInterrupt Request 39 control register-see
Table 9–89
INT_REQUEST_40R/W0x4A0Interrupt Request 40 control register-see
Table 9–89
INT_REQUEST_41R/W0x4A4Interrupt Request 41 control register-see
Table 9–89
INT_REQUEST_42R/W0x4A8Interrupt Request 42 control register-see
Table 9–89
INT_REQUEST_43R/W0x4ACInterrupt Request 43 control register-see
Table 9–89
INT_REQUEST_44R/W0x4B0Interrupt Request 44 control register-see
Table 9–89
INT_REQUEST_45R/W0x4B4Interrupt Request 45 control register-see
Table 9–89
INT_REQUEST_46R/W0x4B8Interrupt Request 46 control register-see
Table 9–89
INT_REQUEST_47R/W0x4BCInterrupt Request 47 control register-see
Table 9–89
INT_REQUEST_48R/W0x4C0Interrupt Request 48 control register-see
Table 9–89
INT_REQUEST_49R/W0x4C4Interrupt Request 49 control register-see
Table 9–89
INT_REQUEST_50R/W0x4C8Interrupt Request 50 control register-see
Table 9–89
INT_REQUEST_51R/W0x4CCInterrupt Request 51 control register-see
Table 9–89
INT_REQUEST_52R/W0x4D0Interrupt Request 52 control register-see
Table 9–89
INT_REQUEST_53R/W0x4D4Interrupt Request 53 control register-see
Table 9–89
INT_REQUEST_54R/W0x4D8Interrupt Request 54 control register-see
Table 9–89
INT_REQUEST_55R/W0x4DCInterrupt Request 55 control register-see
Table 9–89
AFT
DRA
DR
AFT
DRAFT
DR
F
T DRAF
4.1 Interrupt priority mask register
The interrupt priority-mask registers define the thresholds for priority-level masking. Each
interrupt target has its own priority limiter which can be used to define the minimum priority
level for nesting interrupts. Typically, the priority limiter is set to the priority level of the
interrupt service routine that is currently being executed so that only interrupt requests at
a higher priority level lead to a nested interrupt service. Nesting can be disabled by setting
the priority level to Fh in the interrupt request register.
shows the bit assignment of the INT_PRIORITYMASK_0 and
NXP Semiconductors
Table 83.INT_PRIORITYMASK_n registers bit description (INT_PRIORITYMASK_0/1,
BitSymbolAccess Reset
31 to 4reservedR-Reserved; do not modify. Read as logic
3 to 0PRIORITY_LIMITER[3:0] R/W-Priority limiter. This sets a priority
4.2 Interrupt vector register
The interrupt vector registers identify for each interrupt target the highest-priority enabled
pending interrupt request that is present at the time when the register is being read. The
software interrupt service routine must always read the vector register that corresponds to
the interrupt target. The interrupt vector content can be used as vector into a memory
based table like that shown in Figure 9–19
register content as a full 32-bit address pointer the table must be aligned to a 512-byte
address boundary (or 2048 to be future-proof). If only the index variable is used as offset
into the table then this address alignment is not r equired. Ea ch table entry is 64 bits wide.
It is recommended to pack for each table entry:
. This table has 32 entries. To be able to use the
DRAFT
D
D
RAFT DRAFT DRAFT DRAFT DRAFT D
RAFT DRA
D
RAFT
UM10316
DR
AFT
DRAFT
DRA
F
T DRAFT DRAFT DRAFT DRA
Description
0
threshold that incoming interrupt
requests must exceed to trigger
interrupt requests towards the controller
and power management controller
DR
AFT
DRAFT
DR
F
T DRAF
• The start address of a peripheral-specific interrupt service routine, plus
• The associated priority-limiter value (if nesting of interrupt service routines is
performed)
A vector with index 0 indicates that no interrupt is pending with a priority above the priority
threshold. For this special-case entry the vector table should implement a ‘no-interrupt’
handler.
Fig 19. Memory-based interrupt vector and priority table
Table 9–84 shows the bit assignment of the INT_VECTOR registers.
Table 84.INT_VECTORn register bit description (INT_VECTOR0/1, addresses 0xFFFF F100
and 0xFFFF F104)
BitSymbolAccess ValueDescription
31 to 11 TABLE_ADDR[20:0] R/W-Table start address. This indicates the lower
10 to 9reservedR-Reserved; do not modify. Read as logic 0
8to3INDEX[5:0]R/W
2 to 0NULL[2:0]R/W
[1] Write as 0.
4.3 Interrupt-pending register 1
The interrupt-pending register gathers the pending bits of interrupt requests 1 to 31.
Software can make use of this feature to gain a faster overview of pending in terrupt s th an
it would get by reading the individual interrupt request registers.
[1]
[1]
address boundary of a 512-byte aligned
vector table in memory. To be compatible
with future extension an address boundary of
2048 bytes is recommended
Index. This indicates the interrupt request
line of the interrupt request to be served by
the controller
00 0000 No interrupt request to be serviced
00 0001 Service interrupt request at input 1
::
011111 Service interrupt request at input 31
0hAlways reflecting logic 0s
Table 85.INT_PENDING_1_31 register bit description (INT_PENDING_1_31, add ress
BitSymbolAccess ValueDescription
31PENDING[31]R1Interrupt request 31 is pending
::::
1PENDING[1]R1Interrupt request 1 is pending
0R0Reserved; read as logic 0
shows the bit assignment of the INT_PENDING_1_31 register.
0xFFFF F200)
0There is no interrupt request 31
0There is no interrupt request 1
4.4 Interrupt-pending register 2
The interrupt-pending register gathers the pending bits of all interrupt requests 32 to 63.
Software can make use of this feature to gain a faster overview on pending interrup ts than
it would get by reading the individual interrupt request registers.
The INT_PENDING_32_63 register is read only.
Table 9–86
T able 86. INT_PENDING_32_63 register bit description (INT_PENDING_32_63, address
BitSymbolAccess ValueDescription
31 to 25 reservedR-Reserved; read as don’t care
24PENDING[63]R1Interrupt request 63 is pending
::::
0PENDING[32]R1Interrupt request 32 is pending
shows the bit assignment of the INT_PENDING_32_63 register.
0xFFFF F204)
0There is no interrupt request 63
0There is no interrupt request 32
4.5 Interrupt controller features register
The interrupt controller features register indicates the VIC configuration which an ISR can
use for implementing interrupt controller configuration-specific behavior.
The INT_FEATURES register is read-only
Table 9–87
T able 87. INT_FEATURES register bit description (INT_FEATURES, address 0xFFFF F300)
* = reset value
BitSymbolAccess ValueDescription
31 to 16 reservedR-Reserved; read as don’t care
21 to 16 TRNumber of targets (minus one)
shows the bit assignment of the INT_FEATURES register.
01h*
NXP Semiconductors
T able 87. INT_FEATURES register bit description (INT_FEATURES, address 0xFFFF F300)
* = reset value
BitSymbolAccess ValueDescription
7 to 0NRNumber of interrupt requests
4.6 Interrupt request register
The reference between the interrupt source and interrupt request line is reflected in
Table 9–88
T able 88. Interrupt source and request reference
Interrupt
request
1WatchdogInterrupt from Watchdog timer
2timer 0Capture or match interrupt from timer 0
3timer 1Capture or match interrupt from timer 1
4timer 2Capture or match interrupt from timer 2
5timer 3Capture or match interrupt from timer 3
6UART 0General interrupt from UART 0
7UART 1General interrupt from UART 1
8SPI 0General interrupt from SPI 0
9SPI 1General interrupt from SPI 1
10SPI 2General interrupt from SPI 2
11flashSignature, burn or erase finished interrupt from flash
12embedded RT-ICEComms Rx for ARM debug mode
13embedded RT-ICEComms Tx for ARM debug mode
14MSCSS timer 0Capture or match interrupt from MSCSS timer 0
15MSCSS timer 1Capture or match interrupt from MSCSS timer 1
16ADC int_req 0ADC interrupt from ADC 0
17ADC int_req 1ADC interrupt from ADC 1
18ADC int_req 2ADC interrupt from ADC 2
19PWM 0PWM interrupt from PWM 0
20PWM capt match 0PWM capture/match interrupt from PWM 0
21PWM 1PWM interrupt from PWM 1
22PWM capt match 1PWM capture/match interrupt from PWM 1
23PWM 2PWM interrupt from PWM 2
24PWM capt match 2PWM capture/match interrupt from PWM 2
25PWM 3PWM interrupt from PWM 3
26PWM capt match 3PWM capture/match interrupt from PWM 3
27Event RouterEvent, wake up tick interrupt from Event Router
28LIN master controller 0General interrupt from LIN master controller 0
29LIN master controller 1General interrupt from LIN master controller 1
30I2C0I
31I2C1I2C interrupt from I2C1 (SI state change)
32GPDMADMA
33GPDMADMA err
34GPDMADMA tc
35all CAN controllersFullCAN
36all CAN controllersCombined general interrupt of all CAN controllers and the
37CAN controller 0 Message-received interrupt from CAN controller 0
38CAN controller 1 Message-received interrupt from CAN controller 1
39 - 42-reserved
43CAN controller 0 Message-transmitted interrupt from CAN controller 0
44CAN controller 1 Message-transmitted interrupt from CAN controller 1
45USB I2C
46USB device, high-priority
47USB device, low-priority
48USB device DMA
49USB host interrupt
50USB ATX
51USB OTG timer
52QEIquadrature encoder interrupt
53 - 54-reserved
55CGU0
56CGU1
63 - 57-reserved
[2] Message-received interrupt from a CAN controller. The receive interrupt (RI) and the ID ready interrupt (IDI)
are combined here; see Section 21–9.14
and Section 21–10.8 for details.
for details.
The interrupt request registers hold the configuration information related to interrupt
request inputs of the interrupt controller and allow it to issue software interrupt requests.
Each interrupt line has its own interrupt request register.