
ML66525 Family User’s Manual
Chapter 5
Port Functions
5 - 24
5.8
Port 4 (P4)
Port 4 is an 8-bit I/O port.
Each individual bit can be specified as input or output by the port
4 mode register (P4IO).
When output is specified (corresponding bits of P4IO = “1”), the
value of the corresponding bits in the port 4 data register (P4) will be output from their
appropriate pins.
In addition to its port function, P4 is assigned a secondary function (external memory address
output).
If the secondary function is to be used, set the corresponding bits of the port 4 mode
register (P4IO) and the port 4 secondary function control register (P4SF) to “1”.
If the port is specified as an input (corresponding bits of P4IO = “0”) and the port 4 secondary
function control register (P4SF) is set to “1”, the pin inputs corresponding to those bits will be
pulled-up.
Figure 5-10 shows the configuration of the port 4 data register (P4), port 4 mode register
(P4IO) and the port 4 secondary function control register (P4SF).
7
P4IO7
6
5
4
3
2
1
0
P4IO6
P4IO3 P4IO2 P4IO1 P4IO0
0
1
P4IO
7
6
5
4
3
2
1
0
XDM6
P4SF6
P4SF
7
P4_7
6
5
4
3
2
1
0
P4_6
P4_3
P4_2
P4_1
P4_0
P4
At reset
00
0/1
XDM3
P4SF3
XDM2
P4SF2
0
1
0
1
0
1
0
1
0
1
P4IO5 P4IO4
P4_5
P4_4
XDM7
P4SF7
XDM5
P4SF5
XDM4
P4SF4
XDM1
P4SF1
XDM0
P4SF0
0
1
0
1
0/1
At reset
(EAn = H/L)
At reset
(EAn = H/L)
Address: 001C [H]
R/W access: R/W
Address: 0024 [H]
R/W access: R/W
Address: 002C [H]
R/W access: R/W
Not pulled-up
P4_0 input
Primary function
P4_0 output
Address 0 output
0 (Input setting)
1 (Output setting)
Pulled-up
Secondary function
Not pulled-up
P4_1 input
Primary function
P4_1 output
Address 1 output
Pulled-up
Secondary function
Not pulled-up
P4_2 input
Primary function
P4_2 output
Address 2 output
Pulled-up
Secondary function
Not pulled-up
P4_3 input
Primary function
P4_3 output
Address 3 output
Pulled-up
Secondary function
Not pulled-up
P4_4 input
Primary function
P4_4 output
Address 4 output
Pulled-up
Secondary function
Not pulled-up
P4_5 input
Primary function
P4_5 output
Address 5 output
Pulled-up
Secondary function
Not pulled-up
P4_6 input
Primary function
P4_6 output
Address 6 output
Pulled-up
Secondary function
Not pulled-up
P4_7 input
Primary function
P4_7 output
Address 7 output
Pulled-up
Secondary function
Figure 5-10
P4, P4IO, P4SF Configuration