20
EPSON
S1C62920 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (Input Ports)
EIK0: Interrupt mask register (F3HD0)
Masking the interrupt of the input port can be selected with this register.
When "1" is written:
Enable
When "0" is written:
Mask
Reading:
Valid
With this registers, masking of the input ports can be selected.
At initial reset, this register is set to "0".
IK0: Interrupt factor flag (FBHD0)
This flag indicates the occurrence of input interrupt.
When "1" is read:
Interrupt has occurred
When "0" is read:
Interrupt has not occurred
Writing:
Invalid
The interrupt factor flag IK0 is associated with K00–K03. From the status of this flag, the software can
decide whether an input interrupt has occurred.
This flag is set to "1" by generating the interrupt factor regardless of the interrupt mask register (EIK0)
setting.
Reading of interrupt factor flag is available at EI, but be careful in the following cases.
If the interrupt mask register value corresponding to the interrupt factor flag to be read is set to "1", an
interrupt request will be generated by the interrupt factor flag set timing, or an interrupt request will not be
generated.
This flag is reset when the software reads it.
At initial reset, this flag is set to "0".
4.4.5 Programming notes
(1) When input ports are changed from low to high by pull up resistor, the rise of the waveform is delayed
on account of the time constant of the pull up resistor and input gate capacitance. Hence, when fetching
input ports, set an appropriate wait time.
Particular care needs to be taken of the key scan during key matrix configuration.
Make this waiting time the amount of time or more calculated by the following expression.
Waiting time = RIN
× (CIN + load capacitance on board) × 1.6 [sec]
RIN: pull up resistance (Max. value)
CIN: terminal capacitance (Max. value)
(2) When the input comparison register (KCP00–KCP03) is set, the interrupt factor flag (IK0) may be set to
"1" depending on the status of the input port terminal. Consequently, when setting this register, do it in
the DI status (interrupt flag = "0") and then read the interrupt factor flag in order to reset.
(3) Reading of interrupt factor flag is available at EI, but be careful in the following cases.
If the interrupt mask register value corresponding to the interrupt factor flag to be read is set to "1", an
interrupt request will be generated by the interrupt factor flag set timing, or an interrupt request will
not be generated.