EasyManua.ls Logo

NXP Semiconductors PXN2020 - 22.4 Functional Description; 22.4.1 Timers

NXP Semiconductors PXN2020
1376 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Periodic Interrupt Timer (PIT)
PXN20 Microcontroller Reference Manual, Rev. 1
22-8 Freescale Semiconductor
22.4 Functional Description
The PIT block has eight timers for general-purpose use. Each timer can be used to generate trigger pulses
as well as to generate interrupts. Each interrupt is available on a separate interrupt line.
22.4.1 Timers
The timers generate triggers at periodic intervals, when enabled. They load their start values, as specified
in their LDVALn registers, then count down until they reach 0. Then they load their respective start value
again. Each time a timer reaches 0, it will generate a trigger pulse, and set the interrupt flag.
All interrupts can be enabled or masked (by setting the TIE bits in the TCTRLn registers). A new interrupt
can be generated only after the previous one is cleared.
If desired, the current counter value of the timer can be read via the CVALn registers.
The counter period can be restarted by first disabling and then re-enabling the timer, using the TEN bit (see
Figure 22-7).
The counter period of a running timer can be modified, by first disabling the timer, setting a new load value
and then enabling the timer again (see Figure 22-8).
It is also possible to change the counter period without restarting the timer by writing the LDVALn register
with the new load value. This value will then be loaded after the next trigger event (see Figure 22-9).
Figure 22-7. Stopping and Starting a Timer
Figure 22-8. Modifying Running Timer Period
p1p1
Timer Enabled Disable
Timer
p1
Start Value = p1
Trigger
Event
p1
Re-Enable
Timer
p1
Timer Enabled
Disable
Timer,
Start Value = p1
Trigger
Event
Re-Enable
Timer
p1
Set new
Start Value
p2 p2 p2

Table of Contents

Related product manuals