Unde
Timer X
deeopmen
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
71
Item
Specification
Count source
Count operation
f
1
, f
8
, f
32
, f
c32
Up count
Counter value “0000
16
” is transferred to reload register at measurement
pulse's effective edge and the timer continues counting
Count start flag is set (= 1)
Count start flag is reset (= 0)
Interrupt request generation timing
When measurement pulse's effective edge is input
(Note 1)
When an overflow occurs. (Simultaneously, the timer Xi overflow flag
changes to “1”. The timer Xi overflow flag changes to “0” when the count
start flag is “1” and a value is written to the timer Xi mode register.)
TXi
INOUT
pin function
Measurement pulse input
Read from timer
When timer Xi register is read, it indicates the reload register’s content
(measurement result)
(Note 2)
Write to timer
Cannot be written to
Note 1:
An interrupt request is not generated when the first effective edge is input after the timer has started counting.
Note 2:
The value read out from the timer Xi register is indeterminate until the second effective edge is input after the timer.
Count start condition
Count stop condition
(4) Pulse period/pulse width measurement mode
In this mode, the timer measures the pulse period or pulse width of an external signal. (See Table 1.24.)
Figure 1.63 shows the timer Xi mode register in pulse period/pulse width measurement mode. Figure
1.64 shows the operation timing when measuring a pulse period. Figure 1.65 shows the operation timing
when measuring a pulse width.
Table 1.24. Timer specifications in pulse period/pulse width measurement mode
Figure 1.63. Timer Xi mode register in pulse period/pulse width measurement mode
Bit name
Bit symbol
W
R
b7
b6
b5
1
b4
b3 b2
b1
1
b0
0
Operation mode
select bit
b1 b0
1 0 : One-shot timer mode or pulse period /
pulse width measurement mode
TMOD1
TMOD0
MR0
Measurement mode
select bit
MR1
MR3
TCK1
TCK0
0 0 : Pulse period measurement (Interval between
measurement pulse's falling edge to falling edge)
0 1 : Pulse period measurement (Interval between
measurement pulse's rising edge to rising edge)
1 0 : Pulse width measurement (Interval between
measurement pulse's falling edge to rising edge,
and between rising edge to falling edge)
1 1 : Inhibited
Function
b3 b2
Count source
select bit
Timer Xi overflow
flag (Note)
0 : Timer did not overflow
1 : Timer has overflowed
1
0 1 : f
8
1 0 : f
32
1 1 : f
C32
b7 b6
Note: The timer Xi overflow flag changes to “0” when the count start flag is “1” and a value is written to
the timer Xi mode register. This flag cannot be set to “1” by software.
AA
AA
A
A
AA
AA
AA
Timer Xi mode register
Symbol
TXiMR(i = 0 to 2) 0397
16
to 0399
16
Address
When reset
00
2
MR
2
1 (Must always be “1” in pulse period / pulse width measurement mode)
AA