DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
248 of 571
NXP Semiconductors
UM10316
Chapter 17: LPC29xx timer 0/1/2/3
4.
Timer match functionality
The timer block contains four match circuits, each of which can be programmed with an
individual match value and a specific action-on-match. Once the counter value matches
one of the programmed match values in the MR# register one or more of the following
actions can occur (selected by programming the MCR register):
•
Reset the counter and prescaler
•
Stop the counter
•
Generate an interrupt
•
Generate an external notification (in this case, on a match the external match pins go
to the setting selected via the EMR register).
4.1 Timer capture functionality
The timer block contains four capture circuits. The capture functionality allows measuring
the time of an external event. Depending on configuration, a rising or a falling edge of the
input can cause a capture event. Following an event the capture register is loaded with
the Timer Counter value and (if enabled) an interrupt is generated.
The trigger for the capture and whether an interrupt should be generated on match is
configured using the CCR register. The captured value is then available in the Capture
register (CR#).
4.2 Timer interrupt handling
Once the interrupt is generated its status can be accessed and cleared using the IR
register. See
and
for details of how to set up interrupt
generation.
PR=2, MRx=6
Fig 63. Stop-on-match timing
Prescale
Counter (PC)
CLK(SYS)
Timer
Counter (TC)
Timer Interrupt
(active low)
Timer Counter (TC)
reached
Match Value (MRx=6)
2
2
0
0
1
6
5
4