24 GENERAL PURPOSE I/O PORTS
S1C38000 TECHNICAL MANUAL
EPSON
219
24 General Purpose I/O Ports
24.1 Overview
The S1C38000 has 6 General Purpose I/O (GPIO) ports (Port A to Port F) and 1 General Purpose
Output (GPO) port (Port G). Ports A, B, and D have 8 pins each, Port C has 1 pin, Port E has 7 pins,
Port F has 5 pins, and Port G has 6 pins. Ports A and B are dedicated GPIO ports. Port C to Port G
are multiplexed with other pin functions. Port C to F can be selected as GPIO or normal function by
system configuration pins (see Section 4.3, “System Configuration Pins” on page 25). Port G can be
selected as GPO or normal function by register settings. Each pin of Port A to F, if selected as GPIO,
can be configured as input or output individually; on reset, all GPIO pins are inputs. Port G pins are
always outputs.
The internal LCDC of the S1C38000 also contains additional multiplexed GPO pins that are
controlled by the LCDC registers. For description of the LCDC’s GPO function, please refer to
Section 15, “LCD Controller” on page 116.
GPIO Port A and Port B can generate interrupts. Each interrupt can be individually configured as
positive or negative and edge or level trigger. All interrupts can be cleared, masked, and their status
readable by software. All 8 interrupt in each ports are ORed together into an interrupt. In other
words, there is one interrupt for Port A and one interrupt for Port B. Optionally, the former interrupt
can be configured to be triggered by both Port A and Port B.
24.2 Block Diagram
Figure 24-1 Interrupt Logic
Note: Before changing type or polarity, the particular interrupt should be masked out. The interrupt status
should also be cleared immediately after the change, in order to prevent generating false interrupt
resulted from the transition.
Figure 24-2 Port A/B Interrupt Request Select Logic
Note: IRQ B is masked off automatically if combined Port A and Port B interrupt is selected.
D
Q
R
0
1
Polarity
Type
GPIO input
Interrupt Clear
Mask
Direction
Interrupt Status
IrqA / IrqB
Reset
0
1
IrqA
IrqB
Combined A+B
IRQ A or IRQ A+B
IRQ B
To Interrupt Controller
Interrupt Select