Specifications

S1C6S2N7 TECHNICAL SOFTWARE EPSON II-65
CHAPTER 3: PERIPHERAL CIRCUITS (Interrupt and Halt)
SW10RQ:
LD Y,SWFSK ;Address of stopwatch interrupt
;factor flag buffer
FAN MY,0010B ;Check 10 Hz stopwatch interrupt
JP Z,IK0RQ ;Jump if not 10 Hz stopwatch interrupt
CALL SW10IN ;Call 10 Hz stopwatch interrupt service routine
IK0RQ:
LD X,0EDH ;Address of K00 to K03 input interrupt flag
FAN MX,0001B ;Check K00 to K03 input interrupt
JP Z,IMDRQ ;Jump if not K00 to K03 input interrupt
CALL IK0INT ;Call K00 to K03 input interrupt service routine
IMDRQ:
LD X,0ECH ;Address of motor driver interrupt flag
FAN MX,0001B ;Check motor driver interrupt
JP Z,INTEND ;Jump if not motor driver interrupt
CALL MDINT ;Call motor driver interrupt service routine
INTEND:
EI
RET
The above program is normally used to restart the CPU
when in the halt state by interrupt and to return it to the
halt state again after the interrupt processing is completed.
The processing proceeds by repeating the halt interrupt
halt interrupt cycle.
The interrupt factor flag is reset when load by the software.
Thus, when using interrupts which interrupt factor flags are
in the same address at the same time, flag check must be
done after storing the data. For example, store the 1 word
including the factor flag in the RAM. (If check is directly
done by the FAN instruction, the factor flags of the same
address are all reset.)
Reading of interrupt factor flags is available at EI, but be
careful in the following cases.
If the interrupt mask register value corresponding to the
interrupt factor flags to be read is set to "1", an interrupt
request will be generated by the interrupt factor flags set
timing, or an interrupt request will not be generated.