132
Table 7-2 Port 1 Registers
Initial Value
Address
*
Name
Abbreviation
R/W
Modes 1, 3
Modes 5 to 7
H'FFC0
Port 1 data direction
register
P1DDR
W
H'FF
H'00
H'FFC2
Port 1 data register
P1DR
R/W
H'00
H'00
Note: Lower 16 bits of the address.
Port 1 Data Direction Register (P1DDR): P1DDR is an 8-bit write-only register that can select
input or output for each pin in port 1.
Bit
Modes
1, 3
Initial value
Read/Write
Initial value
Read/Write
Modes
5 to 7
7
P1 DDR
1
—
0
W
7
6
P1 DDR
1
—
0
W
6
5
P1 DDR
1
—
0
W
5
4
P1 DDR
1
—
0
W
4
3
P1 DDR
1
—
0
W
3
2
P1 DDR
1
—
0
W
2
1
P1 DDR
1
—
0
W
1
0
P1 DDR
1
—
0
W
0
Port 1 data direction 7 to 0
These bits select input or
output for port 1 pins
P1DDR is initialized to H'00 by a reset and in hardware standby mode. In software standby mode
it retains its previous setting. If a P1DDR bit is set to 1, the corresponding pin maintains its output
state in software standby mode.
Port 1 Data Register (P1DR): P1DR is an 8-bit readable/writable register that stores data for pins
P1
7
to P1
0
.
Bit
Initial value
Read/Write
7
P1
0
R/W
Port 1 data 7 to 0
These bits store data for port 1 pins
7
6
P1
0
R/W
6
5
P1
0
R/W
5
4
P1
0
R/W
4
3
P1
0
R/W
3
2
P1
0
R/W
2
1
P1
0
R/W
1
0
P1
0
R/W
0
When a bit in P1DDR is set to 1, if port 1 is read the value of the corresponding P1DR bit is
returned directly, regardless of the actual state of the pin. When a bit in P1DDR is cleared to 0, if
port 1 is read the corresponding pin level is read.