Hey people,
for a project of mine I need high speed on the MIDI output.
I took the NG-firmware and cleaned it from all the stuff that I do not need. Also I added this line to my app.c which speeds up the scanrate of the SRIO significantly
MIOS32\_SPI\_TransferModeInit(MIOS32\_SRIO\_SPI, MIOS32\_SPI\_MODE\_CLK1\_PHASE1, MIOS32\_SPI\_PRESCALER\_8);
I think the standard prescaler is at 64 or so. This gives me an ultra high scanning frequency for the SRIO chain and it works great. I can not see any loss of data.
My setup looks like this: I have the core and a DIO-Matrix connected to it. I connected a simple switch to the DIO-Matrix which sends a note event to the midi-port.
I connected my oscilloscope to this setup. The first channel is directly connected to the switch, the second channel is connected to the midi-output. Due to the open-drain-mode of the MIDI-out I need to bridge pin4 and pin5 of the midi-jack to get accurate results. The wiring of the MIDI-out is straight forward: Pin 4 is connected to +5V via 220Ohm. Pin 5 is connected to the core via 220Ohm.
So what I notice here is the time between pressing the switch and the midi-out signal differs any time I press the button. Sometimes it’s only 100-200us, sometimes it’s more than a millisecond.
I’d like to know where this comes from and if it’s possible to minimize this latency.
Also I’d like to know why the gap between pressing the switch and midi-out signal differs and doesn’t stay the same (which would I expect if there is a buffer involved).
We had a discussion about speed in the past:
http://discourse.midibox.org/t/topic/19817
But even if I change the baudrate or buffersize of the midi-out, the latency stays.
Any ideas?
Thanks,
Chris