9.3.1
Port 0 Registers (PDR0, DDR0 and RDR0)
This section describes the port 0 registers.
■ Functions of Port 0 Registers
●
Port 0 data register (PDR0)
The PDR0 register indicates the state of each pin of port 0.
●
Port 0 data direction register (DDR0)
The DDR0 register specifies the direction of a data flow (input or output) at each pin (bit) of port 0. When
a DDR0 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.
●
Port 0 pull-up resistor setting register (RDR0)
The RDR0 register specifies the selection of a pull-up resistor at each pin (bit) of port 0. When a RDR0
register bit is "1", a pull-up resistor is selected for the corresponding port (pin). When the bit is "0", the
pull-up resistor is deselected.
Notes:
• When a resource having output pins is used, the port functions as resource output pins regardless
of the value in the DDR0 register as long as the resource output enable bit corresponding to the
pins is set.
• To use a resource having input pins, reset the port direction register bit corresponding to each
resource input pin to "0" to place the port in input mode.
CHAPTER 9 I/O PORT
169