211
Chapter 7 Timer/Counter Units
7
Fig. 7-128 Compare Operation
7.4.6 Sample Applications
(1) Interval timer operation
Eight-bit timer/counter 3 can be used as an interval timer that generates an interrupt at intervals of a count
time specified beforehand. Eight-bit timer/counter 3 can also be used for baud rate generation.
This interval timer has a resolution from 1.3
µ
s to 85.3
µ
s, and can count up to 341
µ
s and 21.8 ms, respectively
(at internal system clock fCLK = 6 MHz).
Fig. 7-129 shows the timing of interval timer operation. Fig. 7-130 shows the setting of control registers for
interval timer operation. Fig. 7-131 shows the setting procedure.
Fig. 7-129 Timing of Interval Timer Operation
Remark Interval = (n + 1) × x/fCLK, 0 n FFH
x = 8, 16, 32, 64, 128, 256, 512
0H
TM3
count value
n
Compare register
(CR30)
INTC30
interrupt request
Interrupt accepted Interrupt accepted
Cleared Cleared
n
n
Count starts
Interval Interval
TM3
count value
0H
CR30
Count starts Cleared
(coincidence)
Cleared
(coincidence)
CR30
CE1
INTC30
interrupt request