Periodic Interrupt Timer (PIT)
41.3
Functional description
This section provides the functional description of the module.
41.3.1
General
This section gives detailed information on the internal operation of the module. Each timer
can be used to generate trigger pulses as well as to generate interrupts. Each interrupt is
available on a separate interrupt line.
41.3.1.1
Timers
The timers generate triggers at periodic intervals, when enabled. They load their start
values, as specified in their LDVAL 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 TCTRL 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 CVAL registers.
The counter period can be restarted, by first disabling, then enabling the timer with the TEN
bit (see the following figure).
Trigger
Event
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 the following figure).
Trigger
Event
It is also possible to change the counter period without restarting the timer by writing the
LDVAL register with the new load value. This value will then be loaded after the next trigger
event (see the following figure).
866/2058
Figure 400. Stopping and starting a timer
Timer Enabled
Start Value = p1
p1
p1
Figure 401. Modifying running timer period
Timer Enabled
Start Value = p1
DocID027809 Rev 4
Disable
Re-Enable
Timer
Timer
p1
Disable
Timer,
Set new
Load Value
p1
p1
Re-Enable
Timer
p2
p2
p2
p1
RM0400
Need help?
Do you have a question about the SPC572L series and is the answer not in the manual?
Questions and answers