CHAPTER 9 TIMER/COUNTER FUNCTION
200
User’s Manual U15195EJ5V0UD
(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 using the PRM02 to PRM00 bits of the TMC0n registers (f
CLK
: base clock, see
9.1.5 (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-2. The operation mode is selected using timer
control register 0n (TMC0n).
Table 9-2. Operation Modes of Timer 0
Operation Mode
Count Operation
Timer Clear
Source
Interrupt Source
BFCMn3
→
CM0n3
Transfer Timing
BFCMn0 to BFCMn2,
BFCMn4, BFCMn5
→
CM0n0 to CM0n2,
CM0n4, CM0n5
Transfer Timing
PWM mode 0
(symmetric
triangular wave)
Up/down
−
INTTM0n,
INTCM010 to
INTCM012,
INTCM0n3 to
INTCM0n5
INTTM0n INTTM0n
PWM mode 1
(asymmetric
triangular wave)
Up/down
−
INTTM0n,
INTCM010 to
INTCM012,
INTCM0n3 to
INTCM0n5
INTTM0n INTTM0n,
INTCM0n3
PWM mode 2
(sawtooth wave)
Up INTCM0n3
INTCM010
to
INTCM012,
INTCM0n3 to
INTCM0n5
INTCM0n3 INTCM0n3
Caution Even if TM0ICn, CM03ICn, or an interrupt mask flag of the IMR0 register (TM0MKn or CM03MKn)
is set (interrupt disabled) as the interrupt sources INTTM0n and INTCM0n3, it simply results in
no interrupt occurrence and does not affect the operation of timer 0.
The interrupt sources INTCM010 to INTCM012, INTCM0n4, and INTCM0n5 do not affect the
operation of timer 0 regardless of whether the interrupt is masked or not.
Remark
n = 0, 1
Содержание PD703114
Страница 2: ...2 User s Manual U15195EJ5V0UD MEMO ...