
II-56
EPSON
S1C88348/317/316/308 TECHNICAL SOFTWARE
10 CLOCK TIMER
(1)
(2)
Source List
(1) Initialization for clock timer
org
intr_vectors+clock
;************************************************************************
;*
*
;*
clock timer initialize (32,8,2 and 1hz interrupt enable)
*
;*
*
;************************************************************************
;*** initialize routine
clock_init:
ld
br,#br_io
;set br reg. address to 0ffxxh
ld
a,[br:low intr_pr0]
;interrupt priority reg.
and
a,#11111100b
or
a,#00000001b
ld
[br:low intr_pr0],a
;set ptm=/irq1
;etm32,etm8,etm2 and etm1 (en. /irq1) intr.
or
[br:low intr_en0],#00001111b
or
[br:low clock_mode],#00000010b
;clock timer counter reset
or
[br:low clock_mode],#00000001b
;clock timer start
and
sc,#00111111b
;i1 and i0 flag clear
;************************************************************************
;*** start clock timer interrupt
;
jrl
user_program
;
(2) 32 Hz clock timer interrupt processing
;************************************************************************
;*
*
;*
clock timer 32hz interrupt processing routine
*
;*
*
;************************************************************************
clock32_intr:
push
ale
;
ld
br,#br_io
;set br reg. address to 0ffxxh
;
clock timer 32hz processing routine
;
and
[br:low intr_fac0],#00001000b
;clear etm32 flag
pop
ale
rete
(2) 8 Hz clock timer interrupt processing
;************************************************************************
;*
*
;*
clock timer 8hz interrupt processing routine
*
;*
*
;************************************************************************
clock8_intr:
push
ale
;
ld
br,#br_io
;set br reg. address to 0ffxxh
;
clock timer 8hz processing routine
;
and
[br:low intr_fac0],#00000100b
;clear etm8 flag
pop
ale
rete