
CHAPTER 14 PORT FUNCTION
User’s Manual U13850EJ6V0UD
515
14.4 Port Function Operation
Port operation differs according to the input/output mode setting, as follows.
14.4.1 Write operation to I/O port
(1) In output mode
A value is written to the output latch using a transfer instruction, and the contents of the output latch are
output from the pin.
Once data has been written to the output latch, it 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 a transfer instruction. However, since the output buffer is OFF, the
pin status does not change.
Once data has been written to the output latch, it is held until the next data is written to the output latch.
Caution
A bit manipulation instruction (CLR1, SET1, NOT1) manipulates 1 bit but accesses a port in
8-bit units. If this instruction is executed to manipulate a port with a mixture of input and
output bits, the contents of the output latch of a pin set in the input mode, in addition to the
bit to be manipulated, are overwritten to the current input pin status and become undefined.
14.4.2 Read operation from I/O port
(1) In output mode
The output latch contents are read using a transfer instruction. The output latch contents remain unchanged.
(2) In input mode
The pin status is read using a transfer instruction. The output latch contents remain unchanged.