204
CHAPTER 8 I/O PORTS
8.9.1
Port 6 Registers (PDR6 and DDR6)
This section describes the port 6 registers.
s Functions of Port 6 Registers
r Port 6 data register (PDR6)
The PDR6 register specifies the output value of each pin of Port 6.
r Port 6 data direction register (DDR6)
The DDR6 register specifies the direction of a data flow (input or output) at each pin (bit) of port
6. When a DDR6 register bit is 1, the corresponding port (pin) is set as an output port. When
the bit is 0, the port (pin) is set as an input port.
Reference:
To use a port pin as an output pin of the resource function, set the resource output enable bit
corresponding to the output pin to Enabled. Then, the pin can be used as an output pin of
the resource function regardless of the setting value in the DDR6 register.
To use a port pin as an input pin of the resource function, set the DDR6 bit corresponding to
the input pin to "0" to set it as an input port.
Table 8.9-3 Port 6 Register Functions
Register
Bit
value
During reading
During writing
Address
Initial value
Input port
Output port
Input port
Output port
Port 6
data
register
(PDR6)
0
The pin is at
the "L" level.
The
correspondi
ng bit of
PDR6
register is
set to "0".
"0" is written
to the
correspondi
ng bit of
PDR6
register.
The "L" level
is output
from the pin.
000006H
XXXXXXXXB
1
The pin is at
the "H" level.
The
correspondi
ng bit of
PDR6
register is
set to "1".
"1" is written
to the
correspondi
ng bit of
PDR6
register.
The "H"
level is
output from
the pin.
Port 6
data
direction
register
(DDR6)
0
The corresponding bit of
DDR6 register is set to "0".
The pin serves as an input
port.
000016H
XXXX0000B
1
The corresponding bit of
DDR6 register is set to "1".
The pin serves as an output
port.
X: Undefined