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.