![](http://datasheet.mmic.net.cn/230000/7540_datasheet_15567442/7540_125.png)
7540 Group User’s Manual
2-50
APPLICATION
2.4 Timer X
Fig. 2.4.13 Setting method for pulse output mode (1)
2.4.4 Pulse output mode
(1) Operation description
In the pulse output mode, the waveform whose polarity is inverted each time timer X underflows is
output from the P1
4/
CNTR
0
pin.
The output level of CNTR
0
pin can be selected by the CNTR
0
active edge switch bit. When the CNTR
0
active edge switch bit is “0”, the output of CNTR
0
pin is started at “H” level. When this bit is “1”, the
output is started at “L” level.
Also, the inverted waveform of pulse output from CNTR
0
pin can be output from TX
OUT
pin by setting
“1” to the P0
3
/TX
OUT
output valid bit.
When using a timer in this mode, set the port P1
4
and P0
3
direction registers to output mode.
Timer X can stop counting by setting “1” to the timer X count stop bit.
Also, when Timer X underflows, the timer X interrupt request bit is set to “1”.
(2) Pulse output mode setting method
Figure 2.4.13 and Figure 2.4.14 show the setting method for pulse output mode of timer X.
b
7
b0
1
0
1
b
7
b
0
1
b
7
b
0
1
b
7
0
b
0
P
r
o
c
e
s
s
1
:
D
i
s
a
b
l
e
t
i
m
e
r
X
i
n
t
e
r
r
u
p
t
.
Interrupt control register 1 (ICON1) [Address 3E
16
]
i
e
r
X
i
n
t
e
r
r
u
p
t
d
i
s
a
b
l
e
d
T
m
P
o
r
t
P
1
d
i
r
e
c
t
i
o
n
r
e
g
i
s
t
e
r
(
P
1
D
)
[
A
d
d
r
e
s
s
0
3
1
6
]
S
e
t
t
h
e
P
1
4
/
C
N
T
R
0
p
i
n
t
o
t
h
e
o
u
t
p
u
t
m
o
d
e
P
r
o
c
e
s
s
3
:
S
e
t
t
h
e
C
N
T
R
0
p
i
n
t
o
t
h
e
o
u
t
p
u
t
m
o
d
e
.
P
r
o
c
e
s
s
2
:
S
e
t
t
i
m
e
r
X
m
o
d
e
r
e
g
i
s
t
e
r
.
Timer X mode register (TXM) [Address 2B
16
]
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
3
/
T
X
O
U
T
p
i
n
t
o
t
h
e
o
u
t
p
u
t
m
o
d
e
P
r
o
c
e
s
s
4
:
S
e
t
t
h
e
T
X
O
U
T
p
i
n
a
s
t
h
e
o
u
t
p
u
t
m
o
d
e
w
h
e
n
T
X
O
U
T
o
u
t
p
u
t
i
s
v
a
l
i
d
.
Pulse output mode
CNTR
0
active edge switch
0: Output is started at
“
H
”
level
1: Output is started at
“
L
”
level
Timer X count stop
P0
3
/TX
OUT
output
0: Output invalid (I/O port)
1: Output valid (inverted CNTR
0
output)