
ML66517 Family User’s Manual
Chapter 5
Port Functions
5 – 20
5.8
Port 5 (P5)
Port 5 is a 2-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 timer 0 timer output). 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-10 shows the configuration of the port 5 data register (P5), port 5 mode register (P5IO) and the port 5
secondary function control register (P5SF).
Figure 5-10
P5, P5IO, P5SF Configuration
7
6
5
4
3
2
1
0
P5IO6
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
P5_7
P5_6
0
P5SF7
P5SF6
P5IO7
Not pulled-up
P5_6 input
Primary function
P5_6 output
Pulled-up
Timer 0 output
Not pulled-up
Primary function
P5_7 output
Pulled-up
0 output*
0
1
0
1
0 (Input setting)
1 (Output setting)
Address: 002D [H]
R/W access: R/W
P5IO
At reset
P5SF
At reset
P5
At reset
Address: 0025 [H]
R/W access: R/W
Address: 001D [H]
R/W access: 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”.
PTM0OUT
P5_7 input, timer 0
Secondary function
External event input