General Operation - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

30.5.1 General operation

This section gives detailed information on the internal operation of the module. Each
timer can be used to generate trigger pulses and interrupts. Each interrupt is available on
a separate interrupt line.
30.5.1.1 Timers
The timers generate triggers at periodic intervals, when enabled. The timers load the start
values as specified in their LDVAL registers, count down to 0 and then load the
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 TCTRLn[TIE]. 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, and then enabling the timer with
TCTRLn[TEN]. See the following figure.
Timer enabled
Start value = p1
Trigger
event
p1
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.
Timer enabled
Start value = p1
Trigger
event
It is also possible to change the counter period without restarting the timer by writing
LDVAL with the new load value. This value will then be loaded after the next trigger
event. See the following figure.
Freescale Semiconductor, Inc.
Disable
timer
p1
p1
Figure 30-2. Stopping and starting a timer
Disable timer,
Set new load value
p1
Figure 30-3. Modifying running timer period
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Chapter 30 Periodic Interrupt Timer (PIT)
Re-enable
timer
p1
Re-enable
timer
p2
p2
p1
p2
495

Advertisement

Table of Contents
loading

Table of Contents