S1C88348/317/316/308 TECHNICAL HARDWARE
EPSON
I-61
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (Input Ports)
KCP00–KCP07: 00FF52H
KCP10, KCP11: 00FF53HD0, D1
Sets the interrupt generation condition (interrupt
generation timing) for input port terminals K00–
K07, K10 and K11.
When "1" is written: Falling edge
When "0" is written: Rising edge
Reading:
Valid
KCPxx is the input comparison register which
correspond to the input port Kxx. Interrupt in those
ports which have been set to "1" is generated on the
falling edge of the input and in those set to "0" on
the rising edge.
At initial reset, this register is set to "1" (falling edge).
Set constantly "1" for KCP11 (00FF53HD1) in the
S1C88308.
PK00, PK01: 00FF20HD6, D7
PK10, PK11: 00FF21HD0, D1
Sets the input interrupt priority level. The two bits
PK00 and PK01 are the interrupt priority registers
corresponding to the interrupts for K00–K07 (K0L
and K0H). Corresponding to K10–K11 (K1), the two
bits PK10 and PK11 perform the same function.
Table 5.5.4.2 shows the interrupt priority level
which can be set by this register.
Table 5.5.4.2 Interrupt priority level settings
FK0L, FK0H, FK1: 00FF25HD3, D4, D5
Indicates the generation state for an input interrupt.
When "1" is read:
Interrupt factor present
When "0" is read:
Interrupt factor not present
When "1" is written: Reset factor flag
When "0" is written: Invalid
The interrupt factor flag FK0L corresponds to K00–
K03, FK0H to K04–K07, and FK1 to K10–K11 (K11 is
not available in the S1C88308) and they are set to
"1" by the occurrence of an interrupt generation
condition.
When set in this manner, if the corresponding
interrupt enable register is set to "1" and the
corresponding interrupt priority register is set to a
higher level than the setting of interrupt flags (I0
and I1), an interrupt will be generated to the CPU.
Regardless of the interrupt enable register and
interrupt priority register settings, the interrupt
factor flag will be set to "1" by the occurrence of an
interrupt generation condition.
To accept the subsequent interrupt after interrupt
generation, re-setting of the interrupt flags (set
interrupt flag to lower level than the level indicated
by the interrupt priority registers, or execute the
RETE instruction) and interrupt factor flag reset are
necessary. The interrupt factor flag is reset to "0" by
writing "1".
At initial reset, this flag is all reset to "0".
5.5.5 Programming note
When changing the input terminal from LOW level
to HIGH with the built-in pull-up resistor, a delay
in the waveform rise time will occur depending on
the time constant of the pull-up resistor and the
load capacitance of the terminal. It is necessary to
set an appropriate wait time for introduction of an
input port. In particular, special attention should be
paid to key scan for key matrix formation. Make
this wait time the amount of time or more calcu-
lated by the following expression.
Wait time = RIN x (CIN + load capacitance on the
board) x 1.6 [sec]
RIN: Pull up resistance Max. value
CIN: Terminal capacitance Max. value
At initial reset, this register is set to "0" (level 0).
EK0L, EK0H, EK1: 00FF23HD3, D4, D5
How interrupt generation to the CPU is permitted
or prohibited.
When "1" is written: Interrupt permitted
When "0" is written: Interrupt prohibited
Reading:
Valid
The interrupt enable register EK0L corresponds to
K00–K03, EK0H to K04–K07, and EK1 to K10–K11
(K11 is not available in the S1C88308).
Interrupt is permitted in those series of terminals
set to "1" and prohibited in those set to "0".
At initial reset, this register is set to "0" (interrupt
prohibited).
PK11
PK01
PK10
PK00
Interrupt priority level
1
0
1
0
1
0
Level 3 (IRQ3)
Level 2 (IRQ2)
Level 1 (IRQ1)
Level 0 (None)