
MOTOROLA
5-20
SINGLE-CHIP INTEGRATION MODULE 2
MC68HC16R1/916R1
USER’S MANUAL
5.4.6 Periodic Interrupt Timer
The periodic interrupt timer (PIT) allows the generation of interrupts of specific priority
at predetermined intervals. This capability is often used to schedule control system
tasks that must be performed within time constraints. The timer consists of a prescaler,
a modulus counter, and registers that determine interrupt timing, priority and vector
assignment. Refer to
4.13 Exceptions
for further information about interrupt exception
processing.
The periodic interrupt timer modulus counter is clocked by one of two signals. When
the PLL is enabled (MODCLK = 1 during reset), f
ref
is used with a slow reference
oscillator; f
ref
÷
128 is used with fast reference oscillator. When the PLL is disabled
(MODCLK = 0 during reset), f
ref
is used. The value of the periodic timer prescaler
(PTP) bit in the periodic interrupt timer register (PITR) determines system clock
prescaling for the periodic interrupt timer. One of two options, either no prescaling, or
prescaling by a factor of 512, can be selected. The value of PTP is affected by the state
of the MODCLK pin during reset, as shown in
Table 5-7
. System software can change
PTP value.
Either clock signal selected by the PTP is divided by four before driving the modulus
counter. The modulus counter is initialized by writing a value to the periodic interrupt
timer modulus (PITM[7:0]) field in PITR. A zero value turns off the periodic timer. When
the modulus counter value reaches zero, an interrupt is generated. The modulus
counter is then reloaded with the value in PITM[7:0] and counting repeats. If a new
value is written to PITR, it is loaded into the modulus counter when the current count
is completed.
The following equation calculates the PIT period when a slow reference frequency is
used:
The following equation calculates the PIT period when a fast reference frequency is
used:
Table 5-7 MODCLK Pin and PTP Bit at Reset
MODCLK
0 (External Clock)
1 (Internal Clock)
PTP
1 (
÷
512)
0 (
÷
1)
PIT Period
PITM[7:0]
---------------------------------------------------------------------------------------------------------------------
(
)
1 if PTP = 0, 512 if PTP = 1
(
f
ref
)
4
( )
=
PIT Period
128
------------------------------------------------------------------------------------------------------------------------------------
(
)
PITM[7:0]
(
)
1 if PTP = 0, 512 if PTP = 1
(
f
ref
)
4
( )
=