
ML66517 Family User’s Manual
Chapter 5
Port Functions
5 – 22
5.9
Port 6 (P6)
Port 6 is an 8-bit I/O port.
Each individual bit can be specified as input or output by the port 6 mode register
(P6IO). When output is specified (corresponding bits of P6IO = “1”), the value of the corresponding bits in the
port 6 data register (P6) will be output from their appropriate pins.
In addition to its port function, P6 is assigned secondary functions (such as external interrupt input).
If the
secondary function output is to be used, set the corresponding bits of the port 6 mode register (P6I0) and the port
6 secondary function control register (P6SF) to “1”. If the secondary function input is to be used, reset the
corresponding bits of the port 6 mode register (P6IO) 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 P6IO = “0”) and the port 6 secondary function control register
(P6SF) is set to “1”, the pin inputs corresponding to those bits will be pulled-up.
If bits 0 to 4 and bit 6 of port 6 are set as a secondary function output (P6IOn = 1, P6SFn = 1), the output will be
fixed at “0”, regardless of the value of the port 6 data register.
Figure 5-11 shows the configuration of the port 6 data register (P6), port 6 mode register (P6IO) and the port 6
secondary function control register (P6SF).
Figure 5-11
P6, P6IO, P6SF Configuration
7
P6IO7
6
5
4
3
2
1
0
P6IO6
P6IO3
P6IO2
P6IO1
P6IO0
7
6
5
4
3
2
1
0
P6SF6
7
P6_7
6
5
4
3
2
1
0
P6_6
P6_3
P6_2
P6_1
P6_0
0
P6SF3
P6SF2
P6IO5
P6IO4
P6_5
P6_4
P6SF4
P6SF1
P6SF0
0
Not pulled-up
P6_0 input
External interrupt
0 input
Primary function
P6_0 output
1
Pulled-up
0 output*
Not pulled-up
P6_1 input
External interrupt
1 input
Primary function
P6_1 output
Pulled-up
0 output*
Not pulled-up
P6_2 input
External interrupt
2 input
Primary function
P6_2 output
Pulled-up
0 output*
Not pulled-up
P6_3 input
External interrupt
3 input
Primary function
P6_3 output
Pulled-up
0 output*
Not pulled-up
P6_4 input
Timer 1 external
event input
Primary function
P6_4 output
Pulled-up
0 output*
Not pulled-up
P6_5 input
Primary function
P6_5 output
Pulled-up
Timer 1 output
Not pulled-up
P6_6 input
Timer 2 external
event input
Primary function
P6_6 output
Pulled-up
0 output*
Not pulled-up
P6_7 input
Primary function
P6_7 output
Pulled-up
Timer 2 output
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0 (Input setting)
1 (Output setting)
P6IO
At reset
P6SF
At reset
P6
At reset
Address: 002E [H]
R/W access: R/W
Address: 0026 [H]
R/W access: R/W
Address: 001E [H]
R/W access: R/W
0 output*: “0” is output, regardless of the value of the port data register
PTM1OUT
PTM2OUT
P6SF7
P6SF5
Secondary function