
S1C60N16 TECHNICAL MANUAL
EPSON
23
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (Input Ports)
IK0, IK1: Interrupt factor flags (2EAHD2 and D3)
These flags indicate the occurrence of input interrupt.
When "1" is read out : Interrupt has occurred
When "0" is read out : Interrupt has not occurred
Writing : Invalid
The interrupt factor flags IK0 and IK1 are associated with K00–K03 and K10, respectively. From the status
of these flags, the software can decide whether an input interrupt has occurred.
These flags are reset when the software reads them. Read-out can be done only in the DI status (interrupt
flag = "0").
At initial reset, these flags are set to "0".
4.4.5 Programming notes
(1) When input ports are changed from high to low by pull-down resistance, the fall of the waveform is
delayed on account of the time constant of the pull-down resistance 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. Aim for a wait time
of about 1 msec.
(2) When "Use" is selected with the noise rejector mask option, a maximum delay of 1 msec occurs from
time the interrupt conditions are established until the interrupt factor flag (IK) is set to "1" (until the
interrupt is actually generated). Hence, pay attention to the timing when reading out (resetting) the
interrupt factor flag. For example, when performing a key scan with the key matrix, the key scan
changes the input status to set the interrupt factor flag, so it has to be read out to reset it. However, if
the interrupt factor flag is read out immediately after key scanning, the delay will cause the flag to be
set after read-out, so that it will not be reset.
(3) Input interrupt programming related precautions
Port K input
Factor flag set Not set
Factor flag set
Input comparison
register
Mask register
Active status
Rising edge interrupt
Falling edge interrupt
When the content of the mask register is rewritten while the port K input is in the active status, the
input interrupt factor flags are set at and , being the interrupt due to the falling edge and
the interrupt due to the rising edge.
Fig. 4.4.5.1 Input interrupt timing
When using an input interrupt, if you rewrite the content of the mask register, when the value of the
input terminal which becomes the interrupt input is in the active status, the factor flag for input
interrupt may be set.
Therefore, when using the input interrupt, the active status of the input terminal implies
input terminal = low status, when the falling edge interrupt is effected and
input terminal = high status, when the rising edge interrupt is effected.
When an interrupt is triggered at the falling edge of an input terminal, a factor flag is set with the
timing of shown in Figure 4.4.5.1. However, when clearing the content of the mask register with the
input terminal kept in the low status and then setting it, the factor flag of the input interrupt is again
set at the timing that has been set.