Jump to content

Question about hooking up KS0107/KS0108 GLCD


grizz

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Edited by grizz
Link to comment
Share on other sites

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)?

 

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

Link to comment
Share on other sites

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.

 

 

 

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

Link to comment
Share on other sites

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

 

Best Regards, Thorsten.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

You are almost through! :)

 

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 
Link to comment
Share on other sites

That should not be a problem here. What happens on that board version is that the 5V pin is directly connected to R33, so as long as you are using a 5V display you are fine. It's a little problematic if you ever try to connect a 3.3V display, though :-). I have added a picture of the modification to

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Edited by grizz
Link to comment
Share on other sites

Yes, it's ok to leave V0 of J15 open, because the contrast voltage is supplied by your external trimpot.

 

Currently I'm out of ideas!

Facts are:

- your GLCD is a KS0108 without inverted CS (proven)

- the CS pins are located at J28 (I measured this with a scope and can see the pulses)

- the CS pins are not properly supported by the bootloader update package V1.010, but they are supported by latest application releases.

 

How should we continue... do you have access to an oscilloscope?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

I do have access to a scope... My friend is going to be keeping his scope and bench PSU at my workstation for a bit, so  I can take some measurements once he drops them off... Just to confirm, I should not be using the KS0108_invcs, correct? I should instead be using ks0108?

 

I'm going to be busy for the next couple of hours, but when I get back I'll go back over all my connections to the GLCD and make sure again that they are all correct...

 

Thanks for the help!!

alex

Link to comment
Share on other sites

Yes, use KS0108 (without inversion), and check that J28:SDA and J28:SC output pulses whenever something is written to the GLCD (e.g. during power-on when the boot message is displayed)

 

Or even better: please use this test application, it frequently sends pulses at J28: http://www.ucapps.de/mios32/ks0108_test.zip

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Sooooooooo, I just hooked up CS1---->J28:SDA and CS2---->J28:Vd and the GLCD appears to work fine... prints the bootloader message upon "reset" and then prints the Midibox_NG message, followed by "ready". I'm definitely following the mbhp_core_lpc17 schematic correctly... is the notch on J28 on that schematic maybe backword ? If you look at J28 with the notch on the left CS2 is connect to the 2nd pin from the top and CS1 is connected to the middle pin... If that helps clarify...

 

once the bootup screen is through and "ready" is displayed properly in the upper right hand corner when I hit the "exit" and "shift" keys the text on the next menu pages is somewhat jumbled... Some words are printed correctly but with nonesense printed around them... is this because I have CS2 connected to Vd, or is this something I can start teaching myself to fix in the .NGC file?

 

I feel like I'm close... but if not I will wait on the oscilloscope and test the J28:SDA and SC pins...

Edited by grizz
Link to comment
Share on other sites

Sooooooooo, I just hooked up CS1---->J28:SDA and CS2---->J28:Vd and the GLCD appears to work fine... prints the bootloader message upon "reset" and then prints the Midibox_NG message, followed by "ready". I'm definitely following the mbhp_core_lpc17 schematic correctly... is the notch on J28 on that schematic maybe backword ? If you look at J28 with the notch on the left CS2 is connect to the 2nd pin from the top and CS1 is connected to the middle pin... If that helps clarify...

 

No, the schematic is matching with the silkscreen on the PCB (prototype and final version).

Could it be, that the socket is soldered in the wrong direction? The notch should show to the border of the PCB

 

 

 

once the bootup screen is through and "ready" is displayed properly in the upper right hand corner when I hit the "exit" and "shift" keys the text on the next menu pages is somewhat jumbled... Some words are printed correctly but with nonesense printed around them... is this because I have CS2 connected to Vd, or is this something I can start teaching myself to fix in the .NGC file?

 

It's caused by the .NGC configuration, the label definitions have to be written in a way that artifacts are overwritten - at least by spaces.

 

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