Epson S1C6S3N2 Technical Manual page 191

Cmos 4-bit single chip microcomputer
Table of Contents

Advertisement

(3) Scanning for key input by ports R00–R03
Specifications
Fig. 5.4.3
Key matrix (Kxx × R00–R03)
Program
KYSC:
LD
LD
;
KYSCLP:CALL
LD
ADD
JP
RET
S1C6S3N2 TECHNICAL SOFTWARE
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.
X,7BH
;
Make R00 only high output
MX,0001B ;
KYIN
;
Scanning loop: Execute key input evaluation processing "KYIN"
X,7BH
;
MX,MX
;
NZ,KYSCLP ;
;
Return to parent routine
This routine assumes that the key input evaluation process-
ing routine "KYIN" has been prepared separately.
EPSON
CHAPTER 5: PERIPHERAL CIRCUITS (Output Ports)
Kxx
R03
R02
R01
R00
Shift high output to left
Continue until R00–R03 are all low
II-45

Advertisement

Table of Contents
loading

Table of Contents