
220
CHAPTER 8 8/16-BIT TIMER/COUNTER
8.6
Operation of the Interval Timer Function
This section describes the operation of the interval timer function of the 8/16-bit timer/
counter.
I
Operation of the Interval Timer Function
H
In the 8-bit mode
To use Timer 1 in the 8-bit mode as the interval timer function, the setting shown in Figure 8.6-1
"Setting the Interval Timer Function (Timer 1)" must be made.
Figure 8.6-1 Setting the Interval Timer Function (Timer 1)
To use Timer 2 in the 8-bit mode as the interval timer function, the setting shown in Figure 8.6-2
"Setting the Interval Timer Function (Timer 2)" must be made.
Figure 8.6-2 Setting the Interval Timer Function (Timer 2)
If the counter is started in the 8-bit mode, the counter starts counting up from "00
H
" at every
rising edge of the selected clock. If the counter value matches the value in the data register
(comparator data latch), the interrupt request flag bit (T1CR: T1IF or T2IF) is set to "1" and the
counter starts counting from "00
H
". If the output of the square wave output control circuit is
reversed and the square wave output is enabled (T011, T010, and T021, T020=Other than
00B), a corresponding timer output pin outputs square waves.
Timers 1 and 2 correspond to the T01 and T02 pins, respectively.
Figure 8.6-3 "Operation of the Interval Timer Function in the 8-bit Mode (Timer 1)" shows the
operation of the interval timer function in the 8-bit mode.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
T1CR
: Used bit
: Unused bit
0 : Set to 0
T1DR
Set to the interval time (comparison value)
TO10 TC11
STP1 STR1
TC10
T1IE
T1IF
TO11
Other than 11
Other than 11
T2CR
TO20 TC21
STP2 STR2
TC20
T2IE
T2IF
TO21
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
T2CR
T2DR
TO20 TC21
STP2 STR2
TC20
T2IE
T2IF
TO21
: Used bit
0 : Set to 0
Set to the interval time (comparison value)
Other than 11