lazlos

SOLVED! MBLC! four 2x16 CLCD seems like it should work but isn't working

8 posts in this topic

So, over the last weeks I have been working on my MBLC everything is working now except for the displays.

 

hooked up with just one 2x16 it is working but obviously only a small part of the output is visible.

I had  4 2x16s already so instead of doing the 2x40 display I wanted to try this as it looks to be working here: http://www.midibox.org/dokuwiki/doku.php?id=drive_a_midibox-lc_with_4_lcds_on_1_core#firmware

 

the link to the firmware on that page is broken but I believe I tracked it down here:

http://svnmios.midibox.org/listing.php?repname=svn.mios&path=%2Ftrunk%2Fmodules%2Fapp_lcd%2Fclcd_multi%2F&rev=346&peg=346

 

the readme says:

 

Id: README.txt 347 2008-06-05 23:58:53Z tk $

Custom Driver for multiple CLCD displays (selected with LCD type #7)


Documentation
~~~~~~~~~~~~~

  -> see app_lcd.inc


Files
~~~~~

  app_lcd.inc: can be included into "asm-only" programs (non-relocatable code)
  app_lcd.asm: relocatable wrapper for C based applications
  app_lcd.mk:  include this into Makefile to integrate the driver


Integration Hints
~~~~~~~~~~~~~~~~~

C based Applications
~~~~~~~~~~~~~~~~~~~~

  1) Makefile: add "app_lcd.o" to OBJS variable

  2) Makefile: include app_lcd.mk

---
# include application specific driver
include $(MIOS_PATH)/modules/app_lcd/clcd_multi/app_lcd.mk
---

  3) main.c: add MIOS_LCD_TypeSet(0x07, 0x00, 0x00); to select Custom Drivers
     The second and third value are not used by the driver

  4) CLCDs can be selected with USER_LCD_Select(<number>);  // number 0..7
     see also the example application under $MIOS_PATH/apps/examples/lcd7/clcd_multi


"Assembler-Only" Applications
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  1) main.asm (or main.inc): ensure, that the application includes 
     the global <app_lcd.inc> instead of "app_lcd.inc"

  2) Makefile: include app_lcd.mk

---
# include application specific driver
include $(MIOS_PATH)/modules/app_lcd/clcd_multi/app_lcd.mk
---

  3) main.asm (or main.inc): call MIOS_LCD_TypeSet from USER_Init hook:
---
    ;; select LCD type #7 (custom LCD driver, hooks in app_lcd module will be used)
    clrf    MIOS_PARAMETER1 ; variable enable pin not provided
    clrf    MIOS_PARAMETER2 ; variable enable pin not provided
    movlw   0x07
    call    MIOS_LCD_TypeSet
---

  4) CLCDs can be selected by calling USER_LCD_Select (expecting number 0..7 in WREG)
     see also the example application under $MIOS_PATH/apps/examples/lcd7/clcd_multi


Integration Examples
~~~~~~~~~~~~~~~~~~~~

  -> see $MIOS_PATH/apps/examples/lcd7/clcd_multi

 

following the instructions for assembler only applications I changed "app_lcd.inc" to <app_lcd.inc>

 

added:

# include application specific driver
include $(MIOS_PATH)/modules/app_lcd/clcd_multi/app_lcd.mk

to makefile.orig

 

added:

 

;; select LCD type #7 (custom LCD driver, hooks in app_lcd module will be used)
    clrf    MIOS_PARAMETER1 ; variable enable pin not provided
    clrf    MIOS_PARAMETER2 ; variable enable pin not provided
    movlw   0x07
    call    MIOS_LCD_TypeSet

 

to main.inc on line 58 right after clrf LC_MTC_CURSOR

 

but the 4th instruction kind of baffles me.  first I tried it without it and it would compile but when I loaded the hex through mios studio it would freeze on the mios screen then I tried simply adding

USER_LCD_Select (<3>)
USER_LCD_Select (3)
USER_LCD_Select (0x03)

but none of these would compile

 

I then tried:

movlw    0x03
call    USER_LCD_Select

and this one compiled but got the same result as before freeze on mios screen

 

anyway, by this point it should be clear I don't have a motherlickin clue about this code...

 

can anyone help me out? pleasse.... I need sleep....

 

 

Edited by lazlos

Share this post


Link to post
Share on other sites

why don´t you get a new lpc17 core? that would solve all your lcd problems almost instantly, since you could connect up to 64 lcds and it would drastically decrease the coding effort.

there is already a logic control script available for the new mb_ng firmware.

 

 

EDIT: i belive i tracked down the firmware you were looking for (the mblc firmware to use with 4 lcds, right?). the link on that 4-lcd page leads to an old forum topic, which can not be opened anymore. but you can type "11553.0" into the search field of the forum and you get to an old topic where the firmware can be found (somewhere on page 2).

Edited by John E. Finster

Share this post


Link to post
Share on other sites

hey john thankyou very much for the tip

 

when I ordered the parts the LPC version was not available yet and now everything is assembled... if only it would work.

 

I think that was the firmware I was looking for.

 I tried it out and all the displays came on and showed letters but the system was rebooting constantly and the first screen showed

 

MOS V1.g

© 2009 T

and other variations none of which where the normal startup screen then the logic emulation screen would come up and then the system would reboot. 

 

after a lot of fiddling about I replaced the files in clcd_app/clcd_multi/  with the newer ones from my link above.  that stabilized the system and it stopped rebooting. after some more fiddling I now have the first screen stuck on MOS V1.g... and the other 3 screens responding to the track names.  all the buttons work but my V-pots dont work and the shuttle enc only goes one way.  !?!?!?

 

