
70
EPSON
S1C88409 TECHNICAL MANUAL
CHAPTER 5: PERIPHERAL CIRCUITS AND OPERATION (Input Ports)
The interrupt selection register SIK0 and input
comparison register KCP0 for the K0 port is used
to set the interrupt generation condition.
Input port interrupt can be enabled or disabled by
the setting of the interrupt selection registers SIK0.
While the interrupt enable register EK0 masks the
interrupt factor for the terminal system (8 bits), the
interrupt selection register SIK0 masks in bit units.
The input comparison register KCP0 selects the
interrupt generation timing that an interrupt is to
be generated at the rising edge or the falling edge
for each input.
When the status of the input terminals in which an
interrupt has been enabled by the interrupt
selection register SIK0 and the content of the input
comparison register KCP0 change from a, match-
ing to no matching, the interrupt factor flag FK0 is
set to "1" and an interrupt is generated.
Figure 5.6.3.2 shows an example of interrupt
generation in the K0 terminal system.
K00 interrupt is disabled by the interrupt selection
register (SIK00), so that an interrupt does not occur
at (2). At (3), K03 changes to "0"; the data of the
terminals K01–K07 in which an interrupt is
enabled no longer match the data of the input
comparison registers KCP01–KCP07, so that
interrupt occurs. As already explained, the condi-
tion for the interrupt to occur is the change in the
port data and contents of the input comparison
registers from matching to no matching. Hence, in
(4), when the no matching status changes to
another no matching status, an interrupt does not
occur. Therefore, to generate the interrupt again
after an interrupt is generated, it is necessary to
return the input terminal status to the same
content as the input comparison register KCP0 or
re-set the input comparison register KCP0.
Further, terminals that have been disabled for
interrupt do not affect the conditions for interrupt
generation.
Interrupt selection register SIK0
Input comparison register KCP0
SIK07
1
SIK06
1
SIK05
1
SIK04
1
Input port K0
(1)
(Initial value)
Interrupt generation
K07
1
K06
1
K05
0
K04
1
SIK03
1
SIK02
1
SIK01
1
SIK00
0
KCP07
1
KCP06
1
KCP05
0
KCP04
1
KCP03
1
KCP02
0
KCP01
1
KCP00
0
With the above setting, the K0 interrupt is generated under the following condition:
(2)
K07
1
K06
1
K05
0
K04
1
(3)
K07
1
K06
1
K05
0
K04
1
(4)
K07
1
K06
1
K05
1
K04
1
K03
1
K02
0
K01
1
K00
0
K03
1
K02
0
K01
1
K00
1
K03
0
K02
0
K01
1
K00
0
K03
0
K02
0
K01
1
K00
0
Because K00 interrupt is disabled,
interrupt will be generated when no
matching occurs between the contents of
the 7 bits K01–K07 and the 7 bits input
comparison register KCP01–KCP07.
Fig. 5.6.3.2 Example of K0 (K00–K07) interrupt generation