![](http://datasheet.mmic.net.cn/230000/7540_datasheet_15567442/7540_156.png)
7540 Group User
’
s Manual
APPLICATION
2-81
2.5 Timer Y and timer Z
Fig. 2.5.25 Setting method for programmable waveform generation mode (2)
b
7
b
0
1
0
1
b
7
b0
1
b
7
b
0
0
P
r
o
c
e
s
s
7
:
I
s
n
o
t
r
“
d
0
e
”
r
(
n
n
o
o
t
r
t
e
o
q
e
u
x
e
e
s
c
t
e
u
d
t
e
)
t
t
o
h
e
t
h
n
e
o
t
i
r
m
e
q
e
u
r
e
Y
s
t
n
e
d
t
e
r
i
r
n
u
t
e
p
r
t
r
u
r
e
p
q
t
u
p
e
r
s
o
c
e
b
s
i
t
s
.
i
n
g
,
e
i
t
In
t
e
r
r
u
p
t
r
e
q
u
e
s
t
r
e
g
i
s
t
e
r
2
(
I
R
E
Q
2
)
[
A
d
d
r
e
s
s
3
D
1
6
]
P
r
o
c
e
s
s
8
:
W
t
o
h
t
e
h
n
e
T
t
i
i
m
e
e
r
r
Y
n
i
n
t
t
e
r
r
r
r
u
u
p
p
t
t
e
i
s
n
a
u
b
s
l
e
e
d
b
,
i
s
t
.
e
t
“
1
”
(
i
n
t
e
r
r
u
p
t
e
n
a
b
l
e
d
)
m
Y
i
e
No timer Y interrupt request issued
Interrupt control register 2 (ICON2) [Address 3F
16
]
Timer Y interrupt enabled
T
i
m
e
r
Y
,
Z
m
o
d
e
r
e
g
i
s
t
e
r
(
T
Y
Z
M
)
[
A
d
d
r
e
s
s
2
0
1
6
]
T
i
m
e
r
Y
c
o
u
n
t
s
t
a
r
t
P
r
o
c
e
s
s
9
:
S
t
a
r
t
c
o
u
n
t
i
n
g
o
f
t
i
m
e
r
Y
.
b
7
b
0
0
Notes 1:
For Timer Z, f(X
IN
)/16, f(X
IN
)/2, or timer Y underflow can be selected.
However, when the timer Z waveform expansion function is used,
do not select the timer Y underflow for the timer Z count source.
2:
Set the ring oscillator oscillation to be enabled by bit 3 (ring oscillator
oscillation control bit) of CPU mode register.
P
r
o
c
e
s
s
6
:
S
e
t
t
h
e
c
o
u
n
t
v
a
l
u
e
t
o
t
i
m
e
r
Y
(
N
o
t
e
1
)
.
S
e
t
t
h
e
c
o
u
n
t
v
a
l
u
e
t
o
p
r
e
r
s
c
a
l
e
r
Y
,
t
i
m
e
r
Y
s
e
c
o
n
d
a
r
y
a
n
d
t
i
m
e
r
Y
p
r
i
m
a
r
y
Count value
Timer Y secondary (TYS) (Address 22
16
)
Count value
i
m
e
r
o
u
n
t
P
r
o
c
e
s
s
5
:
S
e
t
t
i
m
e
r
Y
c
o
u
n
t
s
o
u
r
c
e
(
N
o
t
e
1
)
.
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
(
T
C
S
S
)
[
A
d
d
r
e
s
s
2
E
1
6
]
Timer Y count source selection bits
b3 b2
0 0 : f(X
IN
)/16
0 1 : f(X
IN
)/2
1 0 : Ring oscillator output (
Note 2
)
1 1 : Not available
P
e
s
c
a
l
e
r
Y
(
P
R
E
Y
)
(
A
d
d
r
e
s
s
2
1
1
6
)
(
N
o
t
e
2
)
T
Y
p
r
i
m
a
r
y
(
T
Y
P
)
(
A
d
d
r
e
s
s
2
3
1
6
)
(
N
o
t
e
s
3
,
4
)
C
v
a
l
u
e
Notes
1:
In the programmable waveform generation mode, values of TYS,
EXPYP, and EXPYS are valid by writing to TYP. Even when
changing TYP is not required, write the same value again.
2:
When the timer Y waveform extension function is used, be sure to set
“
00
16
”
to prescaler Y.
3:
In the programmable waveform generation mode, when the setting
value is changed while the waveform is output, set by software in
order not to execute the writing to TYP and the timing of timer Y
underflow during the secondary interval simultanesously.
4:
Count values of the primary interval and secondary interval can be
checked by reading the TYP (TYS is undefined at read).