
I/O PORTS
S3C821A/P821A
9-14
PORT 5
Port 5 is a 7-bit I/O port with individually configurable pins. It is accessed directly by writing or reading the port 5
data register, P5 (R229, E5H, Bank 0) in set 1. You can use port 5 for general I/O, or for the following alternative
functions:
— P5.0–P5.3 can be configured, respectively, as SCK, output high impedance, SO, and BUZ output.
The special functions that you can program using the port 5 control register must also be enabled in the
associated peripheral. Also, when using port 5 pins for functions other than general I/O, you must still set the
corresponding port 5 control register value to configure each bit to input or output mode.
PORT 5 CONTROL REGISTERS
Two 8-bit control registers are used to configure port 5 pins: P5CONH (high byte, EAH, Set 1, Bank 1) for the
pins P5.4–P5.6 and P5CONL (EBH, set 1, Bank 1) for the pins P5.0–P5.3. Each byte contains four or three bit-
pairs and each bit-pair configures one of port 5 pins. The P5CONL register also controls the alternative functions
described below.
Port 5 High-Byte Control Register (P5CONH)
Three bit-pairs in the port 5 control register (P5CONH) configure the port 5 pins, P5.4–P5.6 to schmitt trigger
input, schmitt trigger input with pull-up resistor, or push-pull output mode.
Port 5 Low-Byte Control Register (P5CONL)
The low-byte port 5 pins, P5.0–P5.3, can be configured individually as schmitt trigger inputs, schmitt trigger input
with pull-up resistor, or as push-pull outputs. You can alternately configure these pins. To select the alternative
functions, you must set the related bit-pairs — SCK output, output high impedance, SO, and BUZ output — to
"11B".
Table 9-5. Port 5 Data Register Summary (Low Nibbles)
P5CONL Bit-Pair
Corresponding Port 5 Pin
Alternate Pin Function
Bits 0 and 1
P5.0
SCK output
Bits 2 and 3
P5.1
High impedance
Bits 4 and 5
P5.2
SO
Bits 6 and 7
P5.3
BUZ