Chapter 4 I/O Ports
IV - 26
Port 6
4-6 Port 6
4-6-1 Description
General port Setup
Each bit of the port 6 control I/O direction register (P6DIR) can be set individually to set pins as input or
output. The control flag of the port 6 direction control register (P6DIR) is set to "1" for output mode, and
"0" for input mode.
To read input data of pin, set the control flag of the port 6 direction control register (P6DIR) to "0" and
read the value of the port 6 input register (P6IN).
To output data to pin, set the control flag of the port 6 direction control register (P6DIR) to "1" and write
the value of the port 6 output register (P6OUT).
Each bit can be set individually whether pull-up resistor is added or not, by the port 6 pull-up resistor control
register (P6PLU). Set the control flag of the port 6 pull-up resistor control register (P6PLU) to "1" to add pull-
up resistor.
Special Function Pin Setup
P60 to P67 are used as input pin for the key interrupt, as well. Each bit can be set individually as
synchronous output by the port 6 synchronous output control register (P6SYO). The port 6 synchronous
output control register (P6SYO) is set to "1" for synchronous output, and "0" for general port. The pin
control register (FLOAT) can select the event that generates synchronous output. When the bp1, bp0 of
the pin control register (FLOAT) is "00", the external interrupt 2 (IRQ2) is selected, "01" for the timer 7
interrupt, "10" for the timer2 interrupt, and "11" for the timer 1 interrupt.