Digitized Sound I/O Programming
3-15
8-bit Mono Auto-initialize Transfer
The following are the steps needed to perform 8-bit mono PCM and ADPCM
auto-initialize DMA mode transfer:
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.
Turn on the DAC speaker for digitized output. Otherwise, turn it off.
outp(wSBCB0xC, 0xD3)
to turn off the DAC speaker
outp(wSBCB0xC, 0xD1)
to turn on the DAC speaker
5.
Program the DMA controller for 8-bit auto-initialize DMA mode transfer.
6.
Set the DSP transfer Time Constant.
outp(wSBCB0xC, 0x40)
outp(wSBCB0xC, bTimeConstant)
7.
Set the DSP block transfer size.
outp(wSBCB0xC, 0x48)
outp(wSBCB0xC, wBlkSize.LowByte)
outp(wSBCB0xC, wBlkSize.HighByte)
If an 8KB DMA buffer is used, the DSP block transfer size should be set to
4KB. At the end of every 4KB transfer, the DSP will generate an interrupt
to the application until the exit auto-initialize DMA mode command is
received. Again,
wBlkSize
is one less than the actual transfer size.
8.
Send an I/O command to start auto-initialize DMA mode transfer.
outp(wSBCB0xC, bCommand)
bCommand
is one of the following:
bCommand
Description
2Ch
8-bit PCM input
1Ch
8-bit PCM output
7Dh
8-bit to 4-bit ADPCM output with reference byte
7Fh
8-bit to 3-bit ADPCM output with reference byte
1Fh
8-bit to 2-bit ADPCM output with reference byte