pay_c Posted December 25, 2003 Report Share Posted December 25, 2003 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?? Quote Link to comment Share on other sites More sharing options...
Captain_Hastings Posted December 25, 2003 Report Share Posted December 25, 2003 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_16PotBarsI haven't tried it, but if it works let me know...;D Quote Link to comment Share on other sites More sharing options...
pay_c Posted December 26, 2003 Author Report Share Posted December 26, 2003 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 Quote Link to comment Share on other sites More sharing options...
pay_c Posted December 26, 2003 Author Report Share Posted December 26, 2003 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. :-XHow can I temporarily switch that flashing off? Just for that page? Quote Link to comment Share on other sites More sharing options...
Captain_Hastings Posted December 26, 2003 Report Share Posted December 26, 2003 *beatingmyselfupandbowingbeforecaptaonhastings*LOL It was a shot in the dark tho... ;DI 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? Quote Link to comment Share on other sites More sharing options...
pay_c Posted December 27, 2003 Author Report Share Posted December 27, 2003 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... Quote Link to comment Share on other sites More sharing options...
Duggle Posted December 29, 2003 Report Share Posted December 29, 2003 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! Quote Link to comment Share on other sites More sharing options...
pay_c Posted December 31, 2003 Author Report Share Posted December 31, 2003 OK, Thnx alot, I'll try that within the next days! Quote Link to comment Share on other sites More sharing options...
pay_c Posted January 4, 2004 Author Report Share Posted January 4, 2004 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 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.