
S3C94A5/F94A5
I/O PORTS
9-15
PORT 4
Port 4 is a 8-bit I/O port with individually configurable pins. Port 4 pins are accessed directly by writing or reading the
port 4 data register, P4 at location E7H in page 0. P4.0–P4.7 can serve as inputs (with or without pull-up), as outputs
(push-pull or open-drain) or you can be configured the following functions.
— Low-nibble pins (P4.0–P4.3): AD12–AD13, T1OUT/T1PWM, T2OUT/T2PWM, T1CAP, T2CAP
— High-nibble pins (P4.4–P4.7): SO, SI, SCK, AD14, INT
Port 4 Control Registers (P4CONH, P4CONM and P4CONL)
Port 4 has three 8-bit control registers: P4CONH for P4.6–P4.7, P4CONM for P4.2–P4.5, and P4CONL for P4.0–
P4.1. A reset clears the P4CONH, P4CONM and P4CONL registers to "00H", configuring all pins to input mode. You
use control registers setting to select input 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 4 control register must also be enabled in the associated peripheral module.
Port 4 Pull-up Resistor Control Register (P4PUR)
Using the port 4 pull-up control register, P4PUR (FCH, page 0), you can configure pull-up resistors to individually port
4 pins.
Port 4.7 Interrupt Enable, Pending, and Edge Selection Registers (P4n5INT.4, INTPND2.6, P4n5INT.1–.0)
To process external interrupt at the port 4.7 pin, two additional control registers are provided: the port 4.7 interrupt
enable register P4n5INT.4 (FBH, page 0), the port 4.7 interrupt pending bit INTPND2.6 (D7H, page 0), and the port
4.7 interrupt edge selection register P4n5INT.1–.0 (FBH, page 0).
The port 4.7 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.6 register at regular intervals.
When the interrupt enable bit of port 4.7 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.