S1C6S3N2 TECHNICAL SOFTWARE
EPSON
II-47
CHAPTER 5: PERIPHERAL CIRCUITS (Output Ports)
(5) Control of BZ frequency (when R13 is R10 control)
This subroutine, "BZ", uses the BZ frequency control to
sound BZ at 4 kHz when the value of the second counter is
implemented in even time, and at 2 kHz for odd time.
The second counter is the seconds column BCD data in the
timer program. This routine assumes that the start address
of the seconds data (that is, the memory address of the 1-
second column BCD data) is defined in "YCKS", the symbol
indicating the address. (In the program example, " 0H".)
The value of the second counter is judged to be even time
(that is, even seconds) or odd time (that is, odd seconds)
depending on whether the D0 data in the BCD data is "0" or
"1". Branching is done depending on this evaluation, and the
BZ is sounded after "0" or "1" is written to the BZFQ register.
Specifications
Program
YCKS
EQU
0H
;
;
;
BZ:
LD
X,0F6H
;
LD
Y,YCKS
;
FAN
MY,0001B
;
JP
NZ,BZ0D
;
;
LD
MX,0000B
;
JP
BZON
;
BZ0D:
LD
MX,1000B
;
;
BZON:
LD
X,7CH
;
OR
MX,0001B
;
RET
;
Start address of second counter
Store the I/O memory BZFQ in the X register
Is the value of the second counter even or odd?
Even: Make BZFQ = "0"
Odd: Make BZFQ = "1"
Output BZ
Return to parent routine
Note
In this program example, the BZ frequency is changed
(according to even seconds or odd seconds) only when "BZ"
is called and executed.
For instance, if "BZ" is executed at even seconds and the BZ
frequency is set to 4 kHz, then the BZ frequency will still be
4 kHz, even if the second counter advances and becomes
odd seconds. As long as "BZ" is not executed again, the
frequency will not change to 2 kHz.
Содержание S1C6S3N2
Страница 4: ......
Страница 6: ......
Страница 7: ...Hardware Hardware S1C6S3N2 I Technical Hardware ...
Страница 8: ......
Страница 141: ...Software Software S1C6S3N2 II Technical Software ...
Страница 142: ......
Страница 146: ......