163
CHAPTER 6 PORT FUNCTIONS
6.4 Port Function Operations
Port operations differ depending on whether the input or output mode is set, as shown below.
6.4.1 Writing to input/output port
(1) Output mode
A value is written to the output latch by a transfer instruction, and the output latch contents are output from
the pin.
Once data is written to the output latch, it is retained until data is written to the output latch again.
(2) Input mode
A value is written to the output latch by a transfer instruction, but since the output buffer is OFF, the pin status
does not change.
Once data is written to the output latch, it is retained until data is written to the output latch again.
Caution In the case of 1-bit memory manipulation instruction, although a single bit is manipulated
the port is accessed as an 8-bit unit. Therefore, on a port with a mixture of input and output
pins, the output latch contents for pins specified as input are undefined except for the
manipulated bit.
6.4.2 Reading from input/output port
(1) Output mode
The output latch contents are read by a transfer instruction. The output latch contents do not change.
(2) Input mode
The pin status is read by a transfer instruction. The output latch contents do not change.
6.4.3 Operations on input/output port
(1) Output mode
An operation is performed on the output latch contents, and the result is written to the output latch. The
output latch contents are output from the pins.
Once data is written to the output latch, it is retained until data is written to the output latch again.
(2) Input mode
The output latch contents are undefined, but since the output buffer is OFF, the pin status does not change.
Caution In the case of 1-bit memory manipulation instruction, although a single bit is manipulated
the port is accessed as an 8-bit unit. Therefore, on a port with a mixture of input and output
pins, the output latch contents for pins specified as input are undefined, even for bits other
than the manipulated bit.
Summary of Contents for PD78076
Page 2: ...2 MEMO ...
Page 12: ...12 MEMO ...
Page 48: ...48 MEMO ...
Page 64: ...64 MEMO ...
Page 82: ...82 MEMO ...
Page 100: ...100 MEMO ...
Page 130: ...130 MEMO ...
Page 180: ...180 MEMO ...
Page 222: ...222 MEMO ...
Page 248: ...248 MEMO ...
Page 288: ...288 MEMO ...
Page 308: ...308 MEMO ...
Page 364: ...364 MEMO ...
Page 494: ...494 MEMO ...
Page 526: ...526 MEMO ...
Page 544: ...544 MEMO ...
Page 558: ...558 MEMO ...
Page 580: ...580 MEMO ...
Page 596: ...596 MEMO ...
Page 598: ...598 MEMO ...
Page 626: ...626 MEMO ...