276
CHAPTER 10 TIMERS/COUNTERS 2 AND 3
(4) Match between timer register 2 (TM2) and compare register (CM2n: n = 0, 1) is detected only when TM2 is
incremented. Therefore, the interrupt request is not generated and timer output (TO2n: n = 0, 1) does not change
even if the same value as TM2 is written to CM2n.
(5) During PPG output, if the PPG cycle is extremely short as compared with the time required to acknowledge an
interrupt, the value of the compare register (CM2n: n = 0, 1) cannot be rewritten by interrupt processing that is
performed on match between timer register (TM2) and compare register (CM2n). Use another method (for example,
to poll the interrupt request flags by software with all the interrupts masked).
(6) The output level of the TO2n (n = 0, 1) when the timer output is disabled (ENTO2n = 0: n = 0, 1) is the reverse value
of the value set to the ALV2n (n = 0, 1) bit. Therefore, an inactive level is output when the timer output is disabled
with the PWM output function or PPG output function selected.
If timer/counter 2 is stopped and then started again while the active level is output, the PWM output continuously
output the active level until the next overflow occurs (in the case of the PPG output, until the next match and clearing).
To return the level to inactive, once disable the timer output (ENTO2n = 0: n = 0, 1).
(7) If the timer output is enabled and the active level is changed at the same time, the output level of the pin may change
momentarily. To prevent this, change the active level and then enable the timer output.
(8) To change the active level specification(ALV2n bit (n = 0, 1) of the timer output control register 2 (TOC2)), change
the active level specification after the timer output of the corresponding timer output pins has been disabled.
(9) If 0000H is set to a compare register (CM20, CM21), the comparison operation is performed after counting has been
completed. Therefore, the interrupt due to a match (INTCM20, INTCM21) does not occur immediately after counting
has been started. If CM2n (n = 0, 1) is set to 0000H, the timer counts up to FFFFH, overflows, and then the interrupt
due to a match INTCM2n (n = 0, 1) occurs.
Figure 10-43. Operation When Compare Register (CM20, CM21) Is Set to 0000H
Remark
n = 0, 1
Remark
Cautions (1) through (9) above also applies to timer/counter 3.
Interrupt Occurred
Count Started
Match
Match
Match
Match
Cleared Cleared Cleared
0000H
Count Clock
TM2
CE2
CM2n
INTCM2n
0H
1H
2H
3H
4H
5H
FFFFH
0H
0H
0H
0H