Unde
Timer X
deeopmen
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
69
Item
Specification
Count source
External signals input to TXi
INOUT
pin (effective edge can be selected by software)
TB1 overflow, TA0 overflow, TXi overflow
Down count
When the timer underflows, it reloads the reload register contents before
continuing counting (Note)
1/ (n + 1)
n : Set value
Count start flag is set (= 1)
Count start flag is reset (= 0)
Interrupt request generation timing
The timer underflows
TXi
INOUT
pin function
Programmable I/O port, count source input or pulse output
Read from timer
Count value can be read out by reading timer Xi register
Write to timer
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)
Select function
Free-run count function
Even when the timer underflows, the reload register content is not reloaded to it
Pulse output function
Each time the timer underflows, the TXi
INOUT
pin’s polarity is reversed
Note: This does not apply when the free-run function is selected.
Count operation
Divide ratio
Count start condition
Count stop condition
(2) Event counter mode
In this mode, the timer counts an external signal or an internal timer’s overflow. (See Table 1.22.) Figure
1.61 shows the timer Xi mode register in event counter mode.
Table 1.22.
Timer specifications in event counter mode (when not processing two-phase pulse signal)
Figure 1.61. Timer Xi mode register in event counter mode
Timer Xi mode register
Note 1: Count source is selected by event/trigger select bit(address 0383
16
) in event counter mode.
Note 2: Set the corresponding port direction register to “1” (output mode). TXi
INOUT
pin input is not
selected as count source when pulse output function is selected.
Note 3: This bit is valid when only counting an external signal.
Symbol
TXiMR(i = 0 to 2) 0397
16
to 0399
16
Address
When reset
00
16
b7
b6
b5
0
b4 b3
b2
b1
0 1
b0
Operation mode select bit
0 1 : Event counter mode
(Note 1)
b1 b0
TMOD0
TMOD1
MR0
Pulse output function
select bit
0 : Pulse is not output
(TXi
INOUT
pin is a normal port pin)
1 : Pulse is output (Note 2)
(TXi
INOUT
pin is a pulse output pin)
Count polarity
select bit (Note 3)
MR2
MR1
MR3
0 (Must always be fixed to “0” in event counter mode)
TCK0
Count operation type
select bit
0 : Counts external signal's falling edge
1 : Counts external signal's rising edge
0 : Reload type
1 : Free-run type
Bit symbol
Bit name
Function
TCK1
AA
AA
AA
AA
AA
AA
AA
AA
Invalid in event counter mode.
Can be “0” or “1”.
Invalid in event counter mode.
Can be “0” or “1”.