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:
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…