Unde
Timer X
deeopmen
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
68
Item
Specification
Count source
Count operation
f
1
, f
8
, f
32
, f
C32
Down count
When the timer underflows, it reloads the reload register contents before continuing counting
1/(n+1)
n : Set value
Count start flag is set (= 1)
Count start flag is reset (= 0)
When the timer underflows
Programmable I/O port, gate input or pulse output
Count value can be read out by reading timer Xi register
When counting stopped
When a value is written to timer Xi register, it is written to both reload register and counter
When counting in progress
When a value is written to timer Xi register, it is written to only reload register
(Transferred to counter at next reload time)
Gate function
Counting can be started and stopped by the TXi
INOUT
pin’s input signal
Pulse output function
Each time the timer underflows, the TXi
INOUT
pin’s polarity is reversed
Divide ratio
Count start condition
Count stop condition
Interrupt request generation timing
TXi
INOUT
pin function
Read from timer
Write to timer
Select function
(1) Timer mode
In this mode, the timer counts an internally generated count source. (See Table 1.21.) Figure 1.60 shows
the timer Xi mode register in timer mode.
Table 1.21. Specifications of timer mode
Figure 1.60. Timer Xi mode register in timer mode
Note 1: Set the corresponding port direction register to “1” (output mode). Gate function
cannot be selected when pulse output function is selected.
Note 2: The bit can be “0” or “1”.
Note 3: Set the corresponding port direction register to “0” (input mode). Pulse output
function cannot be selected when gate function is selected.
Timer Xi mode register
b7
b6
b5
b4
b3
0
Symbol
TXiMR(i = 0 to 2) 0397
16
to 0399
16
Address
When reset
00
16
Bit name
Function
Bit symbol
b2 b1
b0
Operation mode
select bit
0 0 : Timer mode
TMOD1
MR0
TMOD0
Pulse output function
select bit
0 : Pulse is not output
(TXi
INOUT
pin is a normal port pin)
1 : Pulse is output (Note 1)
(TXi
INOUT
pin is a pulse output pin)
b4 b3
Gate function select bit
(Note 2)
: Gate function not available
(TXi
INOUT
pin is a normal port pin)
1 0 : Timer counts only when TXi
INOUT
pin is held “L” (Note 3)
1 1 : Timer counts only when TXi
INOUT
pin is held “H” (Note 3)
MR2
MR1
MR3
0 (Must always be fixed to “0” in timer mode)
0 0 : f
1
0 1 : f
8
1 0 : f
32
1 1 : f
C32
b7 b6
TCK1
TCK0
Count source select bit
0 0
AA
AA
AA
AA
A
A