
Chapter 6
READ_LOOP:
IOR 0x09
; read 1-byte data from IOC9 to A
MOV 0x0C,A
; move accumulator data to port2
CALL
DELAY65
JMP
READ_KOOP
;--------------------------------------------------------------
; delay subroutine for Fosc = 4MHz
; total delay =
; (1+1+255+255+255*255+255*255+255+255)*0.5us=65.5ms
;--------------------------------------------------------------
DELAY65:
MOV A, @0xFF
; 1 cycle
MOV 0x14, A
; 1 cycle
DL60: MOV A, @0xFF
; 255 cycles
MOV 0x15, A
; 255 cycles
DL61: DJZ 0x15
; 255*255 cycles
JMP DL61
; 255*255 cycles
DJZ 0x14
; 255 cycles
JMP DL61
; 255 cycles
RET
6.8 Playing Speech
To play speech data, you should set up the Speech Function control registers for
speech interrupts, and the DAC Function control registers for D/A conversion.
Refer to the Chapter 4,
Special Function Control
, for details.
The following steps provides the required procedure
:
1. Prepare the speech interrupt subroutines.
2. Select the DAC control registers by setting R9; set the volume and assign
the speech channel, then turn on the DAC.
3. Select speech Channel 1 or 2 control by setting R9.
4. Set up the interrupt interval for correct speech sampling rate; write the
proper value into the IOCA control register.
5. Write the initial address of the speech data to IOC6~8.
6. Write the initial value to IOCB and IOCC (output registers connect to the
mixers of DAC 1 & 2). In general, you will write “0” (mean value) to them.
7. Enable the output data to the DAC mixer by setting the SENA bit in the RA
(MODE) register.
8. Enable the global interrupt (ENI), and enable the speech timer interrupt by
setting the SENT bit in the RA (MODE) register.
EM60000 Series User’s Manual
Software Application
•
93
Содержание 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 ...