121
4.7 Port 5
4.7.2
Operation of Port 5
This section describes the operations of port 5.
I
Operation of Port 5
H
Operation as an output port
If "1" is set to the corresponding DDR5 register bit, the port becomes an output port.
The operation of the output transistor is allowed when port 5 operates as an output port and
data of the output latch is output to the pins.
If data is written into the PDR5 register, the data is retained on the output latch and then
output directly to the pins.
Pin values can be read by reading the PDR5 register.
H
Operation as an input port
If "0" is set to the corresponding DDR5 register bit, the port becomes an input port.
The output transistor is "OFF" and the pins are in high impedance when port 5 operates as
an input port.
If data is written into the PDR5 register, the data is retained on the output latch but is not
output to the pins.
Pin values can be read by reading the PDR5 register.
H
Operation during resource output
If the operation enable bit of a resource is set, the corresponding pin becomes ready for
resource output. Since the resource output takes precedence, settings of the DDR5 register
corresponding to the resource output pins have no significance.
Because the pin values can be read through the PDR5 register even when resource output
is allowed, output values of the resource can be read.
H
Operation during a reset
If CPU is reset, the bit values of the DDR5 register are initialized to "0". Thus, the output
transistor is turned "OFF" (input port) and the pins are put into high impedance.
The bits of the PDR5 register are not initialized by a reset. Thus, if port 5 is used as an
output port, it is necessary to set output data to the PDR5 register and then set output to the
corresponding DDR5 register.
H
Operation in stop mode and watch mode
If the pin state designate bit (STBC: SPL) of the standby control register is set to "1" when a
transition to the stop mode or watch mode occurs, the pins are put into high impedance
because the output transistor is forced "OFF" regardless of the value of the DDR5 register. The
input is fixed to prevent leakage due to input opening.