Port 2 Registers (Pdr2 And Ddr2) - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 9 I/O PORT
9.5.1

Port 2 Registers (PDR2 and DDR2)

This section describes the port 2 registers.
■ Functions of Port 2 Registers
Port 2 data register (PDR2)
The PDR2 register indicates the state of each pin of port 2.
Port 2 data direction register (DDR2)
The DDR2 register specifies the direction of a data flow (input or output) at each pin (bit) of port 2. When
a DDR2 register bit is "1", the corresponding port (pin) is set as an output port. When the bit is "0", the
port (pin) is set as an input port.
References:
• When a resource having output pins is used, the port functions as resource output pins regardless
of the value in the DDR2 register as long as the resource output enable bit corresponding to the
pins is set.
• To use a resource having input pins, reset the DDR2 register bit corresponding to each resource
input pin to "0" to place the port in input mode.
Table 9.5-3 lists the functions of the port 2 registers.
Table 9.5-3 Port 2 Register Functions
Register
Data
0
Port 2 data
register (PDR2)
1
0
Port 2 data
direction
register (DDR2)
1
R/W: Read/write enabled
X
: Undefined
180
During
During writing
reading
The pin is
The output latch is loaded with 0.
at the low
When the pin functions as an output
level.
port, the pin is set to the low level.
The pin is
The output latch is loaded with 1.
at the high
When the pin functions as an output
level.
port, the pin is set to the high level.
The
The output buffer is turned off to
direction
place the port in input mode.
latch is "0".
The
The output buffer is turned on to
direction
place the port in output mode.
latch is "1".
Read/
Address
Initial value
Write
000002
XXXXXXXX
R/W
H
000012
R/W
H
B
00000000
B

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents