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
l
w
a
y
s
0
.
)
0
1
:
:
T
T
i
m
e
e
r
0
i
m
r
1
N
o
t
i
m
p
l
e
m
e
n
t
e
d
,
r
e
a
d
a
s
"
0
"
System Control Register - CTRL0
b
7
b
0
I
N
T
E
S
1
I
N
T
E
S
0
W
D
T
E
N
3
W
D
T
E
N
2
W
D
T
E
N
1
W
D
T
E
N
0
S
y
s
t
e
m
C
o
n
t
r
o
l
R
e
g
i
s
t
e
r
C
T
R
L
1
W
D
T
f
u
n
c
t
i
o
n
I
O
I
O
d
i
s
a
b
l
e
X
X
X
X
o
t
h
e
r
v
a
l
u
e
s
-
e
n
a
b
l
e
N
o
t
i
m
p
l
e
m
e
n
t
e
d
,
r
e
a
d
a
s
"
0
"
E
x
t
e
r
n
a
l
i
n
t
e
r
r
u
p
t
e
d
g
e
t
r
i
g
g
e
r
t
y
p
e
I
N
T
E
S
1
I
N
T
E
S
0
0
0
1
1
0
1
0
1
d
i
s
s
a
b
g
l
e
r
i
i
l
n
i
e
d
g
e
t
r
i
g
i
g
e
r
f
d
a
l
n
g
e
d
g
e
t
r
g
g
e
r
u
a
l
e
d
g
e
t
r
i
g
g
e
r
System Control Register - CTRL1
Input/Output Ports
Holtek microcontrollers offer considerable flexibility on
their I/O ports. There are seven I/O pins whose input or
output designation is under user program control and an
additional input pin. Additionally, as there are pull-high
resistor and wake-up software configurations for each
pin, the user is provided with an I/O structure to meet the
needs of a wide range of application possibilities.
Pull-high Resistors
Many product applications require pull-high resistors for
their switch inputs usually requiring the use of an exter-
nal resistor. To eliminate the need for these external re-
sistors, I/O pins PA0~PA6, when configured as an input
have the capability of being connected to an internal
pull-high resistor. These pull-high resistors are
selectable via a register known as PAPU, located in the
Data Memory. The pull-high resistors are implemented
using weak PMOS transistors.
Each device has a single I/O port known as Port A,
which has a corresponding data register known as PA.
This register is mapped to the Data Memory with an ad-
dresses as shown in the Special Purpose Data Memory
table. Seven of these I/O lines can be used for input and
output operations and one line as an input only. For in-
put operation, these ports are non-latching, which
means the inputs must be ready at the T2 rising edge of
instruction ²MOV A,[m]², where m denotes the port ad-
dress. For output operation, all the data is latched and
remains unchanged until the output latch is rewritten.
Port A Wake-up
If the HALT instruction is executed, the device will enter
the Power Down Mode, where the system clock will stop
resulting in power being conserved, a feature that is im-
portant for battery and other low-power applications.
Various methods exist to wake-up the microcontroller,
one of which is to change the logic condition on one of
Rev. 1.00
15
September 21, 2007