OpenGLCD : problem to make my graphic LCD work

Hello everyone,

I bought a graphic LCD a few weeks ago. But i’m not able to make it work.
I checked the wires several times (i tried with uno and mega).

The diags sketch reports me a reset problem. I tried with the reset wired on the reset pîn (upload problem), on +5V and on A5 but still at the same point.

Here is the diags result :

Serial initialized

Reported Arduino Revision: 1.0.6
F_CPU: 16000000

Lib Configuration: openGLCD ver: 1.0rc1 build: v1.0rc1
Panel Configuration:ks0108-128x64
Pin Configuration:ks0108-Uno

GLCD:ks0108 DisplayWidth:128 DisplayHeight:64
Chips:2 ChipWidth:64 ChipHeight:64
CSEL1:A0(PIN_C0) CSEL2:A1(PIN_C1)
RW:A2(PIN_C2) DI:A3(PIN_C3) EN:A4(PIN_C4)
D0:8(PIN_B0) D1:9(PIN_B1) D2:10(PIN_B2) D3:11(PIN_B3)
D4:4(PIN_D4) D5:5(PIN_D5) D6:6(PIN_D6) D7:7(PIN_D7)
Delays: tDDR:320 tAS:140 tDSW:200 tWH:450 tWL:450
ChipSelects:
CHIP0:(A0,0x1, A1,0x0)
CHIP1:(A0,0x0, A1,0x1)
Data mode:
d0-d3:nibble mode-Non-Atomic
d4-d7:nibble mode-Non-Atomic
Backlight:

Diag Loop: 1
Initializing openGLCD
GLCD initialization Failed: RESET wait Timeout (status code: 2)

Can you help me?
Thanks,
Kikiz

This type of error is very rare. It means the library thinks the GLCD is stuck in reset state. The library has already waited much longer than should be necessary for the GLCD to power up and be initialized and the GLCD status bit the library is seeing is indicating that reset is still going on. There are 2 likely causes for this: 1) the glcd is bad 2) there is a wiring issue and the proper bit is not being read

With any of these types of issues it is nearly always a wiring issue occasionally it is due to a bad GLCD but that is quite rare. In the few cases where I've seen users have bad GLCDs, the GLCD was damaged from miswiring.

Can you post a link to the datasheet for your glcd. And then post a few photos your setup that is clear enough to be able to see all the wires and distinguish were each glcd pin is connected.

--- bill

Hi Bill,

I just asked the datasheet to the supplier but he doesn’t have it…
Here are the photos you asked
Thanks
Kikiz

I’m sorry, i didn’t succeed in sending photos.
I always have an error message…

I tried the diags with two GLCD (bought to the same supplier)
and i have the same error message so it may be bad GLCDs, don’t you think?

Kikiz

It is unlikely that two glcds are bad. In more than 5 years of working with these libraries I've only ever seen the issue be because of bad GLCDs in 2 cases, and in both of those cases, the GLCDs were damaged from incorrect/bad wiring. More than likely the issue is incorrect wiring.

I would suggest to immediately stop using the setup and not even apply power any more until we can verify the wiring. This is a case were incorrect wiring can potentially damage the GLCD or the Arduino.

How did you know how to wire up the glcd without having the datasheet? Are the pins on the GLCD labeled on the back of the board?

Unless the pins are labeled on the back of the datasheet, there is no way to know how to wire up the glcd since there is no standard pinout for ks0108 displays and I've seen over 11 different pinouts.

If the pins are not labeled, then we must find the datasheet to determine the pinout. All the information that is needed is in the datasheet so having the datasheet is the best way to ensure that things are wired up correctly.

Can you post a clear photo of the back of the glcd.

Yes the pins are labelled on the back of the glcd.

I attached a picture of the back of the GLCD.

Okay, i won’t touch to my arduino until we found
where i made a mistake.

Thanks,
Kikiz

Another photo of the wiring

another one, i used panel B wiring

the last one

