
CHAPTER 10 8-BIT TIMER 30, 40
User’s Manual U14800EJ3V0UD
166
10.5 Notes on Using 8-Bit Timer 30, 40
(1)
Error on starting timer
An error of up to 1.5 clocks is included in the time between when the timer is started and a match signal is
generated. This is because the counter may be incremented by detecting a rising edge at the timing at which
the timer starts while the count clock is high level (see Figure 10-24).
Figure 10-24. Case in Which Error of 1.5 Clocks (Max.) Occurs
TCEn0
00H
01H
02H
03H
If delay A > delay B when the timer starts while the selected
clock is high level, an error of 1.5 clocks (max.) occurs.
TMn0 count value
Count pulse
Clear signal
Selected clock
Clear signal
8-bit timer counter n0
(TMn0)
Count
pulse
Delay A
Delay B
Selected clock
Remark n = 3, 4
(2)
Count value if external clock input from TMI40 pin is selected
When the external clock signal input from the TMI40 pin is selected as the count clock, the count value may
start from 01H if the timer is enabled (TCE40 = 0 → 1) while the TMI40 pin is high. This is because the input
signal of the TMI40 pin is internally ANDed with the TCE40 signal. Consequently, the counter is incremented
because the rising edge of the count clock is input to the timer immediately when the TCE40 pin is set.
Depending on the delay timing, the count value is incremented by one if the rising edge is input after the
counter is cleared. Counting is not affected if the rising edge is input before the counter is cleared (the
counter operates normally).
Use the timer being aware that it has an error of one count, or take either of the following actions A or B.
<Action A> Always start the timer when the TMI40 pin is low.
<Action B> Save the count value to a control register when the timer is started, subtract the count value from
the count value saved to the control register when reading the count value, and take the result as
the true count value.