Jump to content

Problem with GLCD for MidiboxLC on PIC18F4620 with MIOS 1.9g


Pearl

Recommended Posts

Hello,

 

I'm trying to run upgrade MidiBoxLC v1.6e on a PIC18F4620 with MIOS v1.9g.
But after many ours of struggling, searching the forum for answers and testing some settings, I didn't find a way to get the glcd running.

If I compile and upload the hex file, it looks like as if the ram for the fonts was overwritten (there is only rubbish at glcd).

MIOS Studio says:
     Reading setup_midibox_unit0.hex
     Trying to contact the core...
      setup_midibox_unit0.hex contains 18860 bytes (75 blocks).
      Range 0x00003000-0x00007aff (19200 bytes) - PIC Flash
      Upload of 19200 bytes completed after 11.37s (1.65 kb/s)

So, it shows that area 07cfc-07fff (where MIOS font is stored) is not affected.
 
- I can upload app Mios example app lcd7/ks0108 and I get the correct welcome screen. So this works.
- I can upload my compiled MidiBoxLC and pushing buttons or touching faders are producing midi events I can see in MIOS Studio.

 

Things I've done and/or tried:
- copied app_lcd.asm /.ins/.lcd from projekt lcd7/ks0108 into MidiboxLC folder modules/app_lcd/dummy/
- In Makefile.org: set PIC to 18F4620
- I also tried to edit file p18f4620.lkr in MIOS_Base/etc/lkr to split memory page as shown in http://www.midibox.org/dokuwiki/doku.php?id=using_pic18f4620 but this doesn't work for me.

 

And now I need an idea which setting I am missing ...

Thanks for any advice,

Stefan

Link to comment
Share on other sites

Hi Stefan,

 

the KS0108 GLCD driver is already part of MIOS, the "official way" to select this driver would be through the PIC ID header as explained here: http://www.ucapps.de/mios_bootstrap_experts.html

 

Considered, that this requires a PIC programmer (or a modified change_id application), I propose you an alternative way:

you could select the GLCD type in the application as well.

 

Just add following lines at the beginning of USER_Init in main.inc:

USER_Init

    ;; select LCD type #1 (KS0108)
    movlw   0x00            ; if 0: non-inverted CS, if 1: inverted CS#
    movwf   MIOS_PARAMETER1
    movlw   0x00            ; here you could forward an additional parameter
    movwf   MIOS_PARAMETER2
    movlw   0x01
    call    MIOS_LCD_TypeSet

 

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Cool! :)

 

Could you please do me a favor and test following version at your side:

http://www.ucapps.de/mios/midibox_lc_v1_6f.zip

 

In main.inc, USER_Init you only have to change the #if 0 by a #if 1 to enable KS0108 without programming the PIC ID Header

 

The GLCD view should be enabled by the MIOS_LCD_Init call in the middle of USER_Init (hopefully)

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi,

this is not so easy because I have a lot of customization in sourcecode.

(I have 3 MidiBoxLC units in one device each with a special configuration and some extra pin mappings and so on)

But, of course I can try to compare/merge your changes from version 1.6f to give you some feedback.
(I think I need some days, looks like a busy week, but I will post if I'm ready)

Buy Stefan

Link to comment
Share on other sites

Hi,
ok, I merged your changes from main.inc into my code, but for me this doesn't work!
After uploading and while rebooting the GLCD shows "Rebooting MIOS", but doesn't switch to "MIOS v. 1.9g" and shows only some additional random rubbish later.
After switch off and on again - GLCD is complete blank.

My code in main.inc:

USER_Init

    ;; select LCD type #1 (KS0108)
    movlw   0x00            ; if 0: non-inverted CS, if 1: inverted CS#
    movwf   MIOS_PARAMETER1
    movlw   0x00            ; here you could forward an additional parameter
    movwf   MIOS_PARAMETER2
    movlw   0x01
    call    MIOS_LCD_TypeSet

	bsf MIOS_BOX_CFG0, MIOS_BOX_CFG0_USE_GLCD

...

 

Hope that helps,
Stefan

Link to comment
Share on other sites

  • 2 weeks later...

Hi Stefan,

 

I've no explanation for this wrong behaviour.

And my big problem: the only KS0108 GLCD that I own is currently connected to a MBHP_CORE_STM32 module, so that I can't test the changes. :-/

 

However, it sounds like the CLCD variant was connected (again), therefore I reverted the changes (MIOS_LCD_Init not called anymore before testing the GLCD flag).

http://www.ucapps.de/mios/midibox_lc_v1_6g.zip

 

It would be helpful if you could test the change at your side (again).

Only main.inc, USER_Init has been changed:

- call MIOS_LCD_Init removed

- default check for GLCD flag now based on type number

- you've to turn "#if 0" to "#if 1" to overrule the PIC ID header selection

 

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...
×
×
  • Create New...