Operation Of Port 5 - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 9 I/O PORT
9.8.2

Operation of Port 5

This section describes the operation of port 5.
■ Operation of Port 5
Port operation in output mode
• Setting a bit of the DDR5 register to "1" places the corresponding port pin in output mode.
• Data written to the PDR5 register in output mode is held in the output latch of the PDR and output to the
port pins.
• The PDR5 register can be accessed in read mode to read the value at the port pins (the same value as in
the output latch of the PDR).
Note:
If a read-modify-write instruction (such as an instruction that sets bits) is used with the port data
register, the target bits of the register are set to the specified value. The bits that have been
specified for output using the DDR register are not affected, but for the bits that have been specified
for input, a value input from the pins is written to the output latch and output as is. Before switching
the mode for the bits from input to output, therefore, write the output data to the PDR register, then
specify output mode in the DDR register.
Port operation in input mode
• Resetting a bit of the DDR5 and ADER register to "0" places the corresponding port pin in input mode.
• In input mode, the output buffer is turned off, and the pins are placed in a high impedance state.
• Data written to the PDR5 register in input mode is held in the output latch of the PDR but not output to
the port pins.
• The PDR5 register can be accessed in read mode to read the level value (0 or 1) at the port pins.
Port operation for analog input
To use a port pin for analog input, write "1" to the corresponding ADER bit. Doing so disables the port
from operating as a general-purpose port pin and enables it to function as an analog input pin. When PDR5
is accessed in read mode in this situation, a value of "0" is read.
Port operation after a reset
When the CPU is reset, the DDR5 register is initialized to "0" and the ADER register is initialized to "1" to
place the port in analog input mode. To use the port as a general-purpose port, write "0" to the ADER
register in advance to place the port in port I/O mode.
196

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents