SOLVED: Help needed: MIDI Serial Communication issue
Wurlitzer
Posts: 237
SOLVED: see post 3
First: I have a working Prop program which scans my pipe organ keyboards for any digital input changes and creates MIDI messages for each. This program has been working for 3 years.
Second: To create something unique and solve key travel issues which plague most organs I have taken that original program and substituted an analog capture system which, using the Prop Serial terminal is working perfectly. I can see all the data being entered into a circular queue and can see exactly the message which is being processed by the cog handling the MIDI out function. This new program is being run on a standalone Prop with the MIDI output circuit being replicated from the original.
Third: I only have an analog scope and as best as I can tell, the waveforms look similar but as I am looking at a trace which is only triggered when a message is sent it is virtually impossible to tell if the bit duration or pattern is correct. What I can verify is that the Start/Stop bit control is working right.
At this point, again as I am using a cog program for MIDI out which is known to function, I am looking at the output hardware which is as simple as could be but I am open to suggestions as to how to evaluate this serial communication without the purchase of a digital scope, which I am afraid may be my only solution.
The output consists of a 2.2K resistor from the prop to the base of an NPN transistor (already tried replacing it. The emitter is at ground and there is a 220 ohm resistor at the collector which goes to the MIDI plug, then the return from the MIDI plug goes through another 220 ohm resistor to +5 VDC. That is the configuration which is running perfectly fine using the original prop circuitry.
At first I thought maybe the prop clock was off freq but the serial terminal works perfectly @ 38400 baud.
I even played with the baud delay value up to +30/-30 counts from what should be the proper delay.
I have tested the output with 2 programs {MIDI-OX, Hauptwerks} and neither seems to even detect a transmission even though I can see it on the scope.
So again, what I am looking for is any suggestions, short of a digital scope to verify what is actually occurring on this serial communication.
The routine shown below is the MIDI output subroutine copied and pasted from the original working program. (NOTE: there are 2 MIDI out pins controlled by this one for the PC and another for the real pipe organ.) I am only looking at the PC output now.
First: I have a working Prop program which scans my pipe organ keyboards for any digital input changes and creates MIDI messages for each. This program has been working for 3 years.
Second: To create something unique and solve key travel issues which plague most organs I have taken that original program and substituted an analog capture system which, using the Prop Serial terminal is working perfectly. I can see all the data being entered into a circular queue and can see exactly the message which is being processed by the cog handling the MIDI out function. This new program is being run on a standalone Prop with the MIDI output circuit being replicated from the original.
Third: I only have an analog scope and as best as I can tell, the waveforms look similar but as I am looking at a trace which is only triggered when a message is sent it is virtually impossible to tell if the bit duration or pattern is correct. What I can verify is that the Start/Stop bit control is working right.
At this point, again as I am using a cog program for MIDI out which is known to function, I am looking at the output hardware which is as simple as could be but I am open to suggestions as to how to evaluate this serial communication without the purchase of a digital scope, which I am afraid may be my only solution.
The output consists of a 2.2K resistor from the prop to the base of an NPN transistor (already tried replacing it. The emitter is at ground and there is a 220 ohm resistor at the collector which goes to the MIDI plug, then the return from the MIDI plug goes through another 220 ohm resistor to +5 VDC. That is the configuration which is running perfectly fine using the original prop circuitry.
At first I thought maybe the prop clock was off freq but the serial terminal works perfectly @ 38400 baud.
I even played with the baud delay value up to +30/-30 counts from what should be the proper delay.
I have tested the output with 2 programs {MIDI-OX, Hauptwerks} and neither seems to even detect a transmission even though I can see it on the scope.
So again, what I am looking for is any suggestions, short of a digital scope to verify what is actually occurring on this serial communication.
The routine shown below is the MIDI output subroutine copied and pasted from the original working program. (NOTE: there are 2 MIDI out pins controlled by this one for the PC and another for the real pipe organ.) I am only looking at the PC output now.
SendMIDI '2-7-2013 send Status, Data, Velocity sending MSbit first for each 'SEND START BIT (0) ' mov tmp2, #8 '8 data bits mov tmp1, #0 wz ' all this does is set the zero flag muxz outa, MIDI_Out_PC 'send Start Bit for pipe chamber if DIRA is enabled nop 'keeps timing between PC and Pipe midi bits the same muxz outa, MidiOutPipe SendDataBits call #BaudDelay 'waits the appropriate time based upon selected baudrate ror MIDI_PC_Out_Msg,#1 wc 'the carry bit reflects the status of the LSbit muxnc outa, MIDI_Out_PC ' ror MIDI_Pipe_Msg, #1 wc muxnc outa, MidiOutPipe djnz tmp2, #SendDataBits wz 'keep dec tmp2 until all 8 bits sent call #BaudDelay 'waits the appropriate time based upon selected baudrate mov tmp1, #0 wz ' all this does is set the zero flag 'SEND STOP BIT (1) muxnz outa, MIDI_Out_PC' send Stop Bit for pipe chamber if DIRA is enabled nop 'keeps timing between PC and Pipe midi bits the same muxnz outa, MidiOutPipe call #BaudDelay 'waits the appropriate time based upon selected baudrate rol MIDI_PC_Out_Msg, #16 'shift byte just sent then 1 byte more. Next databyte=LSByte rol MIDI_Pipe_Msg, #16 'shift byte just sent then 1 byte more. Next databyte=LSByte djnz NumBytesToSend, #SendMidi wz'number of bytes must be set prior to call SendMIDI SendMIDI_ret ret.
Comments
Can you post a diagram of the circuit you describe below along with whatever it connects to at the other end?
HOWEVER, I found the problem and I can say BLAME the Chinese.(via Radio Shack)
I have 4, 3 foot long MIDI cables. I now know one of them is mis-wired and guess which one I grabbed to do this test. Pins 4 and 5 are swapped. Fortunately no damage was done due to the design of the PC's sound card MIDI Opto input device. The other 3 are wired correctly.
3 days lost thinking I had botched the code somehow.
Thanks for taking the time to read my saga.
I know what you mean about blaming it on China though. I am really getting sick and tired of the cheap "made in China" Smile. I bought a can opener at Walmart a couple of days ago and it quit working on the second can I was opening. I expected a bit better for 10 bucks. Unfortunately it seems to be almost impossible to any household goods, tools, clothing, or similar items that are not made in China.
Who would have thought made in Taiwan, Malaysia, Korea, etc would become a sign of quality?