Operation Of Port 6 - Fujitsu MB90420/5 (A) Series Hardware Manual

F2mc-16lx family 16-bit microcontrollers
Table of Contents
MB90420/5 (A) SERIES F

8.8.2 Operation of Port 6

The operation of port 6 is explained.
n Operation of port 6
• Operation at output port
– When the bit of the corresponding DDR6 register is set to 1, the pin becomes an output port pin.
– When data is written to the PDR6 register at the output port, data is held at the output latch in PDR and
then output to that output port pin as it is.
– When the PDR6 register is read, the value of the pin (same value as output latch in PDR) is read.
Note:
When a read-modify-write family instruction (such as bit set instruction) is used for the port data
register, the target bit becomes the specified value and the bits set to output in the DDR register are
unaffected. However, the bits set to input in the DDR register are affected. The input values of the
corresponding pins are written to the output latch and then output to the pins. Consequently, when
switching a bit that is used as input to output, write the output data to the PDR register, and then set
the DDR register to output.
• Operation at input port
– When the bit of the corresponding DDR6 register is set to 0, the pin becomes an input port pin.
– When the pin is an input port pin, the output buffer is set to OFF and the pin is set to the high-
impedance state.
– When data is written to the PDR6 register, data is held at the output latch in PDR, but not output to the
pin.
– When the PDR6 register is read, the level value (0 or 1) of the pin is read.
• Operation when pin used as analog input pin
When using a pin as an analog input pin, write 1 to the bit of the ADER register that corresponds to the
analog input pin. This disables operation as a general-purpose port, making it possible to use the pin as
an analog input pin. When PDR6 is read in this state, 0 is read.
• Operation at reset
When the CPU is reset, the value of the DDR6 register is initialized to 0, the value of the ADER register is
initialized to 1, and the analog input mode occurs. When using a pin as a general-purpose port, write 0 to
the ADER register in advance to use the port I/O mode.
2
MC-16LX FAMILY 16-BIT MICROCONTROLLERS HARDWARE MANUAL
8-34
Table of Contents
loading

Table of Contents