Question about hooking up KS0107/KS0108 GLCD

I bought a GLCD from Sparkfun that uses the KS0107/KS0108 and has the negative voltage circuitry built on the board. I’m a little confused about hooking it up and making it work… Here is what I have got so far:

 

GLCD ----a LPC

    1                  vd

    2                  vs

    3                  V0

  4-11              D0-D7

    12               J28:SDA

    13               J28:SC

    14               RS

    15               RW

    16              

    17               E

    18              

    19               B+

 

There are only 2 CS lines as far as I can tell, but I am also confused about what to do with  Pins 16 and 18 on the GLCD. 16 is D/I and 18 is VEE. Am I on the right track as far as hooking it up?

 

Once I have it all hooked up properly I have gathered that I get it working with these commands in MIOS studio:

lcd_type GLCD_KS0108
     lcd_num_x 1
     lcd_num_y 5
     lcd_width 128
     lcd_height 64

 

Thanks in advance for any help!!

Cheers,

Alex

Can you post a link to the datasheet or attach it here?

Here is the link: https://www.sparkfun.com/products/710

Thanks, alex

This is the wrong connection:

  14               RS

 

Pin 14 is a low-active RES (reset) input, which should be connected to Vdd (+5V)

 

D/I (data/instruction, pin 16) has to be connected to RS instead.

 

VEE: let it open

 

Best Regards, Thorsten.

Thanks for the reply TK… I followed your instructions, and then uploaded the newest bootloader, and typed in the commands:

lcd_type GLCD_KS0108
     lcd_num_x 1
     lcd_num_y 5
     lcd_width 128
     lcd_height 64

I also tried LCD_type GLCD_ks0108_INVCS to no avail

 

Unfortunately the GLCD didn’t display anything, other than the backlight… I switched back to my generic 2X16 LCD and retyped the commands to set the bootloader for the generic LCD, but now that doesn’t work either… I get black bars on the 2X16 LCD briefly on startup before it goes blank… I tried reloading the bootloader to siwtch back to the generic LCD setup to no avail.

 

I hooked the 2X16 LCD up to my SEQ V4 and it works fine, so it is something with the LPC… What am I missing? I really hope I didn’t fry something on the LPC!!!

 

Haha, I always seem to figure things out 5 minutes after posting… The LCD_type wasn’t changing because I wasn’t entering the 0X00 … I’ll keep working on the GLCD and see if I can get it to work…

 

Cheers,

Alex

Hi again…

 

I haven’t been able to get my GLCD to work yet, and have a couple of questions to make sure I’m not missing something important.

 

  1. My understanding is that the only changes I need to make are in MIOS studio with just the bootloader installed. ie. Set LCD_TYPE, set LCD_num_x, etc. Is this true, or do I need to do edits and teach myself how to recompile 32-bit apps (I’ve only managed to teach myself how to compile for the PIC based core applications)?

 

  1. This is related to question 1 I think… Are the SC and SDA on J28 set up to automatically work with the KS0108, do I have the correct pins, or do they need to be activated?

 

Cheers,

Alex

  1. My understanding is that the only changes I need to make are in MIOS studio with just the bootloader installed. ie. Set LCD_TYPE, set LCD_num_x, etc. Is this true, or do I need to do edits and teach myself how to recompile 32-bit apps (I’ve only managed to teach myself how to compile for the PIC based core applications)?

 

yes, only the LCD parameters have to be entered into the bootloader (inclusive the “store” command).

If you reset the core thereafter (or power-cycle it), the LCD should already output a message even if the bootloader application is still installed.

 

 

 

  1. This is related to question 1 I think… Are the SC and SDA on J28 set up to automatically work with the KS0108, do I have the correct pins, or do they need to be activated?

 

They are automatically activated.

 

Only danger is, that a certain application (like MBSEQ) uses this port for other purposes.

 

I will doublecheck the KS0108 driver with my GLCDs (inverted and non-inverted) this evening.

I can at least confirm, that a 240x64 GLCD is still working on a MBHP_CORE_STM32, because it’s part of my MBLC hardware.

 

Best Regards, Thorsten.

Bad news: I can’t find my spare KS0108 display anymore, and it would be too cumbersome to use the 240x64 GLCD instead (which is directly soldered to a MBHP_CORE_STM32 module - I will never do this again)

 

But: I found in following application note:

http://www.kronosrobotics.com/Anotes/GraphicLCD_AN.pdf

that V0 has to be connected between ground and VEE via a trimpot (see Schematic 2)!

 

