deveopmen
Timer B
Preliminary Specifications REV.D
Specifications in this manual are tentative and subject to change.
Mitsubishi microcomputers
M16C/80 (100-pin version) group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
106
Item
Specification
Count source
Count operation
f1, f8, f32, fc32
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 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.)
TBiIN pin function
Measurement pulse input
Read from timer
When timer Bi register is read, it indicates the reload register’s content
(measurement result)
(Note 2)
Write to timer
Cannot be written to
Count start condition
Count stop condition
(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.3.)
Figure 1.14.6 shows the timer Bi mode register in pulse period/pulse width measurement mode. Figure
1.14.7 shows the operation timing when measuring a pulse period. Figure 1.14.8 shows the operation
timing when measuring a pulse width.
Table 1.14.3. Timer specifications in pulse period/pulse width measurement mode
Figure 1.14.6. Timer Bi mode register in pulse period/pulse width measurement mode
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.
Timer Bi mode register
Symbol
TBiMR(i = 0 to 5) 035B
16
to 035D
16
Address
When reset
00XX0000
2
00XX0000
2
031B
16
to 031D
16
Bit name
Bit symbol
W
R
b7
b6
b5
b4
b3
b2
b1
1
b0
0
Operation mode
select bit
1 0 : Pulse period / pulse width
measurement mode
b1 b0
TMOD1
TMOD0
MR0
Measurement mode
select bit
MR2
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
Nothing is assigned (i = 1, 2, 4, 5).
When write, set "0". When read, its content is indeterminate.
Count source
select bit
Timer Bi overflow
flag ( Note 1)
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 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. 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.
0 (Fixed to “0” in pulse period/pulse width measurement mode; i = 0, 3)
AAA
(Note 3)
AA
AAA
AAA
AAA
AAA
AAA
AAA