
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
7560 Group
16
I/O PORTS
Direction Registers
The I/O ports (ports P0, P1, P2, P4, P5, P6, P7
1
–
P7
7
) have direc-
tion registers. Ports P1
6
, P1
7
, P4, P5, P6, and P7
1
–
P7
7
can be set
to input mode or output mode by each pin individually. P0
0
–
P0
7
and P1
0
-P1
5
are respectively set to input mode or output mode in
a lump by bit 0 of the direction registers of ports P0 and P1 (see
Figure 13).
When
“
0
”
is set to the bit corresponding to a pin, that pin becomes
an input mode. When
“
1
”
is set to that bit, that pin becomes an
output mode.
If data is read from a port set to output mode, the value of the port
latch is read, not the value of the pin itself. A port set to input mode
is floating. If data is read from a port set to input mode, the value
of the pin itself is read. If a pin set to input mode is written to, only
the port latch is written to and the pin remains floating.
Port P3 Output Control Register
Bit 0 of the port P3 output control register (address 0007
16
) en-
ables control of the output of ports P3
0
–
P3
7
.
When the bit is set to
“
1
”
, the port output function is valid.
When resetting, bit 0 of the port P3 output control register is set to
“
0
”
(the port output function is invalid) and pulled up.
Fig. 13 Structure of port P0 direction register, port P1 direc-
tion register
Fig. 14 Structure of port P3 output control register
Ports P0
0
to P0
7
direction register
0 : Input mode
1 : Output mode
Not used (Undefined at reading)
(If writing to these bits, write
“
0
”
.)
Port P0 direction register
(P0D : address 0001
16
)
b
7
b0
Note:
In ports set to output mode, the pull-up control bit becomes
invalid and pull-up resistor is not connected.
Ports P1
0
to P1
5
direction register
0 : Input mode
1 : Output mode
Not used (Undefined at reading)
(If writing to these bits, write
“
0
”
.)
Port P1
6
direction register
Port P1
7
direction register
0 : Input mode
1 : Output mode
Port P1 direction register
(P1D : address 0003
16
)
b
7
b0
Ports P3
0
to P3
7
output control bit
0 : Output function is invalid (Pulled up)
1 : Output function is valid (No pull up)
Not used (Undefined at reading)
(If writing to these bits, write
“
0
”
.)
Port P3 output control register
(P3C : address 0007
16
)
b7
b0
N
o
t
e
:
I
n
0
3
c
,
8
1
o
p
1
i
n
(
6
)
n
s
b
)
e
i
c
s
t
t
t
e
s
h
e
t
0
i
s
d
t
,
.
o
1
b
s
t
e
o
b
g
f
e
m
s
e
c
e
g
m
n
m
t
e
s
o
n
u
t
i
t
n
p
o
v
u
u
a
t
t
l
p
i
d
b
u
y
s
e
n
e
n
d
g
a
p
m
b
u
e
l
e
l
n
-
t
e
u
o
g
p
u
i
r
t
p
t
e
s
u
r
i
s
t
t
(
o
e
a
n
d
r
a
d
i
s
b
r
l
e
s
o
b
s
t
i
t
s
t
a
r
s
e
e
n
,
i
o
e
l
n