![](http://datasheet.mmic.net.cn/230000/7540_datasheet_15567442/7540_97.png)
7540 Group User
’
s Manual
2-22
APPLICATION
2.2 Timer A
Fig. 2.2.13 Setting method for period measurement mode (1)
2.2.4 Period measurement mode
(1) Operation description
In the period measurement mode, the pulse period input from the P0
0
/CNTR
1
pin is measured.
CNTR
1
interrupt request is generated at rising/falling edge of CNTR
1
pin input signal. Simultaneously,
the value in the timer A latch is reloaded in Timer A and count continues. The active edge of CNTR
1
pin input signal can be selected from rising or falling by the CNTR
1
active edge switch bit. The count
value when trigger input from CNTR
1
pin is accepted is retained until Timer A is read once.
Timer A can stop counting by setting
“
1
”
to the timer A count stop bit.
Also, when Timer A underflows, the timer A interrupt request bit is set to
“
1
”
.
(2) Period measurement mode setting method
Figure 2.2.13 and Figure 2.2.14 show the setting method for period measurement mode of timer A.
b
7
b
0
0
b
1
7
b
0
1
0
b7
b0
b
7
b
0
0
b
7
b
0
0
P
r
o
c
e
s
s
1
:
D
i
s
a
b
l
e
t
i
m
e
r
A
i
n
t
e
r
r
u
p
t
a
n
d
C
N
T
R
1
i
n
t
e
r
r
u
p
t
.
In
t
e
r
r
u
p
t
c
o
n
t
r
o
l
r
e
g
i
s
t
e
r
1
(
I
C
O
N
1
)
[
A
d
d
r
e
s
s
3
E
1
6
]
C
N
T
R
1
i
n
t
e
r
r
u
p
t
d
i
s
a
b
l
e
d
P
o
r
t
P
0
d
i
r
e
c
t
i
o
n
r
e
g
i
s
t
e
r
(
P
0
D
)
[
A
d
d
r
e
s
s
0
1
1
6
]
S
e
t
t
h
e
P
0
0
/
C
N
T
R
1
p
i
n
t
o
t
h
e
i
n
p
u
t
m
o
d
e
P
r
o
c
e
s
s
2
:
S
e
t
t
h
e
C
N
T
R
1
p
i
n
t
o
t
h
e
i
n
p
u
t
m
o
d
e
.
In
t
i
e
r
r
u
p
t
c
o
n
t
r
o
l
r
e
g
i
s
t
e
r
2
(
I
C
O
N
2
)
[
A
d
d
r
e
s
s
3
F
1
6
]
T
m
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