
ViPeRiPheRaLMoDuLes4(PoRts):GeneRaL-PuRPosei/oPoRts(GPio)
Vi-1-6
ePson
s1C33L17teChniCaLManuaL
selectinginputpins
For the FPK1 interrupt system, a four-bit input pin group (two input pins when using P8[5:4]) can be selected
from the eight predefined groups. For the FPK0 system, a five-bit input pin group can be selected.
Table VI.1.4.2.1 shows the control bits and the selectable groups for each cause of interrupt.
TableVI.1.4.2.1SelectingPinsforKeyInputInterrupts
Causeof
interrupt
FPK1
FPK0
111
P9[7:4]
P9[4:0]
Controlbit
SPPK1[2:0](D[6:4]) Keyinputinterruptselect
SPPK0[2:0](D[2:0]) register(0x3003D0)
110
P8[5:4]
P8[4:0]
101
P7[3:0]
P5[4:0]
100
P6[7:4]
P6[4:0]
011
P3[3:0]
P4[4:0]
010
P2[7:4]
P2[4:0]
001
P1[7:4]
P1[4:0]
000
P0[7:4]
P0[4:0]
sPPKsettings
Conditionsforkeyinput-interruptgeneration
The key input interrupt circuit has the input mask bits SMPK0[4:0] (D[4:0]/0x3003D4) for FPK0 and
SMPK1[3:0] (D[3:0]/0x3003D5) for FPK1, and the input comparison bits SCPK0[4:0] (D[4:0]/0x3003D2) for
FPK0 and SCPK1[3:0] (D[3:0]/0x3003D3) for FPK1 to set input-interrupt conditions.
*sMPK0[4:0]:FPK0InputMaskBitsintheKeyInputInterrupt(FPK0)InputMaskRegister(D[4:0]/0x3003D4)
*sMPK1[3:0]:FPK1InputMaskBitsintheKeyInputInterrupt(FPK1)InputMaskRegister(D[3:0]/0x3003D5)
*sCPK0[4:0]: FPK0InputComparisonBitsintheKeyInputInterrupt(FPK0)InputComparisonRegister
(D[4:0]/0x3003D2)
*sCPK1[3:0]: FPK1InputComparisonBitsintheKeyInputInterrupt(FPK1)InputComparisonRegister
(D[3:0]/0x3003D3)
The input mask bit (SMPK) is used to mask the input pin that is not used for an interrupt. This bit masks each
input pin, whereas the interrupt enable bit of the interrupt controller masks the cause of interrupt for each inter-
rupt group.
The input comparison bit (SCPK) is used to select whether an interrupt for each input port is to be generated at
the rising or falling edge of the input.
A change in state occurs so that the input pin enabled for interrupt by the interrupt mask bit (SMPK) and the
content of the input comparison bit (SCPK) become unmatched after being matched, the cause-of-interrupt flag
(FK) is set to 1 and, if other interrupt conditions are met, an interrupt is generated.
Figure VI.1.4.2.2 shows cases in which a FPK0 interrupt is generated. Here, it is assumed that the P0[4:0] pins
are selected for the input-pin group and the control register of the interrupt controller is set so as to enable gen-
eration of a FPK0 interrupt.
InputmaskregisterSMPK0
InputcomparisonregisterSCPK0
SMPK04
1
SMPK03
1
SMPK02
1
SMPK01
1
SMPK00
0
InputportP0
(1)
(Initialvalue)
Interruptgeneration
P04
1
SCPK04
1
SCPK03
1
SCPK02
0
SCPK01
1
SCPK00
0
Withthesettingsshownabove,FPK0interruptisgeneratedundertheconditionshownbelow.
(2)
P04
1
(3)
P04
1
(4)
P04
1
P03
1
P02
0
P01
1
P00
0
P03
1
P02
0
P01
1
P00
1
P03
0
P02
0
P01
1
P00
0
P03
0
P02
1
P01
1
P00
0
Becauseinterrupthasbeendisabledfor
P00,aninterruptwillbegeneratedwhen
non-conformityoccursbetweenthe
contentsofthefourbitsP01–P04andthe
fourinputcomparisonbitsSCPK0[4:1].
FigureVI.1.4.2.2FPK0InterruptGenerationExample(whenP0[4:0]isselectedbySPPK0[2:0])