![](http://datasheet.mmic.net.cn/330000/MB90F562_datasheet_16437954/MB90F562_208.png)
184
CHAPTER 8 I/O PORTS
MB90560 series
8.4
8.4.1 Port 1 Registers (PDR1, DDR1, and RDR1)
Port 1
This section describes the port 1 registers.
I
Functions of Port 1 Registers
G
Port 1 data register (PDR1)
The PDR1 register indicates the state of each pin of port 1.
G
Port 1 data direction register (DDR1)
The DDR1 register specifies the direction of a data flow (input or output) at each pin (bit) of port
1. When a DDR1 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.
G
Port 1 pull-up resistor setting register (RDR1)
The RDR1 register specifies the selection of a pull-up resistor at each pin (bit) of port 1. When a
RDR1 register bit is “1”, a pull-up resistor is selected for the corresponding port (pin). When the
bit is “0”, the pull-up resistor is deselected.
<Caution>
To use a peripheral function having input pins, reset the port direction register bit
corresponding to each peripheral function input pin to “0” to place the port in input mode.
Table 8.4-3 lists the functions of the port 1 registers.
Table 8.4-3 Port 1 register functions
R/W
X
: Read/write enabled
: Undefined
Register
Data
During
reading
During writing
Read/
Write
Address
Initial value
Port 1 data
register (PDR1)
0
The pin is at
the low level.
The output latch is loaded with “0”. When
the pin functions as an output port, the pin
is set to the low level.
R/W
000001H
XXXXXXXXB
1
The pin is at
the high
level.
The output latch is loaded with “1”. When
the pin functions as an output port, the pin
is set to the high level.
Port 1 data
direction register
(DDR1)
0
The direction
latch is “0”.
The output buffer is turned off to place the
port in input mode.
R/W
000011H
00000000B
1
The direction
latch is “1”.
The output buffer is turned on to place the
port in output mode.
Port 1 pull-up
resistor setting
register (RDR1)
0
The setting
latch is “0”.
The pull-up resistor is cut and the port is
placed in the Hi-Z state in input mode.
R/W
00008DH
00000000B
1
The setting
latch is “1”.
The pull-up resistor is selected and the
port is held at the high level in input mode.