Creative SB0350 Hardware Programming Guide - Page 48

Creative SB0350 Manual

Page 48 highlights

Digitized Sound I/O Programming 3-19 8-bit Mono High-Speed Auto-initialize Transfer The following are the steps needed to perform 8-bit mono 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) 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) 2. 3. 4. 5. 6. 7. Set the DSP block transfer size. outp(wSBCBaseAddx+0xC, 0x48) outp(wSBCBaseAddx+0xC, wBlkSize.LowByte) outp(wSBCBaseAddx+0xC, 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(wSBCBaseAddx+0xC, bCommand) bCommand is one of the following: bCommand 98h 90h Description 8-bit PCM High-speed input 8-bit PCM High-speed output When the DSP sends an DSP interrupt, the following step should be done in the interrupt service routine: 1. Transfer data between the DMA buffer and the storage buffer.

  • 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-19
8-bit Mono High-Speed Auto-initialize Transfer
The following are the steps needed to perform 8-bit mono 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.
Program the DMA controller for 8-bit auto-initialize DMA mode transfer.
6.
Set the DSP transfer Time Constant.
outp(wSBCBaseAddx+0xC, 0x40)
outp(wSBCBaseAddx+0xC, bTimeConstant)
7.
Set the DSP block transfer size.
outp(wSBCBaseAddx+0xC, 0x48)
outp(wSBCBaseAddx+0xC, wBlkSize.LowByte)
outp(wSBCBaseAddx+0xC, 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(wSBCBaseAddx+0xC, bCommand)
bCommand
is one of the following:
bCommand
Description
98h
8-bit PCM High-speed input
90h
8-bit PCM High-speed output
When the DSP sends an DSP interrupt, the following step should be done in the
interrupt service routine:
1.
Transfer data between the DMA buffer and the storage buffer.