Jump to content

noob question - where is the main loop?


jcsveth
 Share

Recommended Posts

I am starting to wrap my head around the MIOS code and the FM synth code in particular and have a very basic question - which file has the main operating loop in it?  I am looking to implement my Noritake VFD display into this and enable its software controlled dimming (as opposed to the pots on the CORE board) - putting a setting in the configuration menu.  Has anyone done this?

Regards,  Jeff

Link to comment
Share on other sites

Hi Jeff,

first of all: this won't be a trivial job because the MBFM firmware is not written in a trivial way.

Main focus on the cs_menu handler is not a newbie friendly programming interface, but a powerful UI which consumes so less as memory as possible. Therefore the parameter handling is not easy to understand, and it is spreaded over several files (they all begin with cs_*)

I can only say: read the comments in these files, start to draw diagrams about the program flow (starting point: USER_DISPLAY_Tick in main.asm), take especially a look into cs_menu_tables.inc --- this should help.

Another note: the user memory of the MBFM has nearly reached its limit (there are about 128 bytes free), you will propably not be able to integrate the VFD driver into the application itself. Instead you have to hack this directly into MIOS (you could write the code directly into mios_clcd.inc, this means: just remove the common LCD driver)

Best Regards, Thorsten.

Link to comment
Share on other sites

Hello Thorsten - thank you for the quick reply.  After building the core board and playing with the loader, I quickly saw that my question was really a 'noob' question.  I had not  realized that the MIOS is a set of vectored routines loaded into the hardware first and then the application over this (I assumed the application was compiled with the MIOS routines in it).  DOH!!!  :-[

Is there a LCD parameter file for the MIOS routines?  Specifically, my display is working but I might get spaces in between letters of the words or some garbled letters.  The MIOS loader (without an application) is almost always readable but any application will set the display into an alien language.  I am hoping it is just a timing thing (ie: a data set delay or Enable clock time).  I am searching for the timing requirements for this display now.

Link to comment
Share on other sites

Hi Jeff,

"normal" displays don't need special parameter specs, therefore no comfortable solution is available. But it shouldn't be a big problem for you to add some waitcycles (NOP) to the MIOS_CLCD_Strobe_Set and MIOS_CLCD_Strobe_Clr routines in mios_clcd.inc (begin with 5 NOPs after these labels)

If 5 NOPs don't help, then the most clever solution is to have a look into the datasheets, mostly they include some timing diagrams which help to find out how a read/write transfer must look like

General hint for people who found this article with the search function: this answer is related to VFD displays which are mostly much slower than LCDs, this information is not relevant for LCD displays, all known HD44780 based types are driven properly with the MIOS_CLCD driver. If you display is not working, then it's a "physical" problem (broken wires, shorts, wrong connections), and not a software problem

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...