116
CHAPTER 6 8-BIT TIMER/EVENT COUNTERS 50 TO 53
User’s Manual U15104EJ2V0UD
(2) Operation after changing compare register during timer count operation
If a new value of 8-bit compare register 5n (CR5n) is less than the value of 8-bit timer counter 5n (TM5n),
counting continues, and TM5n overflows and starts counting from 0. If the new value of CR5n (M) is less than
the old value (N), therefore, it is necessary to restart the timer after changing CR5n.
Figure 6-16. Timing After Changing Compare Register Value During Timer Count Operation
Caution
Be sure to clear TCE5n to 0 to set the STOP status, except when TI5n input is selected.
Remarks 1. N > X > M
2. n = 0 to 3
(3) Reading TM5n (n = 0 to 3) during timer operation
When TM5n is read during operation, the count clock is temporarily stopped. Therefore, select a count clock
with a high/low level longer than two cycles of the CPU clock. For example, when the CPU clock (f
CPU
) is f
X
,
the count clock to be selected should be f
X
/4 or less in order that TM5n can be read.
Remark
n = 0 to 3
Count pulse
CR5n
TM5n count value
N
M
X – 1
X
FFH
00H
01H
02H