
ML66517 Family User’s Manual
Chapter 5
Port Functions
5 – 12
5.4
Port 0 (P0)
Port 0 is an 8-bit I/O port. Each individual bit can be specified as input or output by the port 0 mode register
(P0IO).
When output is specified (corresponding bits of P0IO = “1”), the value of the corresponding bits in the
port 0 data register (P0) will be output from their appropriate pins.
In addition to its port function, P0 is assigned a secondary function (external memory data I/O and address
output).
If the secondary function is to be used, set the corresponding bits of the port 0 mode register (P0IO)
and the port 0 secondary function control register (P0SF) to “1”.
If the port is specified as an input (corresponding bits of P0IO = “0”) and the port 0 secondary function control
register (P0SF) is set to “1”, the pin inputs corresponding to those bits will be pulled-up.
Figure 5-6 shows the configuration of the port 0 data register (P0), port 0 mode register (P0IO) and the port 0
secondary function control register (P0SF).
Figure 5-6
P0, P0IO, P0SF Configuration
7
P0IO7
6
5
4
3
2
1
0
P0IO6
P0IO3
P0IO2
P0IO1
P0IO0
0
Not pulled-up
P0_0 input
P0_0 output
1
Pulled-up
Not pulled-up
P0_1 input
P0_1 output
Pulled-up
Data 1 I/O/
Not pulled-up
P0_2 input
P0_2 output
Pulled-up
Data 2 I/O/
Not pulled-up
P0_3 input
P0_3 output
Pulled-up
Data 3 I/O/
Not pulled-up
P0_4 input
P0_4 output
Pulled-up
Data 4 I/O/
Not pulled-up
P0_5 input
P0_5 output
Pulled-up
Data 5 I/O/
Not pulled-up
P0_6 input
P0_6 output
Pulled-up
Data 6 I/O/
Not pulled-up
P0_7 input
P0_7 output
Pulled-up
Data 7 I/O/
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0 (Input setting)
1 (Output setting)
P0IO
At reset
(
EA = H/L)
7
6
5
4
3
2
1
0
XAD6
P0SF6
P0SF
At reset
(
EA = H/L)
7
P0_7
6
5
4
3
2
1
0
P0_6
P0_3
P0_2
P0_1
P0_0
P0
At reset
0
0 / 1
XAD3
P0SF3
XAD2
P0SF2
P0IO5
P0IO4
P0_5
P0_4
XAD7
P0SF7
XAD5
P0SF5
XAD4
P0SF4
XAD1
P0SF1
XAD0
P0SF0
Address: 0018 [H]
R/W access: R/W
Address: 0020 [H]
R/W access: R/W
Address: 0028 [H]
R/W access: R/W
Primary function
Secondary function
Primary function
Secondary function
address 0 output
address 1 output
address 2 output
address 3 output
address 4 output
address 5 output
address 6 output
address 7 output
Data 0 I/O/