
S3C94A5/F94A5
I/O PORTS
9-3
PORT 1
Port 1 is a 7-bit I/O port with individually configurable pins. Port 1 pins are accessed directly by writing or reading the
port 1 data register, P1 at location E4H in page 0. P1.0–P1.6 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 (P1.0–P1.3): INT
— High-nibble pins (P1.4–P1.6): INT
Port 1 Control Registers (P1CONH, P1CONL)
Port 1 has two 8-bit control registers: P1CONH for P1.4–P1.6 and P1CONL for P1.0–P1.3. A reset clears the
P1CONH and P1CONL 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).
When programming this port, please remember that any alternative peripheral I/O function you configure using the
port 1 control register must also be enabled in the associated peripheral module.
Port 1 Interrupt Enable, Pending, and Edge Selection Registers (P1INT, INTPND1, P1EDGEH/P1EDGEL)
To process external interrupts at the port 1 pins, three additional control registers are provided: the port 1 interrupt
enable register P1INT (ECH, page 0), the port 1 interrupt pending bits INTPND1 (D6H, page 0), and the port 1
interrupt edge selection register P1EDGEH (EDH, page 0) and P1EDGEL (EEH, page 0).
The port 1 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 INTPND1 register at regular intervals.
When the interrupt enable bit of any port 1 pin is "1", a rising or falling edge at that pin will generate an interrupt
request. The corresponding INTPND1 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 INTPND1 bit.