Digitized Sound I/O Programming
3-21
8-bit Stereo High-speed Single-cycle Transfer
The following are the steps needed to perform 8-bit stereo PCM high-speed single-
cycle DMA mode transfer:
1.
Set up the DSP interrupt service routine.
2.
Enable the interrupt used.
3.
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
4.
Set the hardware to stereo mode.
a. For stereo input:
outp(wSBCB0xC, 0xA8)
b. For stereo output:
i. Set stereo mode.
outp(wSBCB0x4, 0xE)
bTmp = inp(wSBCB0x5)
outp(wSBCB0x5, (bTmp | 0x2))
ii. Program the DMA controller for one byte single-cycle output.
iii. Program the DSP to output one silent byte (value 0x80).
outp(wSBCB0xC, 0x14)
outp(wSBCB0xC, 0)
outp(wSBCB0xC, 0)
iv Upon receiving a DSP interrupt, acknowledge the DSP then exit
the ISR.
5.
Program the DMA controller for 8-bit single-cycle DMA mode transfer.
6.
Set the DSP transfer Time Constant.
outp(wSBCB0xC, 0x40)
outp(wSBCB0xC, bTimeConstant)
7.
Preserve the current input and output filter status, then turn it off.
a.
For stereo input:
outp(wSBCB0x4, 0xC)
bInputFilter = inp(wSBCB0x5)
outp(wSBCB0x5, (bInputFilter | 0x20))
b.
For stereo output:
outp(wSBCB0x4, 0xE)
bOutputFilter = inp(wSBCB0x5)
outp(wSBCB0x5, (bOutputFilter | 0x20))