Jump to content

Problems with two 128x64 Glcds connected


mischa.mole
 Share

Recommended Posts

Hello!

After a 2 year pause, I've just finished the core module and connected the first lcd. Being quite a newbie to the work with microcontrollers, I was surprised that everyhing worked perfectly. I updated MIOS and changed the PIC ID (graphical LCD). Everything worked, the display reads "READY."

Then I connected the second LCD, and surprisingly it nearly also worked. Only there seems to be something wrong with some offset or something similar. It looks like this:

fehler.jpg

(while booting)

On the right display, some characters seem to have "moved over" a little. But after that, "READY." is written on both displays correctly.

Do I have to change something in the MIOS; can you help me?

Or am I completely mistaken and my wiring is bad somewhere?

Thanks for your response!

Regards from Austria,

Mischa

Link to comment
Share on other sites

Ok, now I uploaded the LC App (just for testing, without any source code changes)

Now the result looks like this:

fehler2.jpg

(I don't know yet much about Midibox coding, but I'm working on it  8))

Seems to be quite a mess....as far as I know, the startup screen should spread over both screens, am I right?

Anyone now whats wrong?

Also, it seems that the most right 16 pixel column is unused (like I have found in other threads), but i think I will take care of this later...

Thanks for your help!

Mischa

Link to comment
Share on other sites

hi!

thanks you for answering!

hi

you clearly don t have the latest MIOS installed, look here

http://www.midibox.org/forum/index.php/topic,9759.msg71740.html#msg71740

I have found this thread but I do think i have the newest version of MIOS, on my Screen it says 1.9f while booting (as seen on the picture in the first post)

fehler.jpg

(while booting)

I do think i have tho change the code somewhere, but I have no idea where to look.....

thanks!

mischa

Link to comment
Share on other sites

It looks like the CS lines have an inverted polarity.

Could you please try this test application:

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

The ASM version has inverted CS lines enabled by default, so that you can try it out w/o rebuilding a .hex file

The C version has inversion disabled

Note that the inbuilt GLCD driver of MIOS allows to invert the polarity as well. I can search for the details once I know if this is the issue...

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks thorsten!

....but I fear the inverted CS lines are not the problem......now my screens look like this:

fehler3.jpg

far too many knows on the screen i think  >:(

@cimo: sorry, the images are uploaded to the webspace of my university, maybe the blocked some IPs

or something....I will upload them elsewhere as soon as possible!

regards,

mischa

Link to comment
Share on other sites

Are you able to re-assemble the code?

I think that I found a MPASM->GPASM conversion error in app_lcd.inc:


USER_LCD_DetermineCS
        SET_BSR MIOS_LCD_OPTION1
        BRA_IFSET MIOS_LCD_OPTION1, 0, ACCESS, USER_LCD_DetermineCSInv
[/code] Should be:
[code]
USER_LCD_DetermineCS
        SET_BSR MIOS_LCD_OPTION1
        BRA_IFSET MIOS_LCD_OPTION1, 0, BANKED, USER_LCD_DetermineCSInv

If you are not able to modify and rebuild the code, please let me know and I will send you a new .hex file

Best Regards, Thorsten.

Link to comment
Share on other sites

Ok, so the displays are working with non-inverted CS

The left GLCD works as expected, the right GLCD shows a scrambled screen.

Since my 240x64 display uses 4 CS lines, and the demo screen (as well as MBLC screen) is displayed correctly, my assumption is a wiring error.

Could it be, that the CS3 line of the right GLCD is always enabled (=1), because it shows all components of the screen.

CS line mapping:

USER_LCD_LAT_CS1        EQU     LATC            ; Pin C.5

USER_LCD_PIN_CS1        EQU     5

USER_LCD_LAT_CS2        EQU     LATC            ; Pin C.4

USER_LCD_PIN_CS2        EQU     4

USER_LCD_LAT_CS3        EQU     LATD            ; Pin D.0

USER_LCD_PIN_CS3        EQU     0

USER_LCD_LAT_CS4        EQU     LATC            ; Pin C.2

USER_LCD_PIN_CS4        EQU     2

It could be a bridging fault (check your solderings)

Best Regards, Thorsten.

Link to comment
Share on other sites

Thorsten you are a genious!

You where right with CS3...

When i labeled my plugs I misinterpreted the board layout

board.jpg

thinking that J8 was the "row" on the bottom because it's written J9/J8......well i should have rechecked that too, not only my soldering!

but now i plugged it in the other way round and..

top.jpg

I even managed to move everything in the center and the knobs far to the right (having a 256x64 instead of a 240x64) --> my first efforts in "coding" MIOS applications, yay :D

tomorrow Im gonna continue with the LC App, thanks for your help!

Regards, mischa

Link to comment
Share on other sites

Hello!

now both of my displays seem to work properly, so I uploaded the LC Application.

Now it looks like the LC App still thinks I have character LCDs connected. I have already set the PIC ID header to 0000000000001000 with the change ID application.

Do i need some changes in the LC source Code?

I have played with these values and the screen changes accordingly, but I never get a "graphical" screen.

#define LCD_USE_SECOND	0		; the emulation handles with two character LCDs if 1
#define LCD_EMU_COL     55		; number of emulated columns (characters per line)
					;    o graphical LCDs: use 55 (like a Logic Control)
					;    o one 2x40 LCD: use 40   (unfortunately..)
					;    o two 2x40 LCDs: use 55  (like a Logic Control)

#define INITIAL_DISPLAY_PAGE	0	; initial display page after startup (choose your favourite one: 0-3)

What have i forgotten?

Thanks!

redagrds, mischa

Link to comment
Share on other sites

@cimo: sorry, the images are uploaded to the webspace of my university, maybe the blocked some IPs

or something....I will upload them elsewhere as soon as possible!

no worries, i just meant that i didn t pay enough attention to the picture.My wrong.

have you tried tpo set the default page to another value than 0?

Also have you tried to activate the second lcd?

Link to comment
Share on other sites

@ cimo: okay, no problem  :)

Yep I tried all that, changed LCD_USE_SECOND and the INITIAL_DISPLAY_PAGE, but i still see a similar screen.

But I remember when I uploaded the LC App 2 years ago with only one display connected, I saw a quite "graphical" Screen that used fonts etc.

I don't really know what else to change in the LC Code

Link to comment
Share on other sites

Thats really strange - MBLC should switch to GLCD mode if the LCD driver notifies that this capability is available:

Inside USER_Init (-> main.asm)



        ;; use LC_STAT.LC_STAT_GLCD as indicator if graphical LCD
        ;; or character LCD is connected
        bcf     LC_STAT, LC_STAT_GLCD
        btfsc   MIOS_BOX_CFG0, MIOS_BOX_CFG0_USE_GLCD
        bsf     LC_STAT, LC_STAT_GLCD
[/code]

Accordingly no source code or setup change is required, it should work with the prebuilt .hex files.

Especially with setup_midibox_tk.hex, as this is the file I'm using for my own MBLC - when you apply a diff over the setup_*.asm files, you will notice that the only difference is the default value of "TOUCH_SENSOR_MODE"...

So - please don't change the source code. Remove your changes (or rename the directory), and start with the original release.

Could it be, that you are trying an expired release package which doesn't provide this "GLCD selfdetection" mechanism?

And are you using the original pic18f452/midi/mios_v1_9f_pic18f452.hex file, or did you build (and modify) MIOS by yourself?

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

×
×
  • Create New...