MOTOROLA
10-14
MAIN TIMER AND REAL-TIME INTERRUPT
M68HC11
REFERENCE MANUAL
ed (see
Figure 10-3
). This structure determines the uncertainty of the COP time-out
period because software has no practical way of knowing when the first clocking edge
will appear at the E divided by 2
15
tap relative to the COP clearing sequence. For a
bus frequency of 2 MHz (E), the first clock can appear at the E divided by 2
15
tap any-
where between ~0 to 16.4 ms after a COP clearing sequence. This tolerance or un-
certainty depends on the bus frequency (E) but does not vary with respect to the rate
selects (CR1, CR0).
The following register and paragraphs explain the COP timer rate select bits located
in the options control register (OPTION). The other bits in this register are not related
to the main timer system or the COP system.
CR1, CR0 — COP Timer Rate Select Bits
The MCU internal E clock is first divided by 2
15
before it enters the COP watchdog sys-
tem. The CR1 and CR0 control bits regulate a further scaling factor for the watchdog
timer as shown in
Table 10-3
. The columns at the right of the table show the resulting
watchdog time-out periods for three typical oscillator frequencies. After reset, the time-
out period is configured for the shortest time-out period by default. In normal operating
modes, these bits can only be written once, and that write must be within 64 bus cycles
after reset.
Table 10-3 COP Time-Out vs. CR1, CR0 Values
10.2.4 Tips for Clearing Timer Flags
The most common method of clearing a status flag bit in the timer flag registers is to
load an accumulator with a mask that has a one in the bit(s) corresponding to the
flag(s) to be cleared; then write this value to TFLG1 or TFLG2. A bit clear (BCLR) in-
struction can also be used to clear a flag in TFLG1 or TFLG2. The mask, which is sup-
plied with the BCLR instruction, should have zeros in the bit positions corresponding
to the flags to be cleared and ones in all other bits. To clear the TOF flag, execute
BCLR TFLG2 with a mask of %01111111. The BCLR instruction will read TFLG2, AND
it with the inverse of the supplied mask (%10000000 in this case), and write the result
OPTION —
System Configuration Options
$1039
BIT 7
ADPU
0
6
5
4
3
2
0
0
1
BIT 0
CR0
0
CSEL
0
IRQE
0
DLY
0
CME
0
CR1
0
RESET:
CR1
CR0
E
÷
2
15
Divided
By
Crystal Frequency
8 MHz
Nominal Time-Out
16.384 ms
65.536 ms
262.14 ms
1.049 s
2 MHz
Bus Frequency (E Clock)
2
23
Hz
4 MHz
0
0
1
1
0
1
0
1
1
4
16
64
15.625 ms
62.5 ms
250 ms
1 s
2.1 MHz
32.768 ms
131.07 ms
524.29 ms
2.1 s
1 MHz