Mitsubishi microcomputers
M16C / 6N0 / 6N1 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
103
Table 1.14.8. Timer specifications in pulse period/pulse width measurement mode
(3) 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.14.8.)
Figure 1.14.19 shows the timer Bi mode register in pulse period/pulse width measurement mode. Figure
1.14.20 shows the operation timing when measuring a pulse period. Figure 1.14.21 shows the operation
timing when measuring a pulse width.
Figure 1.14.19. Timer Bi mode register in pulse period/pulse width measurement mode
Item
Specification
Count source
f2, f8, f32, fc32
Count operation
Count start condition
Count start flag is set (= "1")
Count stop condition
Count start flag is reset (= "0")
Interrupt request
generation timing
TBiIN pin function
Measurement pulse input
Read from timer
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 Bi register is indeterminate until the second effective edge is input after the timer.
When measurement pulse’s effective edge is input (Note 1)
When an overflow occurs. (Simultaneously, the timer Bi overflow flag
changes to "1". The timer Bi overflow flag changes to "0" when the count
start flag is "1" and a value is written to the timer Bi mode register.)
Up count
Counter value "000016" is transferred to reload register at measurement
pulse’s effective edge and the timer continues counting
When timer Bi register is read, it indicates the reload register’s content
(measurement result) (Note 2)
1 0 : Pulse period / pulse width
measurement mode
Measurement mode
select bit
0 0 : Pulse period measurement
(Interval between measure-
ment pulse’s falling edge to
falling edge)
0 1 : Pulse period measurement
(Interval between measure-
ment pulse’s rising edge to
rising edge)
1 0 : Pulse width measurement
(Interval between measure-
ment pulse’s falling edge to
rising edge, and between
rising edge to falling edge)
1 1 : Must not be set
Count source
select bit
Timer Bi overflow
flag ( Note 1)
0 : Timer did not overflow
1 : Timer has overflowed
0 0 : f2
0 1 : f8
1 0 : f32
1 1 : fC32
b7 b6
Nothing is assigned (i = 1, 2, 4, 5).
This bit can neither be set nor reset. When read, its content is
indeterminate.
0 (Fixed to "0" in pulse period/pulse width measurement mode; i = 0, 3)
(Note 2)
(Note 3)
Timer Bi mode register
Symbol
Address
When reset
TBiMR(i = 0 to 5) 039B16 to 039D16
00XX00002
01DB16 to 01DD16
00XX00002
Bit name
Function
Bit symbol
W
R
b7
b6
b5
b4
b3
b2
b1
b0
b1 b0
TCK1
MR3
MR2
MR1
TMOD1
MR0
TMOD0
TCK0
Operation mode select bit
0
1
Note 1: It is indeterminate when reset.The timer Bi overflow flag changes to "0" when the
count start flag is "1" and a value is written to the timer Bi mode register. This flag
cannot be set to "1" by software.
Note 2: Timer B0, timer B3.
Note 3: Timer B1, timer B2, timer B4, timer B5.
Timer B