
S3C821A/P821A
I/O PORTS
9-11
PORT 4 CONTROL REGISTER, LOW BYTE (P4CONL)
R233, E9H, Set 1, Bank 1, R/W
MSB
LSB
.7
.6
.5
.4
.3
.2
.1
.0
Pin 4.3/INT7
Pin 4.2/INT6
Pin 4.1/INT5
Pin 4.0/INT4
Schmitt trigger input mode
Schmitt trigger input, pull-up mode
Push-pull output mode
Open-drain output mode
P4CONL Bit-Pair Pin Configuration Settings:
00
01
10
11
Figure 9-10. Port 4 Low-Byte Control Register (P4CONL)
Port 4 Interrupt Enable and Pending Registers (P4INT, P4PND)
To process external interrupts, two additional control registers are provided: the Port 4 interrupt enable register,
P4INT (R231, E7H, set 1, Bank 0) and the Port 4 interrupt pending register, P4PND (R232, E8H, set 1, Bank 0).
By setting bits in the Port 4 interrupt enable register P4INT to "1", you can use specific Port 4 pins to generate
interrupt requests when specific signal edges are detected. The interrupt names INT4–INT11 correspond to the
pins, P4.0–P4.7. After a reset, P4INT bits are cleared to "00H", disabling all external interrupts.
The Port 4 interrupt pending register P4PND lets you check for interrupt pending conditions and clear the pending
condition when the interrupt request has been serviced. Incoming interrupt requests are detected by polling the
P4PND bit values.
When the interrupt enable bit of any Port 4 pin is set to "1", a rising or falling signal edge at that pin generates an
interrupt request. (Remember that the Port 4 interrupt pins must first be configured by setting them to input mode
in the corresponding P4CONH or P4CONL register.)
The corresponding P4PND bit is then set to "1" and the IRQ pulse goes high to signal the CPU that an interrupt
request is waiting.
When a Port 4 interrupt request has been serviced, the application program must clear the related interrupt
pending register bit by writing a "0" to the pending bit in the P4PND register. Please note that writing a "1" value
has no effect.
Port 4 Interrupt Edge Selection Register (P4EDGE)
P4 interrupt can be generated in falling edge or rising edge, depending on the value of the P4 interrupt edge
selection register (R233, E9H, set 1, Bank 0), P4EDGE. If the value is set to "1", P4 interrupt is generated in
rising edge. If the value is set to "0", P4 interrupt is generated in falling edge.