380
Programmable I/O Ports
M
i
t
s
u
M
S
b
i
s
3
M
h
0
I
C
i
m
2
R
i
1
O
c
r
8
C
o
c
o
G
M
m
p
r
P
u
t
u
T
e
r
p
R
s
o
U
S
I
N
G
L
E
-
C
H
I
P
1
6
-
B
I
T
C
M
O
O
E
2.15 Programmable I/O Ports
2.15.1 Overview
Forty-eight programmable I/O ports and forty high-breakdown-voltage output ports are available. I/O pins
also serve as I/O pins for built-in peripheral functions.
Each port has a direction register that defines the I/O direction and also has a port register for I/O data. In
addition, each port has a pull-up control register that defines pull-up in terms of 4 bits. Ports P2, P3, and
P4
0
–P4
3
are high-breakdown-voltage P-channel open-drain output structure. These ports have no pull-
up resistance.
The following is an overview of the programmable I/O ports:
(1) Writing to a port register
With the direction register set to output, the level of the written values from each relevant pin is output
by writing to a port register. The output level conforms to CMOS output or P-channel open-drain
output. “L” level of port which is built-in pull-down resistor is apply voltage to the V
EE
pin. Writing to the
port register, with the direction register set to input, inputs a value to the port register, but nothing is
output to the relevant pins. The output level remains floating.
(2) Reading a port register
With the direction register set to output, reading a port register takes out the content of the port regis-
ter, not the content of the pin. When the FLD controller is used, reading the port register takes out FLD
output. With the direction register set to input, reading the port register takes out the content of the pin.
(3) Exclusive high-breakdown-voltage output port
There are 40 exclusive output Ports: P0 to P2, P5 and P6.
All ports have structure of high-breakdown-voltage P-channel open drain output. Exclusive output
ports except P2 have built-in pull-down resistance.
(4) Setting pull-up
The pull-up control bit allows setting of the pull-up, in terms of 4 bits, either in use or not in use. For the
four bits chosen, pull-up is effective only in the ports whose direction register is set to input. Pull-up is
not effective in ports whose direction register is set to output.
Do not set pull-up of corresponding pin when X
CIN
/X
COUT
is set or a port is used as A-D input.