CHAPTER 7 8-BIT TIMER 80
User’s Manual U16898EJ3V0UD
126
7.4 Operation of 8-Bit Timer 80
7.4.1 Operation as interval timer
When 8-bit timer 80 operates as an interval timer, it can repeatedly generate an interrupt at intervals specified by
the count value set in advance to 8-bit compare register 80 (CR80).
To use 8-bit timer 80 as an interval timer, make the following setting.
<1> Disable the operation of 8-bit timer counter 80 (clear TCE80 (bit 7 of 8-bit timer mode control register 80
(TMC80)) to 0).
<2> Set the count clock of 8-bit timer 80 (refer to Tables 7-3 and 7-4).
<3> Set the count value to CR80.
<4> Enable the operation of TM80 (set TCE80 to 1).
When the count value of 8-bit timer counter 80 (TM80) matches the set value of CR80, the value of TM80 is
cleared to 00H and counting is continued. At the same time, an interrupt request signal (INTTM80) is generated.
Tables 7-3 and 7-4 show the interval time, and Figure 7-5 shows the timing of the interval timer operation.
Cautions 1. When changing the value of CR80, be sure to stop the timer operation. If the value of CR80 is
changed with the timer operation enabled, a match interrupt request signal may be generated
immediately.
2. If the count clock of TMC80 is set and the operation of TM80 is enabled at the same time by
using an 8-bit memory manipulation instruction, the error of one cycle after the timer is
started may be 1 clock or more (refer to 7.5 (1) Error when timer starts). Therefore, be sure to
follow the above sequence when using TM80 as an interval timer.
Table 7-3. Interval Time of 8-Bit Timer 80 (f
XP
= 8.0 MHz)
TCL801
TCL800
Minimum Interval Time
Maximum Interval Time
Resolution
0 0
2
6
/f
XP
(8
µ
s)
2
14
/f
XP
(2.05 ms)
2
6
/f
XP
(8
µ
s)
0 1
2
8
/f
XP
(32
µ
s)
2
16
/f
XP
(8.19 ms)
2
8
/f
XP
(32
µ
s)
1 0
2
10
/f
XP
(128
µ
s) 2
18
/f
XP
(32.7 ms)
2
10
/f
XP
(128
µ
s)
1 1
2
16
/f
XP
(8.19 ms)
2
24
/f
XP
(2.01 s)
2
16
/f
XP
(8.19 ms)
Remark
f
XP
: Oscillation frequency of clock to peripheral hardware
Table 7-4. Interval Time of 8-Bit Timer 80 (f
XP
= 10.0 MHz)
TCL801
TCL800
Minimum Interval Time
Maximum Interval Time
Resolution
0 0
2
6
/f
XP
(6.4
µ
s)
2
14
/f
XP
(1.64 ms)
2
6
/f
XP
(6.4
µ
s)
0 1
2
8
/f
XP
(25.6
µ
s)
2
16
/f
XP
(6.55 ms)
2
8
/f
XP
(25.6
µ
s)
1 0
2
10
/f
XP
(102
µ
s) 2
18
/f
XP
(26.2 ms)
2
10
/f
XP
(102
µ
s)
1 1
2
16
/f
XP
(6.55 ms)
2
24
/f
XP
(1.68 s)
2
16
/f
XP
(6.55 ms)
Remark
f
XP
: Oscillation frequency of clock to peripheral hardware