Creative SB0350 Hardware Programming Guide - Page 33

Creative SB0350 Manual

Page 33 highlights

3-4 Digitized Sound I/O Programming Digitized Sound I/O Transfer Rate Other than direct mode, all the digitized sound I/O operation modes require the transfer rate to be set before any transfer is carried out. To set the transfer rate, you may either program the DSP with the respective transfer rate Time Constant (supported by all DSP versions), or program the DSP with the actual sampling rate (only available on DSP version 4.xx). In the former case, a simple conversion has to be done first. Time Constant is the sampling rate representation used by the DSP. It is calculated as follows: Time Constant = 65536 - (256 000 000/(channels * sampling rate)) The channels parameter is 1 for mono and 2 for stereo. Only the high byte of the result is used to program the DSP. Refer to the chapter on "DSP commands" for the commands to set the digitized sound I/O transfer rate. Direct Mode Direct mode digitized sound I/O should be used when direct data input from or output to the DSP is required. Under direct mode, only mono 8-bit unsigned PCM data transfer is supported. The data transfer rate of direct mode is controlled by the application program itself. Usually, the timer interrupt is used to facilitate this implementation. The frequency of the timer interrupt is reprogrammed so that it interrupts at the number of times needed for that particular transfer rate. A new timer interrupt service routine is used to read the in-bound data from or write the out-bound data to the DSP. There is no minimum sampling rate in this case. The maximum depends on how fast the timer interrupt can be programmed, and on how fast the interrupt service routine can service the interrupt. Refer to the chapter "DSP Commands" for details on using the direct mode digitized sound I/O commands.

  • 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

3-4
Digitized Sound I/O Programming
Digitized Sound I/O Transfer Rate
Other than direct mode, all the digitized sound I/O operation modes require the
transfer rate to be set before any transfer is carried out.
To set the transfer rate, you
may either program the DSP with the respective transfer rate Time Constant
(supported by all
DSP versions), or program the DSP with the actual sampling rate
(only available on DSP version 4.xx).
In the former case, a simple conversion has to
be done first.
Time Constant is the sampling rate representation used by the DSP.
It is calculated
as follows:
Time Constant = 65536 - (256 000 000/(
channels
*
sampling rate
))
The
channels
parameter is 1 for mono and 2 for stereo.
Only the high byte of the result is used to program the DSP.
Refer to the chapter on
"DSP commands" for the commands to set the digitized sound I/O transfer rate.
Direct Mode
Direct mode digitized sound I/O should be used when direct data input from or output
to the DSP is required.
Under direct mode, only mono 8-bit unsigned PCM data transfer is supported.
The
data transfer rate of direct mode is controlled by the application program itself.
Usually,
the timer interrupt is used to facilitate this implementation.
The frequency
of the timer interrupt is reprogrammed so that it interrupts at the number of times
needed for that particular transfer rate.
A new timer interrupt service routine is used
to read the in-bound data from or write the out-bound data to the DSP.
There is no minimum sampling rate in this case.
The maximum depends on how fast
the timer interrupt can be programmed, and on how fast the interrupt service routine
can service the interrupt.
Refer to the chapter "DSP Commands" for details on using the direct mode digitized
sound I/O commands.