5-22
MSM66573 Family User's Manual
Chapter 5 Port Functions
5.9
Port 5 (P5)
Port 5 is a 4-bit I/O port. Each individual bit can be specified as input or output by the port
5 mode register (P5IO). When output is specified (corresponding bits of P5IO = "1"), the
value of the corresponding bits in the port 5 data register (P5) will be output from their
appropriate pins.
In addition to its port function, P5 is assigned secondary functions (such as capture/
compare I/O). If a secondary function output is to be used, set the corresponding bits of
the port 5 mode register (P5IO) and the port 5 secondary function control register (P5SF)
to "1". If a secondary function input is to be used, reset the corresponding bits of the port
5 mode register (P5IO) to "0" to configure the input mode (same input as the primary
function input).
If the port is specified as an input (corresponding bits of P5IO = "0") and the port 5 secondary
function control register (P5SF) is set to "1", the pin inputs corresponding to those bits will
be pulled-up.
If bit 7 of port 5 is set to secondary function output (P5IO7 = 1, P5SF7 = 1), the output will
be fixed at "0", regardless of the value of the port 5 data register.
Figure 5-12 shows the configuration of the port 5 data register (P5), port 5 mode register
(P5IO) and the port 5 secondary function control register (P5SF).
7
6
5
4
3
2
1
0
P5IO6
P5IO5
P5IO4
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
P5_7
P5_6
P5_5
P5_4
000
0
00
0
00
000
0
P5SF7
PTM0OUT
P5SF6
—
——
—
——
CPCM1
P5SF5
CPCM0
P5SF4
P5IO7
0
Not pulled-up
P5_4 input
Capture 0 input
Primary function
P5_4 output
1
Pulled-up
Secondary function Compare 0 output
Not pulled-up
P5_5 input
Capture 1 input
Primary function
P5_5 output
Pulled-up
Secondary function Compare 1 output
Not pulled-up
P5_6 input
Primary function
P5_6 output
Pulled-up
Secondary function Timer 0 output
Not pulled-up
P5_7 input, timer 0
External event input
Primary function
P5_7 output
Pulled-up
Secondary function
0 output*
0
1
0
1
0
1
0 (Input setting)
1 (Output setting)
Address:
R/W access:
002D [H]
R/W
P5IO
At reset
P5SF
At reset
P5
At reset
Address:
R/W access:
0025 [H]
R/W
Address:
R/W access:
001D [H]
R/W
0 output*: "0" is output, regardless of the value of the port data register
"—" indicates a bit that does not exist. If read, the value will be "0."
Figure 5-12 P5, P5IO, P5SF Configuration