Creative SB0350 Hardware Programming Guide - Page 52

Creative SB0350 Manual

Page 52 highlights

Digitized Sound I/O Programming 3-23 8-bit Stereo High-Speed Auto-initialize Transfer The following are the steps needed to perform 8-bit stereo PCM high-speed autoinitialize 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. Set up the DSP interrupt service routine. Enable the interrupt used. Turn on the DAC speaker for digitized output. Otherwise, turn it off. to turn off the DAC speaker outp(wSBCBaseAddx+0xC, 0xD3) to turn on the DAC speaker outp(wSBCBaseAddx+0xC, 0xD1) Set the hardware to stereo mode. a. For stereo input: outp(wSBCBaseAddx+0xC, 0xA8) 2. 3. 4. 5. b. For stereo output: i. Set stereo mode. outp(wSBCBaseAddx+0x4, 0xE) bTmp = inp(wSBCBaseAddx+0x5) outp(wSBCBaseAddx+0x5, (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(wSBCBaseAddx+0xC, 0x14) outp(wSBCBaseAddx+0xC, 0) outp(wSBCBaseAddx+0xC, 0) iv. Upon receiving a DSP interrupt, acknowledge the DSP then exit the ISR. 6. 7. Program the DMA controller for 8-bit auto-initialize DMA mode transfer. Set the DSP transfer Time Constant. outp(wSBCBaseAddx+0xC, 0x40) outp(wSBCBaseAddx+0xC, bTimeConstant) 8. Preserve the current input and output filter status, then turn it off. a. For stereo input: outp(wSBCBaseAddx+0x4, 0xC) bInputFilter = inp(wSBCBaseAddx+0x5) outp(wSBCBaseAddx+0x5, (bInputFilter | 0x20)) b. For stereo output: outp(wSBCBaseAddx+0x4, 0xE) bOutputFilter = inp(wSBCBaseAddx+0x5) outp(wSBCBaseAddx+0x5, (bOutputFilter | 0x20))

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141

Digitized Sound I/O Programming
3-23
8-bit Stereo High-Speed Auto-initialize Transfer
The following are the steps needed to perform 8-bit stereo PCM high-speed 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(wSBCBaseAddx+0xC, 0xD3)
to turn off the DAC speaker
outp(wSBCBaseAddx+0xC, 0xD1)
to turn on the DAC speaker
5.
Set the hardware to stereo mode.
a.
For stereo input:
outp(wSBCBaseAddx+0xC, 0xA8)
b.
For stereo output:
i.
Set stereo mode.
outp(wSBCBaseAddx+0x4, 0xE)
bTmp = inp(wSBCBaseAddx+0x5)
outp(wSBCBaseAddx+0x5, (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(wSBCBaseAddx+0xC, 0x14)
outp(wSBCBaseAddx+0xC, 0)
outp(wSBCBaseAddx+0xC, 0)
iv. Upon receiving a DSP interrupt, acknowledge the DSP then exit
the ISR.
6.
Program the DMA controller for 8-bit auto-initialize DMA mode transfer.
7.
Set the DSP transfer Time Constant.
outp(wSBCBaseAddx+0xC, 0x40)
outp(wSBCBaseAddx+0xC, bTimeConstant)
8.
Preserve the current input and output filter status, then turn it off.
a.
For stereo input:
outp(wSBCBaseAddx+0x4, 0xC)
bInputFilter = inp(wSBCBaseAddx+0x5)
outp(wSBCBaseAddx+0x5, (bInputFilter | 0x20))
b.
For stereo output:
outp(wSBCBaseAddx+0x4, 0xE)
bOutputFilter = inp(wSBCBaseAddx+0x5)
outp(wSBCBaseAddx+0x5, (bOutputFilter | 0x20))