Datasheet

Section 9 I/O Ports
Rev.5.00 Nov. 02, 2005 Page 115 of 418
REJ09B0028-0500
9.2.1 Port Control Register 2 (PCR2)
PCR2 selects inputs/outputs in bit units for pins to be used as general I/O ports of port 2.
Bit Bit Name
Initial
Value R/W Description
7 to 3 Reserved
2
1
0
PCR22
PCR21
PCR20
0
0
0
W
W
W
When each of the port 2 pins P22 to P20 functions as an
general I/O port, setting a PCR2 bit to 1 makes the
corresponding pin an output port, while clearing the bit to
0 makes the pin an input port.
9.2.2 Port Data Register 2 (PDR2)
PDR2 is a general I/O port data register of port 2.
Bit Bit Name
Initial
Value R/W Description
7 to 3 All 1 Reserved
These bits are always read as 1.
2
1
0
P22
P21
P20
0
0
0
R/W
R/W
R/W
PDR2 stores output data for port 2 pins.
If PDR2 is read while PCR2 bits are set to 1, the value
stored in PDR2 is read. If PDR2 is read while PCR2 bits
are cleared to 0, the pin states are read regardless of the
value stored in PDR2.