
ML66517 Family User’s Manual
Chapter 5
Port Functions
5 – 35
5.16 Port 16 (P16)
Port 16 is a 7-bit I/O port. Each individual bit can be specified as input or output by the port 16 mode register
(P16IO). When output is specified (corresponding bits of P16IO = “1”), the value of the corresponding bits in the
port 16 data register (P16) will be output from their appropriate pins.
In addition to its port function, P16 is assigned secondary functions (such as 3-phase PWMU output). If a
secondary function output is to be used, set the corresponding bits of the port 16 mode register (P16IO) and the
port 16 secondary function control register (P16SF) to “1”. If a secondary function input is to be used, reset
corresponding bits of the port 16 mode register (P16IO) to “0” to configure the input mode (same input as the
primary function input).
If the port is set as an input (corresponding bits of P16IO = “0”) and the port 16 secondary function control
register (P16SF) is set to “1”, the pin inputs corresponding to those bits will be pulled-up.
If bit 6 of port 16 is set as secondary function output (P16IO6 = 1, P16SF6 = 1), the output will be fixed at “0”,
regardless of the value of the port 16 data register.
Figure 5-18 shows the configuration of the port 16 data register (P16), port 16 mode register (P16IO) and the
port 16 secondary function control register (P16SF).
Figure 5-18
P16, P16IO, P16SF Configuration
7
6
5
4
3
2
1
0
P16IO3
P16IO5
P16IO2 P16IO1 P16IO0
7
6
5
4
3
2
1
0
PWMU
P16SF0
7
6
5
4
3
2
1
0
P16_3
P16_5
P16_2
P16_1
P16_0
0
PWMV
P16SF2
PWMUB
P16SF1
PWMW
P16SF4
PWMVB
P16SF3
P16SF6
P16IO6
P16_6
P16IO4
P16_4
0
Not pulled-up
Primary function P16_0 output
1
Pulled-up
Not pulled-up
P16_1 output
Pulled-up
PWMUB output
Not pulled-up
Primary function P16_2 output
Pulled-up
Not pulled-up
P16_3 output
Pulled-up
PWMVB output
Not pulled-up
P16_4 output
Pulled-up
PWMW output
Not pulled-up
P16_5 input
Primary function P16_5 output
Pulled-up
PWMWB output
Not pulled-up
P16_6 output
Pulled-up
0 output*
0
1
0
1
0
1
0
1
0
1
0
1
0 (Input setting)
1 (Output setting)
P16IO
At reset
P16SF
At reset
P16
At reset
Address: 00B4 [H]
R/W access: R/W
P16_4 input
Primary function
Address: 00B2 [H]
R/W access: R/W
Address: 00B0 [H]
R/W access: R/W
P16_1 input
Primary function
P16_3 input
Primary function
P16_2 input
Primary function
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”.
Secondary function
abnormality
detect input
P16_6 input,
PWMWB
P16_0 input
PWMU output
PWMV output
P16SF5