Specifications

Table Of Contents
II-38 EPSON S1C62740 TECHNICAL SOFTWARE
CHAPTER 6: PERIPHERAL CIRCUITS (Clock Timer)
LD A,MX
;
LD X,ZEIT ;SET TO TIMER MASK REGISTER
LD MX,0100B ;ENABLE TIMER 2 Hz INTERRUPT
EI
RET
;
;* CLOCK TIMER INTERRUPT
;
TMINT:
LD X,ZIT ;LOAD TIMER INTERRUPT FLAG
;TO B REGISTER
LD B,MX
FAN B,0100B ;CHECK TIMER 2 Hz INTERRUPT FLAG
JP Z,TMINT1 ;NO, THEN JMP
LD X,ZTML ;SET TO TIMER DATA ADDRESS
LDPX A,MX ;READ TIMER LOW INTO A REGISTER
LD B,MX ;READ TIMER HIGH INTO B REGISTER
;:
; DO THE PROCEDURE FOR 2 Hz INTERRUPT SERVICE
;:
TMINT1:
EI
RET
;
(1) Be sure to data reading in the order of low-order data (TM0–
TM3) then high-order data (TM4–TM7).
(2) When the clock timer has been reset, the interrupt factor flag
(IT) may sometimes be set to "1". Consequently, perform flag
reading (reset the flag) as necessary at reset.
(3) When the clock timer has been reset, the watchdog timer is also
reset.
(4) Write the interrupt mask register (EIT) only in the DI status
(interrupt flag = "0"). Writing during EI status (interrupt flag =
"1") will cause malfunction.
(5) 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 inter-
rupt 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. Be very careful when
interrupt factor flags are in the same address.
Programming notes