CHAPTER 4 PORT FUNCTIONS
102
User’s Manual U15075EJ1V0UM00
4.4 Port Function Operation
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.
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.
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 an input/output port, 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 status 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 the 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.
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 an input/output port, 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 mPD789425
Page 2: ...2 User s Manual U15075EJ1V0UM00 MEMO ...
Page 6: ...6 User s Manual U15075EJ1V0UM00 MEMO ...
Page 10: ...10 User s Manual U15075EJ1V0UM00 MEMO ...
Page 24: ...24 User s Manual U15075EJ1V0UM00 MEMO ...
Page 36: ...36 User s Manual U15075EJ1V0UM00 MEMO ...
Page 46: ...46 User s Manual U15075EJ1V0UM00 MEMO ...
Page 176: ...User s Manual U15075EJ1V0UM00 176 MEMO ...
Page 196: ...User s Manual U15075EJ1V0UM00 196 MEMO ...
Page 210: ...User s Manual U15075EJ1V0UM00 210 MEMO ...
Page 262: ...262 User s Manual U15075EJ1V0UM00 MEMO ...
Page 278: ...278 User s Manual U15075EJ1V0UM00 MEMO ...
Page 296: ...296 User s Manual U15075EJ1V0UM00 MEMO ...
Page 298: ...User s Manual U15075EJ1V0UM00 298 MEMO ...