S1C6S3N2 TECHNICAL SOFTWARE
EPSON
II-45
CHAPTER 5: PERIPHERAL CIRCUITS (Output Ports)
(3) Scanning for key input by ports R00–R03
The key matrix is shown in Figure 5.4.3. This is the scan-
ning subroutine, "KYSC", to specify the key that has been
made high input.
"KYSC" first brings R00 to high output and the other ports
to low output, and then executes "KYIN" to judge whether an
entry has been made to the key connected to R00.
Regardless of the result of evaluation, the high output pin is
shifted to the left and the key connected to the next pin is
evaluated.
This processing is repeated up to R03.
KYSC:
LD
X,7BH
;
LD
MX,0001B
;
;
KYSCLP:CALL
KYIN
;
LD
X,7BH
;
ADD
MX,MX
;
JP
NZ,KYSCLP ;
RET
;
Make R00 only high output
Scanning loop: Execute key input evaluation processing "KYIN"
Shift high output to left
Continue until R00–R03 are all low
Return to parent routine
This routine assumes that the key input evaluation process-
ing routine "KYIN" has been prepared separately.
Program
Specifications
R03
R02
R01
R00
Kxx
Fig. 5.4.3
Key matrix (Kxx
×
R00–R03)
Содержание S1C6S3N2
Страница 4: ......
Страница 6: ......
Страница 7: ...Hardware Hardware S1C6S3N2 I Technical Hardware ...
Страница 8: ......
Страница 141: ...Software Software S1C6S3N2 II Technical Software ...
Страница 142: ......
Страница 146: ......