
S3C94A5/F94A5
I/O PORTS
9-19
PORT 5
Port 5 is a 7-bit I/O port with individually configurable pins. Port 5 pins are accessed directly by writing or reading the
port 5 data register, P5 at location E8H in page 0. P5.0–P5.6 can serve as inputs (with or without pull-up) as output
(push-pull or open-drain) or you can be configured the following functions.
— Low-nibble pins (P5.0–P5.3): AD15 and INT for only P5.0
Port 5 Control Registers (P5CONH, P5CONL)
Port 5 has two 8-bit control registers: P5CONH for P5.3–P5.6 and P4CONL for P5.0–P5.2. A reset clears the
P5CONH and P5CONL registers to "00H", configuring all pins to input mode. You use control registers setting to
select input (with or without pull-up) or output mode (push-pull or open-drain) and enable the alternative functions.
When programming this port, please remember that any alternative peripheral I/O function you configure using the
port 5 control register must also be enabled in the associated peripheral module.
Port 5.0 Interrupt Enable, Pending, and Edge Selection Registers (P4n5INT.5, INTPND2.7, P4n5INT.3–.2)
To process external interrupt at the port 5.0 pin, two additional control registers are provided: the port 5.0 interrupt
enable register P4n5INT.5 (FBH, page 0), the port 5.0 interrupt pending bit INTPND2.7 (D7H, page 0), and the port
5.0 interrupt edge selection register P4n5INT.3–.2 (FBH, page 0).
The port 5.0 interrupt pending register bit lets you check for interrupt pending conditions and clear the pending
condition when the interrupt service routine has been initiated. The application program detects interrupt requests by
polling the INTPND2.7 register at regular intervals.
When the interrupt enable bit of port 5.0 pin is "1", a rising or falling edge at that pin will generate an interrupt
request. The corresponding INTPND2 bit is then automatically set to "1" and the IRQ level goes low to signal the
CPU that an interrupt request is waiting. When the CPU acknowledges the interrupt request, application software
must the clear the pending condition by writing a "0" to the corresponding INTPND2 bit.
Port 5 Control Register, High Byte (P5CONH)
FDH, Page 0, R/W
.7
.6
.5
.4
.3
.2
.1
.0
MSB
LSB
P5.4
P5.3
P5CONH bit-pair pin configuration settings:
00
01
10
11
N-channel open-drain output mode
Input mode with pull-up
Push-pull output mode
Input mode
P5.5
P5.6
Figure 9-24. Port 5 Control Register, High-Byte (P5CONH)