ETC DELAY

TITLE:
Delay for some period by playing melody or sound effect
REVISED DATE
REVISED VERSION
APPLY TO CHIPS
APPLY TO SOFTWARE
:
:
:
:
13, JUNE, 1998
1.0
EM57000 Series Chip
ALL EM57000 series coding system above version 2.1
SEE ALSO:
1. In program user may need to implement delay function. For example
it may be necessary to delay ( idle ) for 30 sec waiting user
input, if there are no input comes after 30 sec, chip will power
down automatically.
2. In most condition user may implement delay function with internal
timer. But he can also implement this function with speech or
melody.
3. When use internal timer, please note that for EM57000 series,
internal timer is adjusted.
Following is the simple example for delay with internal timer :
SAVEPWR:
PLAY TAIL.WAV #8
CJP SAVEPWR
; Force D/A current to low
; Now Delay for 10 sec.
MOV
MOV
MOV
MOV
TIMER,
M1
M2
M3
#1
#0
#0
#0
; Set timer for 8 ms interval
; Initial condition
; Initial condition
;
RSTC
LVL1:
CJC UPDATE
JMP LVL1
UPDATE:
CALL KEYSCAN
CALL OUTPUT
MOV
INCA
MOV
CAJE
JMP
; Keyboard scan routine ( every 8 ms )
; Output routine
( every 8 ms )
A
M1
M1
#0
LVL1
A
UPDATE1 ;
8 * 16 = 128 ms passed
UPDATE1:
MOV
INCA
MOV
CAJE
JMP
UPDATE2:
MOV
MOV
INCA
MOV
CAJE
JMP
A
M2
M2
#8
LVL1
A
UPDATE2 ; 128 * 8 = 1024 ms = 1 sec. passed
M2
A
#0
M3
M3
#10
LVL1
A
10SEC
10SEC:
...
; 10 sec passed
4. Following is the example for delay with playing speech :
SAVEPWR:
PLAY TAIL.WAV #8
CJP SAVEPWR
UPDATE:
PLAY
CALL
CALL
CJP
10SEC:
...
; Force D/A current to low
SEC10.WAV #4
SCANKEY
OUTPUT
UPDATE
; 10 sec passed
5. Following is the example for delay with playing melody or
sound effect :
MOV
UPDATE:
PLAY
CALL
CALL
CJP
10SEC:
...
TEMPO
#60
SEC10.MLD
SCANKEY
OUTPUT
UPDATE
; 10 sec passed
6. Note that before goes delay routine it's a good idea
to set D/A to lowest level. That is play a tail section
to force D/A latch with lowest data. Note also that
for melody or sound effect delay routine, it is not
possible to let D/A low while playing melody or sound
effect. If use melody or sound effect section for delay
routine, the current consumption will be far larger than
using "playing speech" or "count internal timer" method.