FantomXR Posted October 5, 2018 Report Share Posted October 5, 2018 (edited) 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: But even if I change the baudrate or buffersize of the midi-out, the latency stays. Any ideas? Thanks, Chris Edited October 5, 2018 by FantomXR Quote Link to comment Share on other sites More sharing options...
Antichambre Posted October 5, 2018 Report Share Posted October 5, 2018 Just now, FantomXR said: 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. This is normal, MIDI processing in MIOS32 is a periodic Task called every ms. So if you push your button just before the task you will get " 100-200us " if it's just after it will be something like 1ms. Quote Link to comment Share on other sites More sharing options...
FantomXR Posted October 5, 2018 Author Report Share Posted October 5, 2018 Just now, Antichambre said: This is normal, MIDI processing in MIOS32 is a periodic Task called every ms. So if you push your button just before the task you will get " 100-200us " if it's just after it will be something like 1ms. Thanks! I thought it's something like that. Is there a chance to halve that? Quote Link to comment Share on other sites More sharing options...
Antichambre Posted October 5, 2018 Report Share Posted October 5, 2018 Not without changing MIOS32 code, what I will not advise But if you want to try it anyway everything happens in (root)/trunk/programming_models/traditional/main.c The Hook is MIOS32_MIDI_Receive_Handler(APP_MIDI_NotifyPackage) in TASK_MIDI_Hooks.you will need to know about freertos. Good luck ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.