S1C6S3N2 TECHNICAL SOFTWARE
EPSON
II-93
CHAPTER 5: PERIPHERAL CIRCUITS (Stopwatch Counter)
LD
M
,A
;
LD
X,71H
;
LDPX
A,MX
;
LD
B,MX
;
OR
MY,0100B
;
LD
X,YSWLB
;
LDPX
MX,A
;
LD
MX,B
;
;
LD
X,YSITB
;
FAN
MX,0010B
;
JP
Z,SWDS
;
CALL
SWTM
;
;
SWDS:
CALL
DSSW
;
JP
SWLP
;
in the memory register M
Load SWL data to A register
Load SWH data to B register
Restart the stopwatch counter
Store the value of the A register in RAM, YSWLB
Store the value of the B register in RAM, YSWLB+1
If the ST1Hz interrupt factor flag is set
then
execute stopwatch timer "SWTM"
Executes the stopwatch display routine "DSSW"
Back to SWLP
1. Regardless of the setting of the mask register (EISWIT),
the interrupt factor flag (SWIT) is set to "1" by overflow of
the counter. Therefore, "interrupt generation" is not
used.
2. The stopwatch counter is stopped when being read to, so
as to prevent an error occurring when the counter is
performing carry from the low order column (SWL) to the
high order column (SWH).
Notes
Reference
*
For details about "CT60", see page 63, "Example of using
timer interrupt".
SWTM:
LD
X,YSWL+2
;
CALZ
CT60
;
RET
;
CALZ
CT60
;
RET
;
RET
;
;
Stopwatch timer "SWTM"
Increment the seconds by 1
No carry up to minutes column: Return to parent routine
Carry to higher column: Increment the minutes by 1
No carry up to hours column: Returns to parent routine
Carry to higher column: No carry up to hours column,
return to parent routine
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: ......