
Chapter 6
;--set up speech channel 1 control------------------------------
SETUP_SPEECH1:
MOV A, @0
; select speech channel 1
MOV 0x09, A
MOV A, @4000/8/8
IOW 0x0A
; set sample rate: 4M/8/8k=62.5
MOV A, @0
; set speech data start address
IOW 0x06
; address=0x000000
IOW
0x07
IOW
0x08
;--use memory for speech status---------------------------------
BS 0x04, 6
; select bank 3
BS 0x04, 7
MOV A, @0
; use R20 of RAM bank 3 as speech
MOV 0x20, A
; status flag (bit4=1 for active flag)
;--setup speech timer interrupt---------------------------------
MOV A, @0
; write mean value (0) to DAC 1
IOW
0x0B
BS 0x20, 4
; set active flag
BS 0x05, 7
; enable global INT
BS 0x0A, 1
; enable speech output to DAC
BS 0x0A, 0
; enable speech timer INT
;--speech playback loop-----------------------------------------
WAIT:
JBS 0x20, 4
; check active flag in R20 RAM bank 3
JMP WAIT
; if active flag = 1, waiting
BC 0x0A, 0
; else -> flag = 0, disable speech 1 INT
BC 0x0A, 1
; disable speech 1 output to DAC
MOV A, @0x08
; select DAC 1
MOV 0x09, A
BC 0x0A, 0
; turn off DAC 1
OVER:
JMP
OVER
;--------------------------------------------------------------
; speech 1 PCM synthesis subroutine
;--------------------------------------------------------------
SCH1PCM:
IOR 0x09
; read 1-byte speech data
MOV 0x21, A
; store in R21 of RAM bank 3
XOR A, @0x7F
; compare with stop code (0x7F)
JBC 0x03, 2
; check zero flag
JMP SCH1PCM_STOP ; if equal, go to stop playing
MOV A, 0x21
; not equal, write data to DAC
IOW 0x0B
; write to DAC 1
EM60000 Series User’s Manual
Software Application
•
95
RETS
Содержание EM60000 series
Страница 8: ...Contents viii Contents EM60000 Series User s Manual ...
Страница 24: ...Chapter 2 16 Architecture EM60000 Series User s Manual ...
Страница 54: ...Chapter 4 46 Special Function Control EM60000Series User s Manual ...
Страница 80: ...Chapter 5 72 Instruction Set EM60000Series User s Manual ...