the enc are assigned to the proper shift registers in setup_midibox_lc. and when I go back to the straight setup_midibox_LC without the multi_clcd mods everything works except I only have one 2x16 display! so this has to be a software issue i guess.  I would like to fix this but I don't really know how to debug this further and track the problem...

 

I noticed that in the driver pack I used there is a mention of USER_LCD_SELECT but NOT in the one that was included in the app package from post 11553.0 I can't find any info on how to use this or what it is.

 

it seems like this thing is on the verge of working but refuses. patience...patience..

Share this post


Link to post
Share on other sites

Quickly skimming this thread: Did you realise MIDIbox NG does run on a STM32 core (if you flash the appropriate binary, of course).

If there is a logic control config available then I'd definitely look at this route. 

 

[edit] o.k, so you're currently using a 8 bit core, in that case a new LPC core would be handy! 

Edited by Duggle

Share this post


Link to post
Share on other sites

and even if you assembled everything already, you can keep everything. you just need to change the core module. i even believe you can ceep the old core module to drive just the motorfaders (i´m just assuming you have some) so you wouldn´t need to get a seperate mf_ng module.

 

EDIT: There is a comment in the 11553.0 topic about the rebooting problem: it is said there that Resistor R10 of the core module has to be clamped to ground with this firmware. R10 is connected to 5V by default.

 

maybe you try that and use the original x4 firmware from this topic again.

 

EDIT2: also check if you are using 4-bit lcds. if so, you have to disconnect D01-D03 from the the core to the lcds.

Edited by John E. Finster

Share this post


Link to post
Share on other sites

thanks very much for the help.

 

so, messing around with this more I found http://www.ucapps.de/mios/lcd7_clcd_multi_v1a.zip which appears to be the same as the one I found before, except this one has a program which displays hello world.  when I loaded it it only ran hello world on the 2nd third and fourth LCDs while the Mios C screen stayed frozen on the first.

 

It would seem the LCD works best in 8 bit connection,  though I can't find it anywhere on the documentation or thing itself but i tried pulling d0-d3 as recommended

 

I tried messing with r10 to ground or lifted or to +5 and it didn't seem to make any difference while using the original firmware (_snapshot) still wierd reboots and garbled messages,

 

however  I had noticed before that the encoders were not working properly on this firmware but worked on the new one.  some reading revealed that the version of MIOS i have changed the Encoder protocals or somethign so this application is out of date.

 

Since following the instructions in the readme got me no where as far as integrating the multi LCD driver into the working application I began testing out combos of files in /src of new and old.

 

Eventually after much experimentation I used the current midibox_LC_1_6e added /clcd_multi.  made changes 1-3 in the readme for assembly only apps (I still don't know what #4 is about) then I took lc_clcd.inc , lc_display.inc, lc_clcd_macros.inc, and lc_cali.inc from the old application (_snapshot) and  made sure the lc_io_tables.inc and setup_midibox_lc files were suited to my hardware and compiled.

 

low and behold the LCDs display on three screens.  however the first screen stays stuck on whatever iteration of the misspelled MIOS screen it comes to, the second lcd displays a garbled version of the welcome message, and the third on as well although only half of this display is used.  while working in logic though the third display half that is working does report channel names and volume changes. 

 

Also, with this set up the encoders are now working properly.

 

I guess this is a small victory...the controller does work... the display is at 1/8th capacity but...if anyone can point me to a where this problem is coming from I would appreciate it.

 

en passant, how does the midibox NG handle Logic Control emulation? I didn't see any info on that in the user manual etc.. is it the same as the 8bit cores where there is an application to load?

Edited by lazlos

Share this post


Link to post
Share on other sites

sorry, it didn´t work. i can´t be of much help here since i ripped apart my old cores a while ago for the parts, so i can´t really test any of this.

 

with the mb_ng, it works a little different. i guess you already had a look into the manual, so you know that mb_ng works with scripts.

so you upload the mb_ng firmware, after that you write a script (with Mios Studio e.g.) and tell the midibox what it has to do.

and there is already a (almost complete) script for the logic controll emulation, that TK wrote here. it supports the lcd messages, motorfaders, ....

and since up to 64 lcds are supported natively, there is no problem connecting and displaying the mcu message on 4 lcds.

Edited by John E. Finster

Share this post


Link to post
Share on other sites

bwah ha ha ha ha ha!  and with dogged persistance comes VICTORY! 

 

ALL screens are now diplaying the correct info!

 

it would seem that it was a combination of hardware and software problems that I solved almost by accident.

 

to build the application I took the most recent lc complete app from the mios download section. 

I then added the multi lcd drived (clcd_multi) to the modules and deleted the dummy app.  modified Main.inc, makefile.org as suggested in the readme ignoring the USER_LCD_SELECT business of number 4.

then I took lc_clcd.inc and lc_hlp.inc from the src folder of the old app in formor post 11553.0 and copied them to my src

 

compiling this gave me a working app in the end.

 

but... for the longest time my 4th lcd would not work properly I tried everything possible invcluding using the test apps in the multi lcd driver and the pin out lcd test app (mios downloads) everything tested fine.  so I was taking voltages on the lcd in question and firing up the lc app and wtf?!?!? it worked!  even with just a hand touching the lcd or one pin of the multi meter as long as it was held from boot it would work.

 

so, after much vexing I finally added an additinal ground between lcd 4 and 3 and now it is working no fingering required!  I figure this must be a problem with the lcd but it is wierd cause the continuity tested good and the helloworld app worked.  the welcome screen of the lc app worked but it would not update with the track names.  anyway this additional ground fixed it!

 

many thanks for the help.  back to making music now...

 

EDIT: I also grounded R10 instead of having it go to +5 as recommended by john E.

 

midiboxlc.jpg

Uploaded with ImageShack.us

Edited by lazlos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now