128
Table 7-1 Port Functions
Port
Description
Pins
Mode 1
Mode 3
Mode 5
Mode 6
Mode 7
Port 1
• 8-bit I/O port
• Can drive LEDs
P1
7
to P1
0
/
A
7
to A
0
Address output
pins (A
7
to A
0
)
Address output (A
7
to A
0
)
and generic input
DDR = 0:
generic input
DDR = 1:
address output
Generic
input/
output
Port 2
• 8-bit I/O port
• Input pull-up
• Can drive LEDs
P2
7
to P2
0
/
A
15
to A
8
Address output pins (A
15
to A
8
)
Address output (A
15
to
A
8
) and generic input
DDR = 0:
generic input
DDR = 1:
address output
Generic
input/
output
Port 3
• 8-bit I/O port
P3
7
to P3
0
/
D
7
to D
0
Data input/output (D
7
to D
0
)
Generic
input/
output
Port 5
• 4-bit I/O port
• Input pull-up
• Can drive LEDs
P5
3
to P5
0
/
A
19
to A
16
Address output
(A
19
to A
16
)
Address output (A
19
to
A
16
) and 4-bit generic
input
DDR = 0:
generic input
DDR = 1:
address output
Generic
input/
output
Port 6
• 4-bit I/O port
P6
5
/
WR
,
P6
4
/
RD
,
P6
3
/
AS
Bus control signal output (
WR
,
RD
,
AS
)
Generic
input/
output
P6
0
/
WAIT
Bus control signal input/output (
WAIT
) and 1-bit
generic input/output
Port 7
• 8-bit Input
port
P7
7
to P7
0
/
AN
7
to AN
0
Analog input (AN
7
to AN
0
) to A/D converter, and generic input
Port 8
• 2-bit I/O port
• P8
1
and P8
0
have Schmitt
inputs
P8
1
/
IRQ
1
IRQ
1
input and 1-bit generic input
IRQ
1
and
IRQ
0
input
and generic
input/
P8
0
/
IRQ
0
IRQ
0
input and 1-bit generic input/output
output