
CHAPTER 7 8-BIT TIMER/EVENT COUNTER 00
User’s Manual U11919EJ4V0UD
103
7.4 Operation of 8-Bit Timer/Event Counter 00
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 register 00 (CR00) in advance.
To operate 8-bit timer/event counter 00 as an interval timer, the following settings are required.
<1> Disable the operation of 8-bit timer counter 00 (TM00) (TCE00 (bit 7 of 8-bit timer mode control register 00
(TMC00)) = 0).
<2> Set the count clock of 8-bit timer/event counter 00 (see Table 7-4).
<3> Set a count value in CR00.
<4> Enable the operation of TM00 (TCE00 = 1).
When the count value of 8-bit timer counter 00 (TM00) matches the value set to CR00, the value of TM00 is
cleared to 0 and TM00 continues counting. At the same time, an interrupt request signal (INTTM0) is generated.
Table 7-4 shows the interval time, and Figure 7-4 shows the timing of interval timer operation.
Cautions 1. Before rewriting CR00, stop the timer operation.
If CR00 is rewritten while the timer
operation is enabled, the match interrupt request signal may be generated immediately.
2. If setting the count clock in TMC00 and enabling the operation of TM00 are performed at the
same time with an 8-bit memory manipulation instruction, the error one cycle after the timer
has been started may exceed one clock. To use 8-bit timer/event counter 00 as an interval
timer, therefore, perform the setting in the above sequence.
Table 7-4. Interval Time of 8-Bit Timer/Event Counter 00
TCL001
TCL000
Minimum Interval Time
Maximum Interval Time
Resolution
00
1/fX (200 ns)
2
8/fX (51.2
s)
1/fX (200 ns)
01
2
5/fX (6.4
s)
2
13/fX (1.64 ms)
2
5/fX (6.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: System clock oscillation frequency
2. The parenthesized values apply to operation at fX = 5.0 MHz.