205
8.9 Port 6
8.9.2
Operation of Port 6
This section describes the operation of port 6.
s Operation of Port 6
r Setting Port 6 as an output port in the Port 6 direction register (DDR6)
The value stored in the Port 6 data register (PDR6) is output to the Port 6 pin.
If the PDR6 register is read, the value stored in PDR6 register is output.
r Setting Port 6 as an input port in the Port 6 direction register (DDR6)
The Port 6 pin has high impedance.
If the Port 6 data register (PDR6) is set to a value, the value stored in the PDR6 register is
retained but not output to the pin.
If the PDR6 register is read, the pin input level ("0" for "L" or "1" for "H") is output.
Note:
If a read-modify-write instruction (such as the bit set instruction) is used to access the PDR6
register, no bit specified for output in the DDR6 register is affected. For a bit specified for
input in the DDR6 register, however, the pin input level is written to the PDR6 register.
Therefore, to change a bit specified for input to output, first write an output value to the
PDR6 register and then specify the DDR6 register as an output port.
r Port operation for resource output
To use a port pin as resource output, set the output enable bit of the resource to be used to
Enabled. Even if a pin that also serves as the DDR6 resource pin is set to "0", the resource can
be output as long as the resource output is enabled because resource output gets higher priority
than port output.
If a pin that also serves as the DDR6 resource pin is set to "0", set the
resource output to Enabled to read the output value of the resource
r Port operation for resource input
To use for resource input the I/O port pin that can also be used for resource input, set the
corresponding bit of the DDR6 register to "0".