II-16
EPSON
S1C6S3N2 TECHNICAL SOFTWARE
CHAPTER 4: INTERRUPT AND HALT
Example of Main Routine: Entering HALT
and waiting for reactivation by interrupt
This main routine enables K00–K03 input interrupt and 2
Hz timer interrupt, after which it enters the HALT status to
wait for reactivation by interrupts.
At every loop, the EI instruction enables an interrupt after
execution of the display routine "DS" (of the watch or what-
ever the application happens to be).
LD
X,75H
;
Enable K00–K03 input interrupt
LD
MX,1111B
;
LD
X,78H
;
Enable 2 Hz timer interrupt
LD
MX,0100B
;
;
MAINLP:
CALL
DS
;
Execute display processing "DS"
EI
;
Enable interrupts
HALT
;
Enter HALT
JP
MAINLP
;
Interrupts' return address: Back to "MAINLP"
This routine assumes that "DS" has been prepared sepa-
rately.
1. This program example is one to follow the initialize
program. Even without executing the DI instruction,
writing to interrupt mask registers is done in the DI
status.
2. When an interrupt is generated, the DI status (interrupt
flag = "0") comes into effect automatically, so the EI
instruction is necessary for each loop.
4.3
Specifications
Program
Notes
Summary of Contents for S1C6S3N2
Page 4: ......
Page 6: ......
Page 7: ...Hardware Hardware S1C6S3N2 I Technical Hardware ...
Page 8: ......
Page 141: ...Software Software S1C6S3N2 II Technical Software ...
Page 142: ......
Page 146: ......