M68HC11
REFERENCE MANUAL
MAIN TIMER AND REAL-TIME INTERRUPT
MOTOROLA
10-13
tus bit is cleared by writing to the TFLG2 register with a one in the corresponding data
bit position (bit 6). The RTII control bit allows the user to configure the RTI system for
polled or interrupt-driven operation but does not affect the setting or clearing of RTIF.
When RTII is zero, interrupts are inhibited, and the RTI system is operating in a polled
mode. In this mode, the RTIF bit must be polled (sampled) by user software to deter-
mine when an RTI period has elapsed. When the RTII control bit is one, a hardware
interrupt request is generated each time RTIF is set to one. Before leaving the interrupt
service routine, software must clear RTIF by writing to the TFLG2 register (see
10.2.4
Tips for Clearing Timer Flags
).
The following register and paragraphs explain the RTI rate select bits in the pulse ac-
cumulator control register (PACTL). The other bits in this register are not related to the
RTI system.
RTR1, RTR0 — Real-Time Interrupt Rate Selects
These two bits determine the rate at which interrupts will be requested by the RTI sys-
tem. The RTI system is driven by an E divided by 2
13
rate clock compensated so that
it is independent of the timer prescaler. These two control bits select an additional di-
vision factor.
Table 10-2
shows the RTI rates that result for various combinations of
crystal frequency and RTI rate-select control bit values. RTI is set to its fastest rate by
default out of reset and may be changed at any time.
Table 10-2 RTI Rates vs. RTR1, RTR0 for Various Crystal Frequencies
10.2.3 COP Watchdog Function
The COP watchdog function is only superficially related to the main timer system. The
clocking chain for the watchdog function is tapped off of the main timer divider chain.
Figure 10-3
illustrates how the COP clock is derived from the main timer clocking
chain. Although the COP clocking chain is discussed briefly, the COP system is ex-
plained in greater detail in
SECTION 5 RESETS AND INTERRUPTS
.
The counter stages up to the E divided by 2
15
tap have no reset input; whereas, the
divider stages after this tap are reset each time the COP clearing sequence is execut-
PACTL —
Pulse Accumulator Control
$1026
BIT 7
DDRA7
0
6
5
4
3
0
0
2
0
0
1
BIT 0
RTR0
0
PAEN
0
PAMOD
0
PEDGE
0
RTR1
0
RESET:
RTR1
RTR0
E
÷
2
13
Divided By
Crystal Frequency
8 MHz
Nominal RTI Rate
4.10 ms
8.19 Ms
16.38 ms
32.77 ms
2 MHz
Bus Frequency (E Clock)
2
23
Hz
4 MHz
0
0
1
1
0
1
0
1
1
2
4
8
3.91 ms
7.81 ms
15.62 ms
31.25 ms
2.1 MHz
8.19 Ms
16.38 ms
32.77 ms
65.54 ms
1 MHz