The
following example shows how to stop audio
DMA
for one channel.
CLEAR EQU 0
STOPAUDCHANO:
MOVE.W #(CLEAR
+
AUDOEN),
DMACONW
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). Nor-
mally, 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
SETCLR
bit
and a 1
in
the position of the AUDxEN bit of the channel or chan-
nels 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
O.
Audio Hardware
145