Example Timer Operation - Philips LPC2119 User Manual

Arm-based microcontroller
Hide thumbs Also See for LPC2119:
Table of Contents

Advertisement

Philips Semiconductors
ARM-based Microcontroller

EXAMPLE TIMER OPERATION

Figure 38 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.
Figure 39 shows a timer configured to stop and generate an interrupt on match. The prescaler is again set to 2 and the match
register set to 6. In the next clock after the timer reaches the match value, the timer enable bit in TCR is cleared, and the interrupt
indicating that a match occurred is generated.
pclk
Prescale Counter
Timer Counter
Timer Counter
Reset
Interrupt
Figure 38: A timer cycle in which PR=2, MRx=6, and both interrupt and reset on match are enabled.
pclk
Prescale Counter
Timer Counter
TCR[0]
(Counter Enable)
Interrupt
Figure 39: A timer cycle in which PR=2, MRx=6, and both interrupt and stop on match are enabled.
Timer0 and Timer1
2
0
1
2
4
5
2
0
1
2
4
5
1
0
1
2
0
6
0
6
0
187
Preliminary User Manual
LPC2119/2129/2292/2294
1
2
0
1
0
1
January 08, 2004

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2129Lpc2292Lpc2294

Table of Contents