Creative SB0350 Hardware Programming Guide - Page 41

Creative SB0350 Manual

Page 41 highlights

3-12 Digitized Sound I/O Programming General Procedures for a DMA mode Transfer The general steps for programming the DSP for digitized sound data transfer in DMA mode is as follows: 1. 2. 3. 4. Set up the interrupt service routine. Program the DMA controller. Program the DSP sampling rate. Program the DSP with the DMA transfer mode and length to start I/O transfer. Service DSP interrupts. Restore the original interrupt service routine. 5. 6. Handling the DSP Digitized Sound I/O Interrupt The DSP generates an interrupt at the end of each DSP block transfer. The following lists the general actions needed in the interrupt service routine to handle the interrupt: 1. 2. Preserve machine status. Goto (5) if no more data blocks to transfer. Depending on the operation mode, perform 3a and 4a if you are using singlecycle mode or 3b and 4b if you are using auto-initialize mode. 3a. 4a. 3b. 4b. 5. 6. 7. 8. Program the DMA controller for the next block. Program the DSP for the next block. Transfer data between the DMA buffer and storage buffer. If you wish to quit, send the exit command here. Acknowledge the DSP interrupt. Output the EOI command (End of Interrupt) to the interrupt controller. Restore machine status. Execute an IRET.

  • 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-12
Digitized Sound I/O Programming
General Procedures for a DMA mode Transfer
The general steps for programming the DSP for digitized sound data transfer in DMA
mode is as follows:
1.
Set up the interrupt service routine.
2.
Program the DMA controller.
3.
Program the DSP sampling rate.
4.
Program the DSP with the DMA transfer mode and length to start I/O
transfer.
5.
Service DSP interrupts.
6.
Restore the original interrupt service routine.
Handling the DSP Digitized Sound I/O Interrupt
The DSP generates an interrupt at the end of each DSP block transfer.
The following
lists the general actions needed in the interrupt service routine to handle the
interrupt:
1.
Preserve machine status.
2.
Goto (5) if no more data blocks to transfer.
Depending on the operation mode, perform 3a and 4a if you are using single-
cycle mode or 3b and 4b if you are using auto-initialize mode.
3a.
Program the DMA controller for the next block.
4a.
Program the DSP for the next block.
3b.
Transfer data between the DMA buffer and storage buffer.
4b.
If you wish to quit, send the exit command here.
5.
Acknowledge the DSP interrupt.
6.
Output the EOI command (End of Interrupt) to the interrupt controller.
7.
Restore machine status.
8.
Execute an IRET.