CHAPTER 9 TIMER/COUNTER FUNCTION (REAL-TIME PULSE UNIT)
230
User’s Manual U14492EJ3V0UD
(1) Timers 00, 01 (TM00, TM01)
TM0n operates as a 16-bit up/down timer or up timer. The cycle is controlled by compare register 0n3
(CM0n3) (n = 0, 1).
TM0n start/stop is controlled by the TM0CEn bit of timer control register 0n (TMC0n).
Division by the prescaler can be selected for the count clock from among f
CLK
, f
CLK
/2, f
CLK
/4, f
CLK
/8, f
CLK
/16,
f
CLK
/32 with the PRM02 to PRM00 bits of the TMC0n register (f
CLK
: base clock, see
9.1.4 (1) Timer 0 clock
selection register (PRM01)
).
The conditions when TM0n becomes 0000H are as follows.
•
Reset input
•
TM0CEn bit = 0
•
TM0n register and compare register 0n3 (CM0n3) match (PWM mode 2 (sawtooth wave) only)
•
Immediately after overflow or underflow
The TM0n timer has 3 operation modes, shown in Table 9-1. The operation mode is selected with timer
control register 0n (TMC0n).
Table 9-1. Timer 0 Operation Modes
Operation Mode
Count Operation
Timer Clear
Source
Interrupt Source
BFCMn3
→
CM0n3
Transfer Timing
BFCMn0 to BFCMn2
→
CM0n0 to CM0n2
Transfer Timing
PWM mode 0
(symmetric
triangular wave)
Up/down
−
INTTM0n
INTCM0n3
INTTM0n
INTTM0n
PWM mode 1
(asymmetric
triangular wave)
Up/down
−
INTTM0n
INTCM0n3
INTTM0n
INTTM0n
INTCM0n3
PWM mode 2
(sawtooth wave)
Up
INTCM0n3
INTCM0n3
INTCM0n3
INTCM0n3
Caution
An interrupt does not occur and the operation of timer 0 is not affected even if TM0ICn,
CM03ICn, or the interrupt mask flag of the IMR0 register (TM0MKn or CM03MKn) is set
(interrupts disabled) as the interrupt source.
Remark
n = 0, 1