Epson S1C6S3N2 Technical Manual page 235

Cmos 4-bit single chip microcomputer
Table of Contents

Advertisement

(2) Reading to the stopwatch counter
Specifications
Fig. 5.9.1
Correspondence between
stopwatch counter and
general-purpose register
Program
LD
LD
AND
;
LDPX
LD
;
OR
Note
S1C6S3N2 TECHNICAL SOFTWARE
CHAPTER 5: PERIPHERAL CIRCUITS (Stopwatch Counter)
This program reads the stopwatch counter's 1/100 sec data
to A register and the 1/10 sec data to B register.
A register
D3
D2
D1
SWL3 SWL2 SWL1 SWL0
X,71H
;
Preparation: Store SWL address in X register
Y,7EH
;
Stop the stopwatch counter
MY,1011B
;
A,MX
;
Load SWL data into A register
B,MX
;
Load SWH data into B register
MY,0100B
;
Restart the stopwatch counter
To prevent erroneous reading during carry from the stop-
watch counter's low order column (SWL) to the high order
column (SWH), the stopwatch counter is stopped during
read.
The duration of the stop status must be within 976 µs (256
Hz 1/4 cycle).
EPSON
B register
D0
D3
D2
SWH3 SWH2 SWH1 SWH0
D1
D0
II-89

Advertisement

Table of Contents
loading

Table of Contents