![](http://datasheet.mmic.net.cn/280000/M30623MAA-2MGP_datasheet_16083420/M30623MAA-2MGP_80.png)
Timer B
Mitsubishi microcomputers
M16C / 62A Group (80-pin)
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
80
Timer B
Figure 1.13.14 shows the block diagram of timer B. Figures 1.13.15 and 1.13.16 show the timer B-related
registers. However, timer B1 is used for internal timer since timer B1 does not have input port.
Use the timer Bi mode register (i = 0 to 5) bits 0 and 1 to choose the desired mode.
Timer B has three operation modes listed as follows:
Timer mode: The timer counts an internal count source.
Event counter mode: The timer counts pulses from an external source or a timer overflow.
Pulse period/pulse width measuring mode: The timer measures an external signal's pulse period or
pulse width.
Figure 1.13.14. Block diagram of timer B
Timer Bi mode register
Symbol
TBiMR(i = 0 to 5) 039B
16
to 039D
16
Address
When reset
00XX0000
2
00XX0000
2
035B
16
to 035D
16
Bit name
Function
Bit symbol
TMOD0
b7
b6
b5
b4
b3
b2
b1
b0
0 0 : Timer mode
0 1 : Event counter mode
1 0 : Pulse period/pulse width
measurement mode
1 1 : Inhibited
b1 b0
TCK1
MR3
MR2
MR1
TMOD1
MR0
TCK0
Function varies with each operation mode
Count source select bit
(Function varies with each operation mode)
Operation mode select bit
(Note 2)
Note 1: Timer B0, timer B3.
Note 2: Timer B1, timer B2, timer B4, timer B5.
Note 3: Do not set this mode since timer B1 does not have input port.
AA
AAA
AAA
AA
A
A
AAA
AA
A
(Note 3)
Clock source selection
(address 0380
16
)
Event counter
Timer
Pulse period/pulse width measurement
Reload register (16)
Low-order 8 bits
High-order 8 bits
Data bus low-order bits
Data bus high-order bits
f
1
f
8
f
32
f
C32
TBj overflow
(j = i – 1. Note, however,
j = 2 when i = 0,
j = 5 when i = 3)
Can be selected in only
event counter mode
Count start flag
Polarity switching
and edge pulse
TBi
IN
(i = 0 to 5)
Counter reset circuit
Counter (16)
TBi Address
Timer B0 0391
16
0390
16
Timer B1 0393
16
0392
16
Timer B2 0395
16
0394
16
Timer B1
Timer B3 0351
16
0350
16
Timer B4 0353
16
0352
16
Timer B5 0355
16
0354
16
Timer B4
TBj
Timer B2
Timer B0
Timer B5
Timer B3
Note: TB1
IN
does not connect to outside. Thus, do not select the function using this pin.
Figure 1.13.15. Timer B-related registers (1)