SUMMARY
These are the steps necessary to produce a steady tone:
1. Define the waveform.
2. Create the data set containing the pairs of data samples (data words). Normally, a data
set contains the definition of one waveform.
3. Set the location registers:
AUDxLCH (high three bits)
AUDxLCL (low fifteen bits)
4. Set the length register, AUDxLEN, to the number of data words to be retrieved before
starting at the address currently in AUDxLC.
5. Set the volume register, AUDxVOL.
6. Set the period register, AUDxPER
7. Start the audio DMA by writing a 1 into bit 9, DMAEN, along with a 1 in the SET/CLR bit
and a 1 in the position of the AUDxEN bit of the channel or channels you want to start.
EXAMPLE
In this example, which gathers together all of the program segments from the preceding
sections, a sine wave is played through channel 0. The example assumes exclusive access
to the Audio hardware, and will not work directly in a multitasking environment.
MAIN:
LEA CUSTOM,a0 ; Custom chip base address
LEA SINEDATA(pc),a1 ; Address of data to
; audio location register 0
WHEREODATA:
MOVE.L a1,AUD0LCH(a0) ; The 68000 writes
; this as though it were
; a 32-bit register at the
; low-bits location
; (common to all locations
; and pointer registers
; in the system).
SETAUDOLENGTH:
MOVE.W #4,AUD0LEN(a0) ;Set length in words
- 142 Audio Hardware -