
CHAPTER 4 PORT FUNCTIONS
User
’
s Manual U15862EJ3V0UD
262
4.4 Port Function Operation
Port operation differs according to the input/output mode setting, as follows.
4.4.1 Write operation to I/O port
(1) In output mode
A value is written to the output latch using the transfer instruction, and the contents of the output latch are
output from the pin.
Data that has been written once to the output latch is held until the next data is written to the output latch.
(2) In input mode
A value is written to the output latch using the transfer instruction. However, since the output buffer is OFF, the
pin status does not change.
Data that has been written once to the output latch is held until the next data is written to the output latch.
Caution
In the case of 1-bit memory manipulation instructions, the manipulation target is just one
bit, but the port is accessed in 8-bit units. Therefore, in the case of ports for which a
mixture of input/output is used, the output latch contents of pins specified as input other
than the target bit also become undefined.
4.4.2 Read operation from I/O port
(1) In output mode
The output latch contents are read using the transfer instruction. The output latch contents remain unchanged.
(2) In input mode
The pin status is read using the transfer instruction. The output latch contents remain unchanged.
4.4.3 Arithmetic operation with I/O ports
(1) In output mode
An arithmetic operation on the output latch contents is performed, the result is written to the output latch, and
the output latch contents are output from the pin.
Data that has been written once to the output latch is held until the next data is written to the output latch.
(2) In input mode
The output latch contents become undefined. However, since the output buffer is OFF, the pin status does not
change.
Caution
In the case of 1-bit memory manipulation instructions, the manipulation target is just one
bit, but the port is accessed in 8-bit units. Therefore, in the case of ports for which
input/output is used in mix, the output latch contents of pins specified for input other
than the target bit also become undefined.