
193
8.7 Port 4
8.7.1
Port 4 Registers (PDR4 and DDR4)
This section describes the port 4 registers.
s Functions of Port 4 Registers
r Port 4 data register (PDR4)
The PDR4 register specifies the output value of each pin of Port 4.
r Port 4 data direction register (DDR4)
The DDR4 register specifies the I/O directions of pins of Port 4. A pin serves as an output port
when a bit corresponding to the pin is set to "1". A pin serves as an input port when a bit
corresponding to the pin is set to "0".
Reference:
To use a port pin as an output pin for a resource function, set the resource output enable bit
corresponding to the output pin to Enabled. The pin can be used as an output pin for a
resource function regardless of the setting value of the Port 4 direction register (DDR4).
To use a port pin as an input pin for a resource function, set the DDR4 bit corresponding to
the input pin "0" to set it as an input port.
Table 8.7-3 Port 4 Register Functions
Register
Bit
value
During reading
During writing
Address
Initial value
Input port
Output port
Input port
Output port
Port 4 data
register
(PDR4)
0
The pin is at
the "L"
level.
The
correspondi
ng bit of
PDR4
register is
set to "0".
"0" is written
to the
correspondi
ng bit of
PDR4
register.
The "L"
level is
output from
the pin.
000004H
XXXXXXXXB
1
The pin is at
the "H"
level.
The
correspondi
ng bit of
PDR4
register is
set to "1".
"1" is written
to the
correspondi
ng bit of
PDR4
register.
The "H"
level is
output from
the pin.
Port 4 data
direction
register
(DDR4)
0
The corresponding bit of
DDR4 register is set to "0".
The pin serves as an input
port.
000014H
X0000000B
1
The corresponding bit of
DDR4 register is set to "1".
The pin serves as an
output port.
X: Undefined