UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
861 of 1269
NXP Semiconductors
UM10503
Chapter 29: LPC43xx Timer0/1/2/3
Effective processing of the externally supplied clock to the counter has some limitations.
Since two successive rising edges of the PCLK clock are used to identify only one edge
on the CAP selected input, the frequency of the CAP input can not exceed one quarter of
the PCLK clock. Consequently, duration of the high/low levels on the same CAP input in
this case can not be shorter than 1/(2 PCLK).
29.7 Functional description
29.7.1 Example timer operation
shows a timer configured to reset the count and generate an interrupt on match.
The prescaler is set to 2 and the match register set to 6. At the end of the timer cycle
where the match occurs, the timer count is reset. This gives a full length cycle to the
match value. The interrupt indicating that a match occurred is generated in the next clock
after the timer reached the match value.
Table 695. Timer count control register (CTCR - addresses 0x4008 4070 (TIMER0),
0x4008 5070 (TIMER1), 0x400C 3070 (TIMER2), 0x400C 4070 (TIMER3)) bit
description
Bit
Symbol
Value
Description
Reset
value
1:0
CTMODE
Counter/Timer Mode
This field selects which rising PCLK edges can increment
Timer’s Prescale Counter (PC), or clear PC and increment
Timer Counter (TC).
Timer Mode: the TC is incremented when the Prescale
Counter matches the Prescale Register.
00
0x0
Timer Mode: every rising PCLK edge
0x1
Counter Mode: TC is incremented on rising edges on the
CAP input selected by bits 3:2.
0x2
Counter Mode: TC is incremented on falling edges on the
CAP input selected by bits 3:2.
0x3
Counter Mode: TC is incremented on both edges on the
CAP input selected by bits 3:2.
3:2
CINSEL
Count Input Select
When bits 1:0 in this register are not 00, these bits select
which CAP pin is sampled for clocking.
Note:
If Counter mode is selected for a particular CAPn
input in the TnCTCR, the 3 bits for that input in the Capture
Control Register (TnCCR) must be programmed as 000.
However, capture and/or interrupt can be selected for the
other 3 CAPn inputs in the same timer.
00
0x0
CAPn.0 for TIMERn
0x1
CAPn.1 for TIMERn
0x2
CAPn.2 for TIMERn
0x3
CAPn.3 for TIMERn
31:4
-
-
Reserved, user software should not write ones to reserved
bits. The value read from a reserved bit is not defined.
NA