Epson E0C6001 Technical Manual page 117

Cmos 4-bit single chip microcomputer
Table of Contents

Advertisement

E0C6001 TECHNICAL SOFTWARE
Fig. 3.6.2
Timing of the timer
edge counter
II-36
• Checking timer edge
Label
Mnemonic/operand
LD
CP
JP
LD
LD
LD
XOR
FAN
LD
JP
ADD
;
RETURN: RET
This program takes a subroutine form. It is called at short
intervals, and decrements the data at address TMSTAT every
125 ms until the data reaches "0". The timing chart is
shown in Figure 3.6.2. The timer can be addressed using
the X register instead of the Y register.
Note
TMSTAT and TMDTBF may be any address in RAM and not
involve a hardware function.
TM2
Timer edge counter (TMSTAT) decrementing timing
Comment
X,TMSTAT
;
Set address of the timer edge counter
MX,0
;
Check whether the timer edge
;
counter is "0"
Z,RETURN
;
Jump if "0" (Z-flag is "1")
Y,0E4H
;
Set address of the timer
A,MY
;
Read the data of TM0 to TM3
;
into A register
Y,TMDTBF
;
Set address of the timer data buffer
MY,A
;
Did the count on the timer
;
change?
MX,0100B
;
Check bit D2 of the timer data buffer
MY,A
;
Set the data of A register into
;
the timer data buffer
Z,RETURN
;
Jump, if the Z-flag is "1"
MX,0FH
;
Decrement the timer edge counter
;
Return
125 ms

Advertisement

Table of Contents
loading

Table of Contents