Creative SB0350 Hardware Programming Guide - Page 83
Creative SB0350 Manual
View all Creative SB0350 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 83 highlights
5-8 MIDI Port I/O Programming Reset The command byte 0FFh is used to reset the MPU-401 interface. After resetting the interface, a Command Acknowledge byte, 0FEh, should be read back from the Data port. This mechanism can also be used to detect the existence of the MPU-401 interface. After an interface reset, the data read in from the Data port should be verified to be 0FEh. If this fails, either the MPU-401 is not installed, or it does not exist at that I/O address. Example code: mov inc Busy: in test jnz mov out sub Empty: in test jnz dec in cmp je inc al,dx al,80h NextLoop dx al,dx al,0FEh ResetOK dx ;Read status port ;Input data ready? ;No ;Data port ;Read data ;Successfully reset? ;SUCCESS! ;Status port al,dx al,40h Busy al,0FFh dx,al cx,cx ;Read status port ;Ready for output? ;No ;Output "Reset" command ; via Command port ;Maximum of 65536 tries dx,wMpuBaseAddx dx ;MPU-401 base I/O address ;Status port NextLoop: loop Empty ;Try again ;*** ;*** Failed to reset: MPU-401 not detected