Hi Robin,
I have not used MIOS Studio yet. Would it help in this case do you think?
Yes, I think so. MIOSStudio provides two very good helps:
First, you have an MIDI I/O Monitor, that means you see what goes in and you see what comes out (similar to MidiOx). In that case, where you’re experiencing strange behavior of Midi_ox, it would be ideal to test wheather it’s the software or not.
Second, MIOSStudio has a very good implementation of MIOS Function Calls. You just have to select the function, type a parameter and press Send. Then you’ll see the return values. (Of course you first have to setup the In- and Out-Midi Port, but that’s all that has to be done to get this program running).
So, in your case, you could separately check where the problem is. Send a single MIOS_DIN_PinGet(6) Function call and see what happens.
If everything works, you’ll know for sure, that it’s in your code, then we’ll see what to do next…
What sort of software error could cause a problem like this.
Very strange behavior like this could be also a buffer overflow. Any variable storing a too high value for its datatype (eg. an unsigned char wants to store the number 1024, but unsigned chars are 8bit and therefor can only store values up to 255), puts the 3bit overhead-value just somewhere. And that’s pretty unpredictable where the garbled data goes…
In other words: think of filling 2 cans of water in a coffe machine that only can hold 1 can of water. The additional 1 can if flowing over. If it flows into the power-plug: BANG!
However, when you change the code and the result is every time exactly the same, it is more likely to be another kind of error, because the overflow would happen somewhere else.
All right, let’s summarize:
-
the MIOS application crashes, the pic reboots if you press button 6 and (some button from 19 to 25)
-
DIN_PinGet(6) is working in some other parts, but no in DIN_Notify()
-
the MIOS app does not crash when pressing only pin 6
-
the MIOS app does not crash when pressing any pin between 19 and 25
-
the MIOS app crash shows in rebooting the pic and sending a sysEx string by the 2nd level bootloader
right?
I would first check MIOS_DIN_PinGet(x) with MIOSStudio.
If this reveals no new insights, you should post a bit more of your code…
I hope this helps,
Best regards,
Michael