3-26
Digitized Sound I/O Programming
8-bit or 16-bit Single-cycle Transfer
The following are the steps needed to perform 8-bit or 16-bit and mono or stereo
PCM single-cycle DMA mode transfer on DSP version 4.xx:
1.
Set up the DSP interrupt service routine.
2.
Enable the interrupt used.
3.
Program the DMA controller for 8-bit or 16-bit single-cycle DMA mode
transfer.
4.
Set the DSP transfer sampling rate.
outp(wSBCB0xC, bCommand)
outp(wSBCB0xC, wSamplingRate.HighByte)
outp(wSBCB0xC, wSamplingRate.LowByte)
bCommand
is one of the following:
bCommand
Description
42h
Input
41h
Output
Contrast the sampling rate with the DSP transfer Time Constant. For
example, at a 44100 Hz sampling rate,
wSamplingRate.HighByte
=
ACh, and
wSamplingRate.LowByte
= 44h.
5.
Send an I/O command, followed by the transfer mode, and the data transfer
count.
outp(wSBCB0xC, bCommand)
outp(wSBCB0xC, bMode)
outp(wSBCB0xC, wLength.LowByte)
outp(wSBCB0xC, wLength.HighByte)
bCommand
is one of the following:
bCommand
Description
C8h
8-bit input
C0h
8-bit output
B8h
16-bit input
B0h
16-bit output