This means, that you can’t use the J15:V0 output of the MBHP_CORE_LPC17 module. Instead you’ve to use an external trimpot which is responsible for the display contrast.

If you haven’t tried this before, than it’s very likely the reason why the LCD doesn’t show any pixels.

 

And while I was writing this, I found the same circuit in my own schematic: http://www.ucapps.de/mbhp/mbhp_lcd_ks0108_mios32.pdf :slight_smile:

 

Best Regards, Thorsten.

Thanks TK!!! I’ll wire up a 10k trimpot when I get home later… I read over that schematic, but missed te trimpot.

I’m excited to get it functioning so I can continue teaching myself how to customize midibox NG!!!

Cheers, Alex

Ok, so I wired up a 10k trimpot, and now I get something! J28 doesn’t seem to work though, so I used J5B, A4 and A5, which give me jumbled text:

 

"is    oader    is    oader

   :-)    -date!    :-)     _date!"

 

That is not exactly what the text looks like, but close. I’m guessing it has to do with CS pin 1 and 2, and where they are being hooked up. The correct pins on J28 don’t produce and text at all, and all the pins on J5A and J5B(except Vs and Vd of course) give similar jumbled text.

 

I am using:

lcd_type 0x81 GLCD_KS0108
     lcd_num_x 1
     lcd_num_y 5
     lcd_width 128
     lcd_height 64

Is there something else obvious that I am missing?

 

Cheers,

Alex

You are almost through! :slight_smile:

 

J28:SDA and J28:SC are the right pins.

 

The behaviour that you noticed when the CS lines are connected to J5 is the same, as if they would be connected to ground (of course, because J5 isn’t activated)

And this indicates, that your GLCD has low-active CS inputs.

And this requires the usage of “lcd_type 0x82” (KS0108_INVCS)

 

Best Regards, Thorsten.

Ok, so I tried the ks0108_invcs, and still nothing… I don’t know if this helps, but when I connect the LCD to J5 and jumbled text prints, and then connect to the correct J28 pins and reset the text doesn’t change or go away during or after reset… Could the J28 pins not be activated?

 

Thanks!!

alex

J28 should work as expected - this requires further analysis.

Could you please show me (create snapshots) what happens after power-on if:

  • both CS inputs are connected to Ground (J28:Vs)

  • both CS inputs are connected to 3.3V (J28:Vd)

  • both CS inputs are connected to 5V (J2:Vd)

  • CS1 is connected to Vs and CS2 is connected to 5V

  • CS1 is connected to 5V and CS2 is connected to Vs

Best Regards, Thorsten.

Ok, after failing to figure out how to create a new album for the pictures I just added them to my MBFM one… I’ll delete them when we’re done… sorry!

 

  • both CS inputs are connected to Ground (J28:Vs)

  • both CS inputs are connected to 3.3V (J28:Vd)

  • both CS inputs are connected to 5V (J2:Vd)

  • CS1 is connected to Vs and CS2 is connected to 5V

  • CS1 is connected to 5V and CS2 is connected to Vs

 

Thanks again for all the help!!!

Cheers,

Alex

One more  thing that I noticed while looking at a topic today…  I have a V1.0 board that I got awhile back, and I noticed in another topic that there is an incorrect trace on J15… I didn’t know about this, could it be the problem? I couldn’t find any documentation when I searched for this problem…

 

a

 

http://discourse.midibox.org/t/topic/17241

Thanks for the snapshots! They prove, that the CS lines are not inverted.

 

And good news: I think (resp. hope) that I found the issue! :rolleyes: 

 

Bootloader V1.010 was released with r1599 of the SVN repository - at this state, the J28 lines were not addressed correctly by the KS0108 driver.

It has been fixed in r1603, and this change went into the latest firmware releases (e.g. MBNG, MBSEQ, MIDIO128)

 

So - could you please check if the LCD works correctly when one of the precompiled binaries mentioned above is uploaded?

 

Best Regards, Thorsten.

Tried all three project.hex and none worked… I did hook up CS1 and CS2 to J5A, A4 and A5, and what I got was text in the top 1/3 of the screen and almost solid black in the bottom 2/3 of the screen after that the bottom stayed black until I left it off for a minute or two…

 

thanks!

alex

CS1 has to be connected to J28:SDA

CS2 has to be connected to J28:SC

Did you try this?

 

Best Regards, Thorsten.

Yes, nothing at all happens when connected to those… I tried both the KS0108_invcs and the ks0108…

 

Thanks,

Alex

 

PS, When I added the 10k trimpot, I left VO on J15A open… is that ok?