![](http://datasheet.mmic.net.cn/120000/ML66525-XXTB_datasheet_3559839/ML66525-XXTB_183.png)
Chapter 7
I/O Port
Ports
VII - 35
7.3.5
Description (Port 5)
■ General Port Setup
Each bit can be set individually as either an input or output by the port 5 I/O control register (P5DIR). The control
flag of the P5DIR is set to “1” for output mode, and to “0” for input mode.
To read input data of a pin, set the control flag of the P5DIR register to “0” and read the value of the port 5 input
register (P5IN).
To output data to a pin, set the control flag of the P5DIR register to “1”, and write data to the port 2 output register
(P5OUT).
Each bit can be set individually if pull-up resistor is added or not, by the port 5 pull-up control register (P5PLU).
Set the control flag of the P5PLU register to “1” to add the pull-up resistor.
■ Special Function Pin Setup
P51 is used as an I/O pin of timer 7 as well. Each bit can be selected individually as output mode by the port 5 out-
put mode register (P5MD). P51 outputs special function data when the control flag of the P5MD is“1”and is used
as an general port when it is “0”.
P52 to P57 are used as PWM0 output pins as well. Each bit can be selected individually as output mode by the
port 5 output mode register (P5MD). P52 to P57 output special function data when the control flag of the P5MD
is“1”and are used as general ports when it is “0”.
7.3.6
Description (Port 6)
■ General Port Setup
Each bit can be set individually as either an input or output by the port 6 I/O control register (P6DIR). The control
flag of the P6DIR is set to “1” for output mode, and to “0” for input mode.
To read input data of a pin, set the control flag of the P6DIR register to “0” and read the value of the port 6 input
register (P6IN).
To output data to a pin, set the control flag of the P6DIR register to “1” and write data to the port 6 output register
(P6OUT).
Each bit can be set individually if pull-up resistor is added or not, by the port 6 pull-up control register (P6PLU).
Set the control flag of the P6PLU register to “1” to add pull-up resistor.
■ Special Function Pin Setup
P62 to P67 are used as PWM1 output pins as well. Each bit can be selected individually as output mode by the
port 6 output mode register (P6MD). P62 to P67 output special function data when the control flag of the P6MD
is“1”and are used as general ports when it is “0”.