Creative SB0350 Hardware Programming Guide - Page 78

Creative SB0350 Manual

Page 78 highlights

MIDI Port I/O Programming 5-3 Sending MIDI Data The following contrasts the difference between sending MIDI data in Normal mode and UART mode: Normal Mode Under MIDI Normal mode, all the MIDI out data must be preceded by a MIDI output command. The following assembly code fragment shows the process of sending MIDI data to the DSP. Assume that WriteDSP is a procedure that writes data in the AL register to the DSP: mov call mov call al,38h WriteDSP al,bMidiData WriteDSP ; ; ; ; Output MIDI data command Send command to the DSP MIDI data to be sent out Send MIDI data ;**** Repeat the process to send out more MIDI data UART mode In order to send MIDI data in UART mode, DSP commands 34h, 35h, 36h or 37h must first be sent to the DSP to switch the interface into UART mode. Once in UART mode, a read from the DSP reads MIDI data, and a write to the DSP sends MIDI data. To terminate UART mode, send a DSP reset command. The reset command behaves differently while the DSP is in MIDI UART mode. It terminates MIDI UART mode and restores all the DSP parameters to the states prior to entering MIDI UART mode. If your application was run in MIDI UART mode, it important that you send the DSP reset command to exit the MIDI UART mode when your application terminates.

  • 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

MIDI Port I/O Programming
5-3
Sending MIDI Data
The following contrasts the difference between sending MIDI data in Normal mode
and UART mode:
Normal Mode
Under MIDI Normal mode, all the MIDI out data must be preceded by a MIDI output
command.
The following assembly code fragment shows the process of sending
MIDI data to the DSP.
Assume that
WriteDSP
is a procedure that writes data in the
AL
register to the DSP:
mov
al,38h
; Output MIDI data command
call
WriteDSP
; Send command to the DSP
mov
al,bMidiData
; MIDI data to be sent out
call
WriteDSP
; Send MIDI data
;**** Repeat the process to send out more MIDI data
UART mode
In order to send MIDI data in UART mode, DSP commands 34h, 35h, 36h or 37h
must first be sent to the DSP to switch the interface into UART mode.
Once in
UART mode, a read from the DSP reads MIDI data, and a write to the DSP sends
MIDI data.
To terminate UART mode, send a DSP reset command.
The reset command behaves
differently while the DSP is in MIDI UART mode.
It terminates MIDI UART mode
and restores all the DSP parameters to the states prior to entering MIDI UART mode.
If your application was run in MIDI UART mode, it important that you send the DSP
reset command to exit the MIDI UART mode when your application terminates.