CHAPTER 4 PORT FUNCTIONS
User's Manual U11919EJ3V0UM00
83
4.4 Operation of Port Functions
The operation of a port differs depending on whether the port is set in the input or output mode, as described
below.
4.4.1 Writing to I/O port
(1)
In output mode
A value can be written to the output latch of a port by using a transfer instruction. The contents of the
output latch can be output from the pins of the port.
The data once written to the output latch is retained until new data is written to the output latch.
(2)
In input mode
A value can be written to the output latch by using a transfer instruction. However, the status of the port pin
is not changed because the output buffer is OFF.
The data once written to the output latch is retained until new data is written to the output latch.
Caution
A 1-bit memory manipulation instruction is executed to manipulate 1 bit of a port.
However, this instruction accesses the port in 8-bit units. When this instruction is
executed to manipulate a bit of a port consisting both of inputs and outputs, therefore, the
contents of the output latch of the pin that is set in the input mode and not subject to
manipulation become undefined.
4.4.2 Reading from I/O port
(1)
In output mode
The contents of an output latch can be read by using a transfer instruction. The contents of the output latch
are not changed.
(2)
In input mode
The status of a pin can be read by using a transfer instruction. The contents of the output latch are not
changed.
4.4.3 Arithmetic operation of I/O port
(1)
In output mode
An arithmetic operation can be performed with the contents of an output latch. The result of the operation is
written to the output latch. The contents of the output latch are output from the port pins.
The data once written to the output latch is retained until new data is written to the output latch.
(2)
In input mode
The contents of the output latch become undefined. However, the status of the pin is not changed because
the output buffer is OFF.
Caution
A 1-bit memory manipulation instruction is executed to manipulate 1 bit of a port.
However, this instruction accesses the port in 8-bit units. When this instruction is
executed to manipulate a bit of a port consisting both of inputs and outputs, therefore, the
contents of the output latch of the pin that is set in the input mode and not subject to
manipulation become undefined.
Summary of Contents for mPD789026 Subseries
Page 2: ...User s Manual U11919EJ3V0UM00 2 MEMO...
Page 8: ...User s Manual U11919EJ3V0UM00 8 MEMO...
Page 12: ...User s Manual U11919EJ3V0UM00 12 MEMO...
Page 22: ...User s Manual U11919EJ3V0UM00 22 MEMO...
Page 32: ...User s Manual U11919EJ3V0UM00 32 MEMO...
Page 84: ...User s Manual U11919EJ3V0UM00 84 MEMO...
Page 92: ...User s Manual U11919EJ3V0UM00 92 MEMO...
Page 104: ...User s Manual U11919EJ3V0UM00 104 MEMO...
Page 166: ...User s Manual U11919EJ3V0UM00 166 MEMO...
Page 178: ...User s Manual U11919EJ3V0UM00 178 MEMO...
Page 184: ...User s Manual U11919EJ3V0UM00 184 MEMO...
Page 204: ...User s Manual U11919EJ3V0UM00 204 MEMO...
Page 206: ...User s Manual U11919EJ3V0UM00 206 MEMO...