![](http://datasheet.mmic.net.cn/230000/7540_datasheet_15567442/7540_173.png)
7540 Group User
’
s Manual
2-98
APPLICATION
2.5 Timer Y and timer Z
Fig. 2.5.40 Example of control procedure
0
1
W
a
i
t
o
n
e
-
s
h
o
t
g
e
n
e
r
a
t
i
o
n
r
o
u
t
i
n
e
1
1
1
1
1
1
1
0
1
0
1 1
INT
0
rising edge active
1
T
i
m
e
r
Z
i
n
t
e
r
r
u
p
t
p
r
o
c
e
s
s
i
n
g
r
o
u
t
i
n
e
RTI
0
RTS
T
i
m
e
r
Z
p
r
i
m
a
r
y
(
A
d
d
r
e
s
s
2
7
1
6
)
Prescaler Z (Address 25
16
)
i
m
e
r
Z
s
e
c
o
n
Set pull-up control register
Set port P1P3 control register
TYZM(Address 20
16
)
T
m
e
r
Z
c
o
i
u
n
t
s
t
a
r
t
(
N
o
t
e
7
)
S
o
e
n
t
e
t
-
h
s
e
h
o
s
t
t
a
s
n
t
a
d
r
b
t
y
t
r
i
s
g
t
g
a
t
e
r
t
o
a
c
c
e
p
t
e
IN
T
E
D
G
E
(
A
d
d
r
e
s
s
3
A
1
6
)
S
e
t
i
n
t
e
r
r
u
p
t
e
d
g
e
s
e
l
e
c
t
i
o
n
r
e
g
i
s
t
e
r
Change of timer Z
Timer Z primary waveform
generation not extended (
Note 2
)
Timer Z secondary waveform
generation not extended (
Note 2
)
Initial state: TZP:
“
H
”
interval,
TZS:
“
L
”
interval after underflow
Stop at
“
H
”
after underflow
INT
0
pin one-shot trigger valid (
Note 3
)
INT
0
pin rising edge trigger (
Note 3
)
PUM(Address 24
16
)
T
i
C
S
S
(
A
d
d
r
e
s
s
2
E
1
6
)
T
m
e
r
Z
c
o
u
n
t
s
o
u
r
c
e
s
e
l
e
c
t
e
d
S
e
t
p
o
r
t
P
0
2
t
o
t
h
e
o
u
t
p
u
t
m
o
d
e
.
S
e
t
“
0
”
(
t
T
o
m
t
h
e
e
t
Z
i
m
e
n
r
t
Z
r
i
n
p
t
e
t
r
d
r
i
u
s
p
a
t
b
e
l
e
n
d
a
)
b
l
e
b
i
t
.
i
r
i
e
r
u
S
e
t
v
a
l
u
e
t
o
t
i
m
e
r
Z
(
N
o
t
e
s
2
,
4
,
5
,
6
)
S
e
t
t
i
m
e
r
c
o
u
n
t
s
o
u
r
c
e
s
e
t
r
e
g
i
s
t
e
r
(
N
o
t
e
3
)
T
Programmable wait one-shot
generation mode
Writing to only latch (
Note 2
)
Timer Z count stop
Y
Z
M
(
A
d
d
r
e
s
s
2
0
1
6
)
S
e
t
t
i
m
e
r
Y
,
Z
m
o
d
e
r
e
g
i
s
t
e
r
S
e
t
“
1
”
(
t
T
o
i
t
h
e
e
t
i
m
Z
e
n
r
t
e
Z
r
r
i
u
n
t
e
t
r
e
r
u
n
p
a
t
b
e
l
e
n
d
a
)
b
l
e
b
i
t
.
m
r
i
p
S
e
t
“
0
”
t
o
t
h
e
i
m
e
r
Z
i
n
t
e
r
r
u
p
t
r
e
q
u
e
s
t
b
i
t
.
S
e
t
t
i
m
e
r
Y
,
Z
w
a
v
e
f
o
r
m
o
u
t
p
u
t
c
o
n
t
r
o
l
r
e
g
i
s
t
e
r
Set port P3
7
to the input mode.
Notes 1:
When using this mode, be sure to select
“
write to latch only
”
.
2:
The waveform extension function by the timer Z waveform
extension control bits can be used only when
“
00
16
”
is set to
prescaler Z.
When the value other than
“
00
16
”
is set to prescaler Z, be
sure to set
“
0
”
to EXPZP and EXPZS. Also, when the timer Y
underflow is selected as the timer Z count source, the
waveform extension function cannot be used.
3:
Stop timer Z to change the INT
0
pin one-shot trigger control
bit and INT
0
one-shot trigger active edge selection bit.
4:
In the programmable wait one-shot generation mode, values
of TZS, EXPZP, and EXPZS are valid by writing to TZP.
Even when changing TZP is not required, write the same
value again.
5:
In the programmable wait one-shot generation mode, when
the setting value is changed while the waveform is output, set
by software in order not to execute the writing to TZP and the
timing of timer Z underflow simultanesously.
6:
Count values of the primary interval (during wait) and
secondary interval (during one-shot output) can be checked
by reading TZP (TZS is undefined at read).
7:
In this state, timer count is not started.
T
d
a
r
y
(
A
d
d
r
e
s
s
2
6
1
6
)