Jump to content

Have a coherent LCD display


Guest BiBite
 Share

Recommended Posts

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  ;)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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  ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...