NEC mPD784225 Series User Manual page 138

16-/8-bit single-chip microcontrollers
Table of Contents

Advertisement

5.4 Operations
Port operations differ depending on whether the input or output mode is set, as shown below.
5.4.1 Writing to I/O 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 instructions, although a single bit is manipulated,
the port is accessed in 8-bit units. 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.
5.4.2 Reading from I/O 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.
5.4.3 Operations on I/O 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 instructions, although a single bit is manipulated,
the port is accessed in 8-bit units. 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.
138
CHAPTER 5 PORT FUNCTIONS
User's Manual U12697EJ3V0UM

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpd784225y seriesMpd784224Mpd784225Mpd78f4225Mpd784224yMpd784225y ... Show all

Table of Contents