Guest BiBite Posted November 13, 2004 Report Share Posted November 13, 2004 Hi,I'm a newbie to MIOS and uC programming... I wish to program a floorboard to be used with a POD XT (full MIDI guitar amplifier simulator) to learn a bit how to program n assembly. Until here, everything works fine for my little project.But actually, its works too fine to my mind. Let me explain my "problem":- I have a sysex parser than receive bytes from the POD like the name of the current patch.- in this parser, I display the names characters by characters (ie. I display a character each time a SYSEX byte is received...)I don't take any particular attention to the position of the LCD cursor:- when I receive the first character of a patch name, I set the cursor say 1st line, 1st column (MIOS_LCD_CursorSet)- when I receive an event coming from my expression pedal (USER_AIN_NotifyChange) then I set the cursor say n the second line, 1st column and I display its value.With this program, the display is always coherent, all the characters of the names are always displayed on the first line, and the expression pedal value, on the second line :o. Why ? Let's suppose the floorboard is receiving a SYSEX. I detect it, the the LCD cursor on the 1st line, 1st column, and begin to display the first bytes coming... My SYSEX has not yet finished and I move my expression pedal: the LCD cursor is set on the 2nd line the expression pedal value is printed. The last characters of the patch name should then be displayed on the 2nd line, after the epxression pedal value, shouln't it ?So my question is, why everything works fine in my poor application, and how would a good guy do to avoid a compromised display ?thanks ;) Quote Link to comment Share on other sites More sharing options...
pilo Posted November 20, 2004 Report Share Posted November 20, 2004 I think the answer is when the parser function is called, all data needed are already received ;) Quote Link to comment Share on other sites More sharing options...
TK. Posted November 21, 2004 Report Share Posted November 21, 2004 So my question is, why everything works fine in my poor application, and how would a good guy do to avoid a compromised display ?You've already programmed this correctly (although you are new to uC programming --- thats good news! :))MIDI is a very simple protocol, only runtime messages >= 0xf8 are allowed to interrupt the transmission of a MIDI event. So, if your parser ignores all bytes which are greater than 0xf8 (you will find this in most MIOS applications), then you are always on the save side.MIOS itself waits until an incoming MIDI command has been completely received before a notify function for AIN/DIN/ENC events is called. Therefore the Patch name will always be printed completely before a changed expression pedal value will be notified.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Guest BiBite Posted November 25, 2004 Report Share Posted November 25, 2004 OK so MIOS handle everything for us ? Great ;)I thought that any USER routine could be called in any order, but according to what you said, nothing else than USER_MPROC_NotifyReceivedByte is called until a complete SYSEX hasn't been received ?Should I deduce that my expression pedal gets frozen each time a SYSEX is received/sent by the MIDIBox ? Quote Link to comment Share on other sites More sharing options...
TK. Posted November 25, 2004 Report Share Posted November 25, 2004 Should I deduce that my expression pedal gets frozen each time a SYSEX is received/sent by the MIDIBox ?Yes, but in reallity you won't regognize such an effect. E.g., the AIN driver still samples the analog inputs in background (interrupt driven), so changes won't get lost. This system behaviour ensures not only the LCD coherency, but it also solves some other issues (e.g. it prevents MIDI protocol violations if an incoming stream is merged with the outgoing stream)Best Regards, Thorsten. 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.