
86
CHAPTER 4 I/O Ports
MB89960 series
4.4 Port 3
4.4.1 Port 3 Registers (PDR3 and DDR3)
This section describes the port 3 registers.
s Port 3 Register Functions
q Port 3 data register (PDR3)
The PDR3 register holds the pin states.
q Port 3 direction register (DDR3)
The DDR3 register sets the direction (input or output) for each pin.
Setting “1” to the bit corresponding to a port (pin) sets the pin as an output port. Setting “0” sets
the pin as an input port.
DDR3 bit 5 has special meaning and is different from the other bits in DDR3. DDR3 bit5 is used
to select resource outputs for P34. Set DDR3 bit 5 to “1” enable clock output (operation freq.
divide by 2) at P34. Set DDR3 bit 5 to “0” disable clock output at P34.
The output priority at P34: TO from timer/counter (highest) > CLK output > port output (lowest).
Note: When using resources that have output pins, enabling a resource’s output enable bit for
a particular pin sets that pin as a resource output pin, regardless of the DDR3 register
setting.
When using resources that have input pins, set the DDR3 register bits corresponding to
the resource input pins to “0” to set the pins as input ports.
Data written to the PDR3 register for pins that have been set to the input direction is not
output to the pins. (However, the data is held in the output latch.) Also, the DDR3
register is initialized to zero by a reset.
Table 4.4.1 lists the functions of the port 3 registers.
R/W: Read and write
W: Write only
X: Undefined
Table 4.4.1 Port 3 Register Functions
Register
Data
Read Function
Write Function
Read/
Write
Address
Initial Value
Port 3 data register
(PDR3)
0
The pin state is the
“L” level.
Sets “0” to the output
latch. Outputs an “L”
level to the pin if the pin
is an output port.
R/W
000CH
XXXXXXXXB
1
The pin state is the
“H” level.
Sets “1” to the output
latch. Outputs an “H”
level to the pin if the pin
is an output port.
Port 3 direction
register (DDR3)
(except bit 5 of DDR3)
0
This pin is
functioning as an
input pin.
Sets the output buffer
“OFF” and sets as an
input pin.
R/W
000DH
00000000B
1
This pin is
functioning as an
output pin.
Sets the output buffer
“ON” and sets as an
output pin.