Jump to content

Recommended Posts

Posted (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 by FantomXR
Posted
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.
 

Posted
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?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...