S1C6S3N2 TECHNICAL SOFTWARE
EPSON
II-99
CHAPTER 5: PERIPHERAL CIRCUITS (Event Counter)
(2) Reading event counter
This program reads the four high order bits of the event
counter to B register, and the four low order bits to A regis-
ter.
A register
B register
D3
D2
D1
D0
D3
D2
D1
D0
EV03
EV02
EV01
EV00
EV07
EV06
EV05
EV04
Fig. 5.10.1
Correspondence between
event counter and general-
purpose register
Specifications
LD
X,0F8H
;
LD
Y,0F9H
;
LD
B,MY
;
LD
A,MX
;
CP
MY,B
;
JP
Z,EV
● ●
● ●
;
LD
A,MX
;
LD
B,MY
;
;
EV
● ●
● ●
: . . .
First reading: Preparation
Load EV04–EV07 data to B register
Load EV00–EV03 data to A register
If there is a carry to EV04–EV07
Redo read: EV00–EV03 data
EV04–EV07 data
Program
To prevent erroneous reading when there is a carry from the
event counter's low order data (EV00–EV03) to the high
order data (EV04–EV07), the counter data is read out mul-
tiple times and compared.
Note
Programming note
To prevent erroneous reading of the event counter data, read
out the counter data multiple times for comparison, and use
the matching data for the result.
Содержание S1C6S3N2
Страница 4: ......
Страница 6: ......
Страница 7: ...Hardware Hardware S1C6S3N2 I Technical Hardware ...
Страница 8: ......
Страница 141: ...Software Software S1C6S3N2 II Technical Software ...
Страница 142: ......
Страница 146: ......