129
Port Data Register 2 (PDR2)
Bit
7
6
5
4
3
2
1
0
P2
7
P2
6
P2
5
P2
4
P2
3
P2
2
P2
1
P2
0
Initial value
0
0
0
0
0
0
0
0
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
PDR2 is an 8-bit register that stores data for pins P2
7
to P2
0
of port 2. If port 2 is read while PCR2
bits are set to 1, the values stored in PDR2 are directly read, regardless of the actual pin states. If
port 2 is read while PCR2 bits are cleared to 0, the pin states are read.
Upon reset, PDR2 is initialized to H'00.
Port Control Register 2 (PCR2)
Bit
7
6
5
4
3
2
1
0
PCR2
7
PCR2
6
PCR2
5
PCR2
4
PCR2
3
PCR2
2
PCR2
1
PCR2
0
Initial value
0
0
0
0
0
0
0
0
Read/Write
W
W
W
W
W
W
W
W
PCR2 is an 8-bit register for controlling whether each of the port 2 pins P2
7
to P2
0
functions as an
input pin or output pin. Setting a PCR2 bit to 1 makes the corresponding pin an output pin, while
clearing the bit to 0 makes the pin an input pin. The settings in PCR2 and in PDR2 are valid only
when the corresponding pin is designated in PMR2 as a general I/O pin.
Upon reset, PCR2 is initialized to H'00.
PCR2 is a write-only register, which always reads all 1s.
Note:
As P2
7
is an input-only pin, it becomes a high-impedance output when PCR2
7
is set to 1.