English
Language : 

UPD784938 Datasheet, PDF (158/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 6 PORT FUNCTIONS
(2) When set as an input port
The port pin level can be loaded into an accumulator by means of a transfer instruction. In this case, too, writes can be
performed to the output latch, and data transferred from the accumulator by a transfer instruction, etc., is stored in all output
latches irrespective of the port input/output specification. However, since the output buffer of a bit specified as an input port
is high-impedance, the data is not output to the port pin (when a port specified as input is switched to an output port, the
output latch contents are output to the port pin). Also, when specified as an input port, the output latch contents cannot be
loaded into an accumulator.
Figure 6-40. Port Specified as Input Port
WRPORT
Internal
bus
Output
latch
RDIN
P4n
n = 0 to 7
Caution A bit manipulation instruction manipulates one bit as the result, but accesses the port in 8-bit units.
Therefore, if a bit manipulation instruction is used on a port with a mixture of input and output pins,
the contents of the output latch of pins specified as inputs will be undefined (excluding bits
manipulated with a SET1 or CLR1 instruction, etc.). Particular care is required when there are bits
which are switched between input and output.
Caution is also required when manipulating the port with other 8-bit arithmetic instructions.
(3) When used as address/data bus (AD0 to AD7)
Used automatically when an external access is performed.
Input/output instructions should not be executed on port 4.
158
Preliminary User’s Manual U13987EJ1V0UM00