
S3C94A5/F94A5
I/O PORTS
9-9
PORT 3
Port 3 is a 6-bit I/O port with individually configurable pins. Port 3 pins are accessed directly by writing or reading the
port 3 data register, P3 at location E6H in page 0. P3.0–P3.5 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 (P3.0–P3.3): AD6–AD9, CLO, BUZ, T0OUT/T0PWM, INT
— High-nibble pins (P3.4–P3.5): AD10–AD11, T0CAP, T0CLK, INT
Port 3 Control Registers (P3CONH, P3CONL)
Port 3 has two 8-bit control registers: P3CONH for P3.3–P3.5 and P3CONL for P3.0–P3.2. A reset clears the
P3CONH and P3CONL 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 3 control register must also be enabled in the associated peripheral module.
Port 3 Pull-up Resistor Control Register (P3PUR)
Using the port 3 pull-up control register, P3PUR (F4H, page 0), you can configure pull-up resistors to individually port
3 pins.
Port 3 Interrupt Enable, Pending, and Edge Selection Registers(P3INT, INTPND2.5–0, P3EDGEH/P3EDGEL)
To process external interrupts at the port 3 pins, three additional control registers are provided: the port 3 interrupt
enable register P3INT (F5H, page 0), the port 3 interrupt pending bits INTPND2.5–.0 (D7H, page 0), and the port 3
interrupt edge selection register P3EDGEH (F6H, page 0) and P3EDGEL (F7H, page 0).
The port 3 interrupt pending register bits 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.5–.0 register at regular intervals.
When the interrupt enable bit of any port 3 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.