9 i/O PORTS (P)
9-10
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
note: The P
x
IMSK registers are available only for P0 and P1 ports.
D[7:0]
P
x
ie[7:0]: P
x
[7:0] Port interrupt enable Bits
Enables or disables each port interrupt.
1 (R/W): Interrupt enabled
0 (R/W): Interrupt disabled (default)
Setting P
x
IE
y
to 1 enables the corresponding P
xy
port input interrupt, while setting to 0 disables the in-
terrupt. Status changes for the input pins with interrupt disabled do not affect interrupt occurrence.
P
x
Port interrupt edge Select Registers (P
x
_eDGe)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
P
x
Port
interrupt edge
Select Register
(P
x
_eDGe)
0x5206
0x5216
(8 bits)
D7–0 P
x
eDGe[7:0] P
x
[7:0] port interrupt edge select
1 Falling edge 0 Rising edge
0
R/W
note: The P
x
EDGE registers are available only for P0 and P1 ports.
D[7:0]
P
x
eDGe[7:0]: P
x
[7:0] Port interrupt edge Select Bits
Selects the input signal edge for generating each port interrupt.
1 (R/W): Falling edge
0 (R/W): Rising edge (default)
Port interrupts are generated at the input signal falling edge when P
x
EDGE
y
is set to 1 and at the rising
edge when set to 0.
P
x
Port interrupt Flag Registers (P
x
_iFlG)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
P
x
Port
interrupt Flag
Register
(P
x
_iFlG)
0x5207
0x5217
(8 bits)
D7–0 P
x
iF[7:0]
P
x
[7:0] port interrupt flag
1 Cause of
interrupt
occurred
0 Cause of
interrupt not
occurred
0
R/W Reset by writing 1.
note: The P
x
IFLG registers are available only for P0 and P1 ports.
D[7:0]
P
x
iF[7:0]: P
x
[7:0] Port interrupt Flag Bits
These are interrupt flags indicating the interrupt cause occurrence status.
1 (R):
Interrupt cause occurred
0 (R):
No interrupt cause occurred (default)
1 (W):
Reset flag
0 (W):
Ignored
P
x
IF
y
is the interrupt flag corresponding to the individual 16 ports of P0 and P1 and is set to 1 at the
specified edge (rising or falling edge) of the input signal. When the corresponding P
x
IE
y
/P
x
_IMSK
register has been set to 1, a port interrupt request signal is also output to the ITC at the same time. An
interrupt is generated if the ITC and S1C17 Core interrupt conditions are satisfied.
P
x
IF
y
is reset by writing 1.
notes: • The P port module interrupt flag P
x
IF
y
must be reset in the interrupt handler routine after a
port interrupt has occurred to prevent recurring interrupts.
• To prevent generating unnecessary interrupts, reset the relevant P
x
IF
y
before enabling in-
terrupts for the required port using P
x
IE
y
/Px_IMSK register.