![](http://datasheet.mmic.net.cn/330000/MB90F562_datasheet_16437954/MB90F562_232.png)
208
CHAPTER 8 I/O PORTS
MB90560 series
8.8
8.8.1 Port 5 Registers (PDR5, DDR5, and ADER)
Port 5
This section describes the port 5 registers.
I
Functions of Port 5 Registers
G
Port 5 data register (PDR5)
The PDR5 register indicates the state of each pin of port 5.
G
Port 5 data direction register (DDR5)
The DDR5 register specifies the direction of a data flow (input or output) at each pin (bit) of port
5. When a DDR5 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
Analog input enable register (ADER)
Each bit of the ADER register specifies whether the corresponding port 5 pin is to be used as a
general-purpose I/O port or an analog input pin. Setting an ADER bit to “1” enables the
corresponding pin for analog input. Setting the bit to “0” enables the pin for general-purpose I/O.
<Check>
If a signal at an intermediate level is input in port I/O mode, input leak current flows.
Therefore, for a pin used for analog input, be sure to set the corresponding ADER bit to “1”
for analog input.
<Reference>
When the CPU is reset, the DDR5 register is reset to “0” and the ADER register is set to “1”
for analog input.
Table 8.8-3 lists the functions of the port 5 registers.
Table 8.8-3 Port 5 register functions
R/W : Read/write enabled
X
: Undefined
Register
Data
During
reading
During writing
Read/
Write
Address
Initial value
Port 5 data
register (PDR5)
0
The pin is at the
low level.
Low level is output to the pin. (The
output latch is loaded with “0: to turn on
the output transistor.)
R/W
000005H
XXXXXXXB
1
The pin is at the
high level.
The pin is placed in a high-impedance
state. (The output latch is loaded with “1”
to turn off the output transistor.)
Port 5 data
direction register
(DDR5)
0
The direction
latch is “0”.
The output buffer is turned off to place
the port in input mode.
R/W
000015H
00000000B
1
The direction
latch is “1”.
The output buffer is turned on to place
the port in output mode.
Analog input
enable register
(ADER)
0
Port I/O mode
R/W
000017H
11111111B
1
Analog input mode