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)
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: ......