
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 00 TO 02
122
User’s Manual U13952EJ3V1UD
7.4 Operation of 8-Bit Timer/Event Counters 00 to 02
7.4.1 Operation as interval timer
The interval timer repeatedly generates an interrupt at time intervals specified by the count value set to 8-bit
compare registers 00, 01, and 02 (CR00, CR01, and CR02) in advance.
To operate the 8-bit timer/event counter as an interval timer, make the settings in the following order.
<1> Set 8-bit timer counter 0n (TM0n) to operation-disabled (TCE0n (bit 7 of 8-bit timer mode control register 0n
(TMC0n)) = 0)
<2> Select the count clock of the 8-bit timer/event counter (see Tables 7-6 to 7-8)
<3> Set the count value to CR0n
<4> Set TM0n to operation-enabled (TCE0n = 1)
When the count value of 8-bit timer counter 0n (TM0n) matches the value set to CR0n, the value of TM0n is
cleared to 00H and TM0n continues counting. At the same time, an interrupt request signal (INTTM0n) is generated.
Tables 7-6 through 7-8 show the interval time, and Figures 7-8 and 7-9 show the timing of interval timer operation.
Caution
When the setting of the count clock using TMC0n and the setting of the TM0n to operation-
enable using an 8-bit memory manipulation instruction are performed at the same time, an error
of one clock or more may occur in the first cycle after the timer is started. Because of this,
when the 8-bit timer/event counter operates as an interval timer, be sure to make the settings in
the order described above.
Remark
n = 0 to 2
Table 7-6. Interval Time of 8-Bit Timer/Event Counter 00
TCL001
TCL000
Minimum Interval Time
Maximum Interval Time
Resolution
0
2
6/fX (12.8
s)
2
14/fX (3.28 ms)
2
6/fX (12.8
s)
0
1
2
9/fX (102.4
s)
2
17/fX (26.2 ms)
2
9/fX (102.4
s)
1
0
TI0 input cycle
2
8
× TI0 input cycle
TI0 input edge cycle
1
TI0 input cycle
2
8
× TI0 input cycle
TI0 input edge cycle
Remarks 1. fX: Main system clock oscillation frequency
2. The parenthesized values apply to operation at fX = 5.0 MHz.
Table 7-7. Interval Time of 8-Bit Timer/Event Counter 01
TCL011
TCL010
Minimum Interval Time
Maximum Interval Time
Resolution
0
2
4/fX (3.2
s)
2
12/fX (819.2
s)
2
4/fX (3.2
s)
0
1
2
8/fX (51.2
s)
2
16/fX (13.1 ms)
2
8/fX (51.2
s)
1
0
TI1 input cycle
2
8
× TI1 input cycle
TI1 input edge cycle
1
TI1 input cycle
2
8
× TI1 input cycle
TI1 input edge cycle
Remarks 1. fX: Main system clock oscillation frequency
2. The parenthesized values apply to operation at fX = 5.0 MHz.