3-28
Digitized Sound I/O Programming
8-bit or 16-bit Auto-initialize Transfer
The following are the steps needed to perform 8-bit or 16-bit and mono or stereo
PCM auto-initialize DMA mode transfer on DSP version 4.xx:
1.
Allocate a DMA buffer in contiguous memory without straddling a 64KB
physical page boundary. Use an 8KB buffer as an example.
2.
Set up the DSP interrupt service routine.
3.
Enable the interrupt used.
4.
Program the DMA controller for 8-bit or 16-bit auto-initialize DMA mode
transfer.
5.
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.
6.
Send an I/O command, followed by the transfer mode, and the DSP block
transfer size.
outp(wSBCB0xC, bCommand)
outp(wSBCB0xC, bMode)
outp(wSBCB0xC, wBlkSize.LowByte)
outp(wSBCB0xC, wBlkSize.HighByte)
bCommand
is one of the following:
bCommand
Description
CEh
8-bit input
C6h
8-bit output
BEh
16-bit input
B6h
16-bit output