132
CHAPTER 4 I/O PORT
4.9.2
Operation of Port 7
This section describes the operations of port 7.
I
Operation of Port 7
H
Operation as an output port
If "1" is set to the corresponding DDR7 register bit, the port becomes an output port.
The operation of the output transistor is allowed when port 7 operates as an output port and
data of the output latch is output to the pins.
If data is written into the PDR7 register, the data is retained on the output latch and then
output directly to the pins.
Pin values can be read by reading the PDR7 register.
H
Operation as an input port
If "0" is set to the corresponding DDR7 register bit, the port becomes an input port.
The output transistor is "OFF" and the pins are in high impedance when port 7 operates as
an input port.
If data is written into the PDR7 register, the data is retained on the output latch but is not
output to the pins.
Pin values can be read by reading the PDR7 register.
H
Operation during comparator input
Set the operation enable bit of the comparator to use port 7 for comparator input.
H
Operation during a reset
If CPU is reset, the value of the DDR7 register is initialized to "0". Thus, the output transistor
is turned "OFF" (input port) and the pins are put into high impedance.
The PDR7 register is not initialized by a reset. Thus, to use port 7 as an output port, data
must be output to the PDR7 register and the output must be set to the corresponding DDR7
register.
The CIER register is initialized to "1" by a reset. Thus, to use port 7 for port input, "0" must
be set to the corresponding bit of the CIER 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, prohibition of the port input occurs
regardless of the value of the DDR7 register and the pins are put into high impedance. The
input is fixed to prevent leakage due to input opening.