153
Chapter 7 Timer/Counter Units
7
Fig. 7-57 Setting Procedure for Interval Timer Operation (1)
Fig. 7-58 Interrupt Request Handling for Interval Timer Operation (1)
(2) Interval timer operation (2)
Eight-bit timer/counter 1 can be used as an interval timer that generates an interrupt at intervals of a count
time specified beforehand. (See Fig. 7-59.)
Fig. 7-60 shows the setting of control registers, and Fig. 7-61 shows the setting procedure.
Interval timer (1)
Set count value in CR10 register
Set CRC1 register
Start counting ; Sets bit 3 of TMC1 to 1
INTC10 interrupt
CE11
CRC100H
CR10n
Set PRM1 register
INTC10 interrupt
Other interrupt program
CR10CR10 + n
RETI
Calculation of timer value at
which next interrupt is to occur