5-16
MSM66577 Family User's Manual
Chapter 5 Port Functions
5.6
Port 2 (P2)
Port 2 is a 4-bit I/O port. Each individual bit can be specified as input or output by the port
2 mode register (P2IO). When output is specified (corresponding bits of P2IO = "1"), the
value of the corresponding bits in the port 2 data register (P2) will be output from their
appropriate pins.
In addition to its port function, P2 is assigned a secondary function (external memory
address output). If the secondary function is to be used, set the corresponding bits of the
port 2 mode register (P2IO) and the port 2 secondary function control register (P2SF) to "1".
If the port is specified as an input (corresponding bits of P2IO = "0") and the port 2 secondary
function control register (P2SF) is set to "1", the pin inputs corresponding to those bits will
be pulled-up.
Figure 5-9 shows the configuration of the port 2 data register (P2), port 2 mode register
(P2IO) and the port 2 secondary function control register (P2SF).
7
6
5
4
3
2
1
0
P2IO3
P2IO2
P2IO1
P2IO0
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
P2_3
P2_2
P2_1
P2_0
000
0
00
0
0/1
0
0/1
XDM19
P2SF3
XDM18
P2SF2
—
——
—
——
XDM17
P2SF1
XDM16
P2SF0
0
Not pulled-up
P2_0 input
Primary function
P2_0 output
1
Pulled-up
Secondary function Address 16 output
Not pulled-up
P2_1 input
Primary function
P2_1 output
Pulled-up
Secondary function Address 17 output
Not pulled-up
P2_2 input
Primary function
P2_2 output
Pulled-up
Secondary function Address 18 output
Not pulled-up
P2_3 input
Primary function
P2_3 output
Pulled-up
Secondary function Address 19 output
0
1
0
1
0
1
0 (Input setting)
1 (Output setting)
Address:
R/W access:
002A [H]
R/W
P2IO
At reset
(EA = H/L)
P2SF
At reset
(EA = H/L)
P2
At reset
Address:
R/W access:
0022 [H]
R/W
Address:
R/W access:
001A [H]
R/W
"—" indicates a bit that does not exist. If read, the value will be "0."
Figure 5-9 P2, P2IO, P2SF Configuration