Table 4.2.1 Port 0 And 1 Register Function - Fujitsu F2MC-8L MB89620 Series Hardware Manual

8-bit microcontroller
Table of Contents

Advertisement

4.2 Ports 0 and 1
4.2.1 Port 0 and 1 Registers (PDR0, PDR1, DDR0, DDR1)
This section describes the port 0 and 1 registers.
n Port 0 and 1 Register Functions
l
Port data registers (PDR0, PDR1)
The PDR0 and PDR1 registers hold the pin states.
Port data direction registers (DDR0, DDR1)
l
The DDR0 and DDR1 registers set the direction (input or output) for each pin (bit).
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.
Check: As the port data direction registers are write-only, the bit manipulation instructions (SETB and
Note: • Writing data to the port data register for pins that have been set to the input direction does not
• The port data direction registers are initialized to "0" (input port) by a reset.
Table 4.2.1 lists the functions of the port 0 and 1 registers.

Table 4.2.1 Port 0 and 1 Register Function

Register
Port 0 data
register (PDR0)
Port 0 data
direction register
(DDR0)
Port 1 data
register (PDR1)
Port 1 data
direction register
(DDR1)
R/W : Readable and writable
W : Write-only
X : Indeterminate
92
CHAPTER 4 I/O PORTS
CLRB) cannot be used.
output to the pins. (However, the data is held in the output latch.)
Data
Read
Pin state is the
0
"L" level.
Pin state is the
1
"H" level.
0
Reading is not
permitted (write-
only).
1
Pin state is the
0
"L" level.
Pin state is the
1
"H" level.
0
Reading is not
permitted (write-
only).
1
Write
Sets "0" to the output latch.
Outputs an "L" level to the pin if the
pin functions as an output port.
Sets "1" to the output latch.
Outputs an "H" level to the pin if the
pin functions as an output port.
Sets the output buffer "OFF" and
sets the pin as an input pin.
Sets the output buffer "ON" and
sets the pin as an output pin.
Sets "0" to the output latch.
Outputs an "L" level to the pin if the
pin functions as an output port.
Sets "1" to the output latch.
Outputs an "H" level to the pin if the
pin functions as an output port.
Sets the output buffer "OFF" and
sets the pin as an input pin.
Sets the output buffer "ON" and
sets the pin as an output pin.
Read/
Address
Initial value
Write
R/W
0000
XXXXXXXX
H
W
0001
00000000
H
R/W
0002
XXXXXXXX
H
W
0003
00000000
H
MB89620 series
B
B
B
B

Advertisement

Table of Contents
loading

Table of Contents