86
TimerB
M
i
t
s
u
M
S
b
i
s
3
M
h
0
I
C
i
m
2
R
i
1
O
c
r
8
C
o
c
o
G
M
m
p
r
P
u
t
u
T
e
r
p
R
s
o
U
S
I
N
G
L
E
-
C
H
I
P
1
6
-
B
I
T
C
M
O
O
E
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 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.)
TBi
IN
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
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.
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 23.)
Figure 71 shows the timer Bi mode register in pulse period/pulse width measurement mode. Figure 72
shows the operation timing when measuring a pulse period. Figure 73 shows the operation timing when
measuring a pulse width.
Table 23. Timer specifications in pulse period/pulse width measurement mode
Figure 71. Timer Bi mode register in pulse period/pulse width measurement mode
T
7
i
m
e
r
5
B
i
4
m
o
3
d
e
2
r
e
1
1
g
i
s
0
0
t
e
r
S
T
y
m
i
M
b
o
R
l
A
d
6
d
t
r
o
e
s
0
s
3
W
0
h
X
e
X
n
r
0
e
s
0
e
0
2
t
B
(
i
=
0
t
o
2
)
0
3
9
B
1
9
D
1
6
0
0
B
i
t
n
a
m
e
B
i
M
t
s
y
m
b
o
l
W
R
b
b
6
b
b
b
b
b
b
O
s
p
e
e
e
r
c
a
t
t
b
i
o
i
n
t
m
o
d
e
l
1
0
:
P
u
l
s
e
p
e
r
i
o
d
/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