Couple of things here. There seems to be photos of a couple of different setups. Most the photos look like you have a header soldered to the GLCD whereas the one of the back of the glcd shows wires that are soldered and the solder on those wires looks very suspect (not very good).

Just keep in mind that details really matter when trying to diagnose issues and it is best to show a single non working setup so if necessary it can be replicated.

In the bigger picture, the problem is that the display you have is not a ks0108 display but rather a ST7920 display. If you look at the back of your board you see that the display module part number is: QC12864B-1 If you google for that or QC12864B you can find a datasheet for that module.

In your case, since it has labeled pins, you can simply look at the labeled pins.

The way you can tell a ks0108 from a ST7920 is that a ks0108 uses 2 chip select pins whereas the ST7920 does not and has a PSB pin to determine whether the modules uses parallel lines or a serial interface. The way to communicate with a ks0108 vs a ST7920 is very different.

Did you go through the included HTML documentation that comes with the openGLCD library? There is a section on how to wire up the panel and it shows the needed pins. In going through the needed glcd pins, it should have become obvious that this module didn't have all the needed pins and had a few different pins.

I know that the ks0108/GLCDv3 library and its playground Arduino page talks about panel types, "A", "B", "C", etc... In reality there is no such thing as these panel types and it was an invented thing by the original arduino ks0108 library that was carried over into the GLCDv3 library. It was done as an attempt to try to make it simpler for people to wire up their displays.

In my view using panel types was not really a good method of wiring up the displays as it encourages not looking closely at the pins or even "guessing" which in my opinion is very bad as it can potentially damage components.

Also, since the ks0108/GLCDv3 panel type tables are on the playground page and the playground page can be edited by anyone, I have seen in the past that the tables on that page have been modified and changed which means that there is no guarantee that the pinouts in the panel types remain constant or even correct.

In openGLCD I have removed any/all references to these panel types and now explain how to use the datasheet or the labeled pins to determine the proper wiring. What is important is wiring up the proper Arduino pin to the appropriate GLCD function pin. Using the datasheet or labeled GLCD pins vs blindly trusting a "panel type" ensures that the panel will be wired up correctly.


Unfortunately in your case the openGLCD library does not support the ST7920 at this point in time. If you want to use the ST7920 you will have to use a different library. This is a very nice feature rich library: u8glib: http://code.google.com/p/u8glib/

It works very differently from openGLCD but has a much broader support for different glcds.

--- bill

Thank you for everything. You have been really helpful and you have shown me what the arduino community is.

Thank you for your time. I wish you a good night. Kikiz

And what about LCM1864J? It seems to be ks0108 compatible but i’d like to be sure before ordering it.
I’d like to buy a ks0108 compatible screen to use your library openGLCD.

Kikiz

I have no idea. That seems like a very odd part number maybe it should be LCM12864J ?

I can't find much on that part either. There are many suppliers of ks0108 displays that are inexpensive. I buy them off ebay and one of the things I look for when buying them is that there is a real photo of the actual display. I prefer to be able to see the front and back of the display and have a link to the datasheet.

When I can't verify the part, I just skip it and look for another vendor. A "good deal" is not a good deal if it isn't the part you want/need.

You can find them on ebay for about $10USD.

--- bill

I’m sorry i meant LCM12864J.
Thank you for your help i’ve checked on ebay.
I saw different glcd ks0107 ks0108 compatible but i’m french and the
time between the order and the delivery may be 2 or 3 weeks so i
want to be sure before ordering.

Kikiz

Hello,

I tried to use the u8glib to use my two glcd with st7920 chip. I found that datasheet : http://www.picbasic.ru/_fr/16/QC12864B_.pdf and used that tutorial http://www.bajdi.com/cheap-128x64-graphic-lcd-12864zw/ to try the library with the helloWorld sketch but with my two glcd, that doesn't work...

I saw pixels but no helloWorld...

Any idea? Thanks, kikiz

Not sure. Could be several things. Best thing would be to start a new thread describing your issue and wait for Oliver to reply as it is his library.

--- bill

Ok i'll do that. Thank you bill. Kikiz