Jump to content

Fixed Pot Row Displays?


pay_c
 Share

Recommended Posts

Hi there!

Since TK will not be on until the 1st, I'm trying my luck here.

(This goes especially to duggle - since he already programmed something like that).

I want to display all 64 Pots of the MB64 on a 16x4 Display. Problem: MIOS only offers adresses of actual moved Pots (CURENT POT and LAST POTO and so on). And those are indirect adresses. So I have no chance to display the first pot row at the first line and so on. I already tried direct adressing and using other things, but I just dont get the clue...

Any tip how I could do that? Just a hint??

Link to comment
Share on other sites

You can call the function MB64_LCD_16PotBars (mb64_lcd.inc) 4 times for each row and for pot numbers 0, 16, 32 and 48.

I think this should work:

movlw      0x00
call      MIOS_LCD_CursorSet
movlw      0x00
call      MB64_LCD_16PotBars
movlw      0x40
call      MIOS_LCD_CursorSet
movlw      0x10
call      MB64_LCD_16PotBars
movlw      0x80
call      MIOS_LCD_CursorSet
movlw      0x20
call      MB64_LCD_16PotBars
movlw      0xC0
call      MIOS_LCD_CursorSet
movlw      0x30
call      MB64_LCD_16PotBars

I haven't tried it, but if it works let me know...

;D

Link to comment
Share on other sites

I haven't tried yet, but I'm pretty sure that this wont work. Like I said: The Pots are not directly adressed and the 16POTBARS Function always uses the MB64_CURRENT_POT, so it would display the actual row four times (I think).

Anyhow I'll try... everything ...  ;D

Link to comment
Share on other sites

OMG!!! Me absolutely stupid !!!  :-[ :-[ :-[

*beatingmyselfupandbowingbeforecaptaonhastings*

And I thought I would understand MIOS at least just a *little* bit. Wrong...

Worked! No idea why I didn't get that idea! Argh!!!

So... it works, but the first pots in a row now always flash (they are assumed to be the actual pots). I also tried a little bit around, but as it seems I'll also never get the clue there, too.  :-X

How can I temporarily switch that flashing off? Just for that page?

Link to comment
Share on other sites

*beatingmyselfupandbowingbeforecaptaonhastings*

LOL  

It was a shot in the dark tho... ;D

I would try to write a new function that loops for 4 lines of 16 chars for each pot and calls MB64_LCD_PrnVBar per character, just like MB64_LCD_xPotBars. Every 16 pots shifting a line down.

Or adapt the MB64_LCD_16PotBars, setting TMP1 to something impossible before you call MB64_LCD_xPotBars, but i think you've been trying that already?

Link to comment
Share on other sites

No, I didn't. Reason: I'm trying to adapt the display without changing the MB64_LCD. I'm trying to only modificate CS_M_DISPLAY. TK suggested me to do that for an easier implementation (a few things will change with the next release).

I only want to change MB64_LCD if nothing else works...

Link to comment
Share on other sites

hi pay_c,

(I hope) you have looked at cs_m_display.inc for the example of adding a display page.

The code I wrote was some months ago and I'm now a bit rusty on the details now.

You really need to look at what Thorsten does to achieve what the existing display pages do (mine is neccessarily  more complex) .

I take it that what you want is simply what the original MB64 did and that is provide a bar graph for each of the 64 pots at once.

If memory serves me:

MB64_POT_VALUES_00 is the RAM location of the first pot value so that (MB64_POT_VALUES_00 + 63) is the value of pot 64.

Use the variable MB64_LAST_POT0 to get the address of the most recent changing pot. (you dont want to update all 64 every time!)

Like I said, get familiar with what Thorsten has written before trying to write/add code yourself! (this will save you much grief, however it is hard work and not that fun, it is the only way to learn properly, it will be quicker in the long run).

cheers!

Link to comment
Share on other sites

OK, all done. TK sent me some new code for MB64_LCD_16PotBars, which is also compatible to the old one (I have to admit, I would have *N E V E R* found a solution like that...).

Works perfect now! In a few days (perhaps), I will send him the new code.

Greets & THNX !  ;D

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