Operation Of Port 2 - Fujitsu MB90895 Series Hardware Manual

16 bit, controller manual
Table of Contents

Advertisement

4.4.2

Operation of Port 2

The operation of port 2 is explained.
I Operation of Port 2 (General-purpose I/O Port)
G
Operation of output port
• When the bit in the port 2 direction register (DDR2) corresponding to the output pin is set to "1", port 2
functions as an output port.
• When the output buffer is turned "ON" and output data is written to the port 2 data register (PDR2), the
data is retained in the output latch and output from the pin.
• When the PDR2 is read, the state of the output latch in the PDR2 is read.
Note:
If read modify write instructions (such as the bit set instruction) are used to read the PDR, the
pin set as an output port by the DDR outputs the desired data. To switch a pin from input port
to output port, write output data to the port data register and use the port direction register to
set the pin as an output port.
G
Operation of input port
• If the bit in the DDR2 corresponding to the input pin is set to "0", port 2 functions as an input port.
• The output buffer is turned "OFF" and the pin enters the high impedance state.
• When data is written to the PDR2, it is retained in the output latch in the PDR2 but not output to the pin.
• When the PDR2 is read, the level value (Low or High) of the pin is read.
G
Operation of resource output
• When using the port as the output pin of the resource, set the resource output to enabled.
• Since the resource output is preferred enabled, the resource output functions regardless of the settings of
the DDR2.
• When the pin state is read with the resource output set to enabled, the output state of the resource is
read.
G
Operation of resource input
• The state of the pin that serves as the resource input is input to the resource.
• When using port 2 as the input pin of the resource, set the pin corresponding to the resource in the
DDR2 as an input port.
CHAPTER 4 I/O PORT
171

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lx

Table of Contents