CHAPTER 9 TIMER/COUNTER FUNCTION
206
User’s Manual U15195EJ5V0UD
(2) Timer control registers 00, 01 (TMC00, TMC01)
TMC0n is a 16-bit register that sets the operation of timer 0 (TM0n).
The TMC0n register can be read/written in 16-bit units.
If the higher 8 bits of the TMC0n register are used as the TMC0nH register and the lower 8 bits as the
TMC0nL register, the register can be read/written in 8-bit or 1-bit units.
Caution To operate timer 0, first set TM0CEn = 0 and then set TM0CEn = 1.
(1/4)
<14>
STINT0
13
CUL02
12
CUL01
2
MBFTE
3
BFTEN
4
BFTE3
<5>
TM0CED0
6
0
7
0
8
PRM00
9
PRM01
10
PRM02
11
CUL00
<15>
TM0CE0
1
MOD01
0
MOD00
TMC00
Address
FFFFF57AH
After reset
0508H
<14>
STINT1
13
CUL02
12
CUL01
2
MBFTE
3
BFTEN
4
BFTE3
<5>
TM0CED1
6
0
7
0
8
PRM00
9
PRM01
10
PRM02
11
CUL00
<15>
TM0CE1
1
MOD01
0
MOD00
TMC01
Address
FFFFF5BAH
After reset
0508H
Bit position
Bit name
Function
15
TM0CEn
Specifies the operation of TM0n.
0: Count disabled (stops after all count values are cleared)
1: Count enabled
Caution When TM0CEn = 0, TO0n0 to TO0n5 output becomes high impedance.
14
STINTn
Specifies interrupt during TM0n timer start.
0: Interrupt not generated at operation start
1: Interrupt generated at operation start
When STINTn = 1, an interrupt is generated immediately after the rising edge of the
TM0CEn signal.
When MOD01 = 0 (triangular wave mode), the INTTM0n interrupt (see
Figure 9-4
)
is generated, and when MOD01 = 1 (sawtooth wave mode), the INTCM0n3 interrupt
is generated.
Cautions 1. Changing the STINTn bit during TM0n operation (TM0CEn bit =
1) is prohibited.
2. The INTCM010 to INTCM012, INTCM0n4, and INTCM0n5
interrupts are not affected by the STINTn bit (an interrupt does
not occur when the timer is started if STINTn = 1).
Specifies the interrupt culling ratio.
CUL02
CUL01
CUL00
Interrupt culling ratio
0 0 0
1/1
0 0 1
1/2
0 1 0
1/4
0 1 1
1/8
1 0 0
1/16
Other than above
Culling not performed
13 to 11
CUL02 to
CUL00
Remark
n = 0, 1