2.
Port control register 4 (PCR4)
PCR4 is an 8-bit register for controlling whether each of port 4 pins P4
2
to P4
0
functions as an input
pin or output pin. Setting a PCR4 bit to 1 makes the corresponding pin an output pin, while clearing
the bit to 0 makes the pin an input pin. PCR4 and PDR4 settings are valid when the corresponding
pins are designated for general-purpose input/output by SCR3-2.
Upon reset, PCR4 is initialized to H'F8.
PCR4 is a write-only register, which always reads all 1s.
8.4.3
Pin Functions
Table 8-9 shows the port 4 pin functions.
Table 8-9 Port 4 Pin Functions
Pin
Pin Functions and Selection Method
P4
3
/
IRQ
0
The pin function depends on bit IRQ0 in PMR3.
IRQ0
0
1
Pin function
P4
3
input pin
IRQ
0
input pin
P4
2
/TXD
32
The pin function depends on bit TE in SCR3-2, bit SPC32 in SPCR, and bit
PCR4
2
in PCR4.
SPC32
0
1
TE
0
1
PCR4
2
0
1
*
Pin function
P4
2
input pin
P4
2
output pin
TXD
32
output pin
P4
1
/RXD
32
The pin function depends on bit RE in SCR3-2 and bit PCR4
1
in PCR4.
RE
32
0
1
PCR4
1
0
1
*
Pin function
P4
1
input pin
P4
1
output pin
RXD
32
input pin
*:
Don’t care
Bit
Initial value
Read/Write
7
—
1
—
6
—
1
—
5
—
1
—
4
—
1
—
3
—
1
—
0
PCR4
0
W
2
PCR4
0
W
1
PCR4
0
W
2
1
0
149