![](http://datasheet.mmic.net.cn/30000/M30855FHTGP_datasheet_2359399/M30855FHTGP_194.png)
Page 171
4
9
4
f
o
5
0
2
,
1
0
.
l
u
J
3
0
.
1
.
v
e
R
3
0
1
0
-
7
3
0
B
9
0
J
E
R
15. Timer (Timer B)
)
T
5
8
/
C
2
3
M
,
5
8
/
C
2
3
M
(
p
u
o
r
G
5
8
/
C
2
3
M
15.2 Timer B
Figure 15.16 shows a block diagram of the timer B. Figures 15.17 to 15.19 show registers associated with
the timer B. The timer B supports the following three modes. The TMOD1 and TMOD0 bits in the TBiMR
register (i=0 to 5) determine which mode is used.
Timer mode : The timer counts an internal count source.
Event counter mode : The timer counts pulses from an external source or overflow and underflow of
another timer.
Pulse period/pulse width measurement mode : The timer measures pulse period or pulse width of an
external signal.
Table 15.8 lists TBiIN pin settings.
Figure 15.16 Timer B Block Diagram
Figure 15.17 TB0 to TB5 Registers
Select Clock Source
01: Event
Counter Mode
00: Timer Mode
01: Pulse Period/Pulse Width
Measurement Mode
Reload Register
8 low-order
bits
8 high-
order
bits
Low-order Bits of Data Bus
High-order Bits of Data Bus
f1
f8
f2n(1)
TBj Overflow
Signal(2,3)
TBiS
fc32
Polarity Switching
and Edge Pulse
TBiIN
Counter Reset Circuit
Counter
TBi
Address
TBj
Timer B0
035116 035016
Timer B2
Timer B1
035316 035216
Timer B0
Timer B2
035516 035416
Timer B1
Timer B3
031116 031016
Timer B5
Timer B4
031316 031216
Timer B3
Timer B5
031516 031416
Timer B4
TCK1 and
TCK0
00
01
10
11
TMOD1 and
TMOD0
TCK1
1
0
i=0 to 5
NOTES:
1. The CNT3 to CNT0 bits in the TCSPR register select no
division (n=0) or divide-by-2n (n=1 to 15).
2. Overflow signal or underflow signal.
3. j=i-1, except j=2 when i=0 j=5 when i=3
TCK1 and TCK0, TMOD1 and TMOD0 : Bits in the TBiMR Register
TBiS : Bits in the TABSR and the TBSR Register
Timer Bi Register(1) (i=0 to 5)
Symbol
Address
After Reset
TB0 to TB2
035116 - 035016, 035316 - 035216, 035516 - 035416
Indeterminate
TB3 to TB5
031116 - 031016, 031316 - 031216, 031516 - 031416
Indeterminate
RW
RO
Timer Mode
000016 to FFFF16
Event Counter
Mode
Pulse Period/Pulse
Width Measurement
Mode
Function
Setting Range
Mode
If setting value is n, a count source
is divided by n+1
If setting value is n, a count source
is divided by n+1(2)
A count source is incremented
between one valid edge and
another valid edge of TBiIN pulse
b15
b8 b7
b0
NOTES:
1. Use 16-bit data for reading and writing.
2. The TBi register counts how many pulse inputs are provided externally or how many times another
timer counter overflows and underflows.