problem with diag , openGLCD in ks0108

Hi everybody!

I have Arduino Mega and GLCD 64*128 ks0108. the LCD is not show anything.

I use GLCDdiags that recommend for diagnostic, but i can not found what is the problem.

the response of GLCDdiags is here:

Reported Arduino Revision: 1.8.13
F_CPU: 16000000

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

GLCD:ks0108 DisplayWidth:128 DisplayHeight:64
Chips:2 ChipWidth:64 ChipHeight:64
CSEL1:33(PORTC4) CSEL2:34(PORTC3)
RW:35(PORTC2) DI:36(PORTC1) EN:37(PORTC0)
D0:22(PORTA0) D1:23(PORTA1) D2:24(PORTA2) D3:25(PORTA3)
D4:26(PORTA4) D5:27(PORTA5) D6:28(PORTA6) D7:29(PORTA7)
Delays: tDDR:320 tAS:140 tDSW:200 tWH:450 tWL:450
ChipSelects:
CHIP0:(33,0x1, 34,0x0)
CHIP1:(33,0x0, 34,0x1)
Data mode: byte
Backlight:

Diag Loop: 8
Initializing openGLCD
Displaying Library version Screen
Turning display on/off
Displaying ChipSelect Screens
Walking 1s data test
Wr/Rd Chip Select Test
Testing GLCD memory pages
Horizontal Page Test Chip: 0 Pixels 0-63
Vertical Page Test Chip: 0 Pixels 0-63
Horizontal Page Test Chip: 1 Pixels 64-127
Vertical Page Test Chip: 1 Pixels 64-127
Full Module Horizontal Page Test:Pixels 0-127
Full Module Vertical Page Test:Pixels 0-127
TEST PASSED
GLCD.SetDot() speed (K ops/sec): 18.88
Test Count: 8 PASSED 0 FAILED

when i remove +5v and GND from first and second pin of GLCD, lcd show the lines , but not show correct line or text. for example i use this code:

/*
*  openGLCD Library - Hello World
* 
* This sketch prints "Hello World!" to the LCD
* and shows the time in seconds since Arduino board was reset.
* 
*  2013-06-15 bperrybap   - updates for openGLCD
*  2011-09-14 Bill Perry  - original creation
*   bperrybap@opensource.billsworld.billandterrie.com
*/

// include the library header
// no font headers have to be included
#include <openGLCD.h>

void setup()
{
 // Initialize the GLCD 
 GLCD.Init();

// Select the font for the default text area
 GLCD.SelectFont(System5x7);

//  GLCD.print(F("hello, world!")); // keep string in flash on AVR boards with IDE 1.x
//  GLCD.Puts(F("hello, world!")); // Puts() supports F() with any version of IDE

 // print() below uses RAM on AVR boards but works
 // on any version of IDE with any processor
 // note: Same is true for Puts()
 GLCD.print("hello, world!"); 
}

void loop()
{
 // set the cursor to column 0, line 1
 // (note: line 1 is the second row, since counting begins with 0):
 GLCD.CursorTo(0, 1);

 // print the number of seconds since reset:
 GLCD.print(millis()/1000);
}

Given all the memory tests seem to be working, the pin wiring is likely correct so it must be something simple like the contrast circuit / pot is not properly wired up.

Do you have it wired up as shown in the included documentation in the Wiring -> KS0108 Family section?

Did you run through the troubleshooting section in the included documentation?

How do you have the contrast pot wired up?

Can you show a few photos of your actual setup that shows how everything is wired up?

--- bill

Do you have it wired up as shown in the included documentation in the Wiring -> KS0108 Family section?
yes, I did it.

Did you run through the troubleshooting section in the included documentation?
yes.

How do you have the contrast pot wired up?
one leg is connected to ground, middle is to Vo, and another leg to Vee.
Pot is 10k.

Can you show a few photos of your actual setup that shows how everything is wired up?

images are attached.

Some of the soldering looks a bit suspect, but in order for the diags to pass there must be good connections
on all the data and control pins. Which in your photo is pins 9-19
About the only thing that the diags can't test is the contrast control and the backlight.
My suspicion is that there is a contrast issue.

saleh200:
Did you run through the troubleshooting section in the included documentation?
yes.

What was the contrast voltage?

The reason I ask is that in the photo of the back side of your GLCD, there are some chips that are not populated.
The 7661MOA chip is a voltage to voltage converter chip that is used to create a negative voltage.

In the photo you can see that the Vee pin goes over to the 7661MOA chip circuitry.

What is the voltage on the Vee pin?
I'm guessing that it is floating/zero as it looks like the negative power supply circuitry is not populated on your GLCD.

What is the voltage on the Vo pin? Does it vary when you rotate the pot?
I'm guessing that it doesn't.

Do you have a link to the datasheet for you exact GLCD module?

--- bill

What is the voltage on the Vee pin?
0 to 1.5v
When first (gnd) and second(+5v) pins are Disconnected , Vee is from -4.4v to zero.

What is the voltage on the Vo pin? Does it vary when you rotate the pot?
0 to 1.5v
When first (gnd) and second(+5v) pins are Disconnected , Vo from zero to 4.4v .

Do you have a link to the datasheet for you exact GLCD module?
Unfortunately local seller has not datasheet

saleh200:
What is the voltage on the Vee pin?
0 to 1.5v
When first (gnd) and second(+5v) pins are Disconnected , Vee is from -4.4v to zero.

I don't understand this.
Vee should not vary; it is a power source.
Measure the voltage on the Vee pin with all the other GLCD pins hooked up but nothing attached to Vee.
If the GLCD on board negative power supply is working, the voltage on Vee should be negative. Often it is -6v or less.

What is the voltage on the Vo pin? Does it vary when you rotate the pot?
0 to 1.5v
When first (gnd) and second(+5v) pins are Disconnected , Vo from zero to 4.4v .

Why would you disconnect power to the GLCD?
The voltage on the Vo pin needs to be negative to see pixels.
When rotating the pot, you shoud see negative voltage at one end and 0v at the other end.
If Vee is not providing a negative voltage, then there will be no way to get a negative voltage to Vo
and you won't see any pixels.

From looking at the photo the back of your GLCD, it looks like your GLCD does not have the circuitry to generate the negative voltage for Vee. If that is the case, you will not see any pixels, since you need to feed a negative voltage to Vo to see pixels.

--- bill

  1. If I true understand, I must connect negative voltage to Vee?
  2. Vo must be connected to where?
  3. I should use pot ?
  4. Can you suggest a circuit for negative voltage and how to make it?

Thank you for your reply

Just connect pin#1 to GND. pin#2 to 5V. Disconnect all other pins.

Read pin#18 with your multimeter.

David.

david_prentice:
Just connect pin#1 to GND. pin#2 to 5V. Disconnect all other pins.

Read pin#18 with your multimeter.

pin 18 is 0v when pin 1 to gnd & pin2 to 5v and , other pins are disconnected.

but pin 18 is 0v to 1.5v when pot is connected and rotated.( pin 1 to gnd & pin2 to 5v and pot is connected, other pins are disconnected).

saleh200:

  1. If I true understand, I must connect negative voltage to Vee?

No. Vee is an OUTPUT not an input.
If the GLCD module is working properly, the GLCD module has an on board negative power supply and provides that negative voltage on the Vee output pin.

saleh200:
pin 18 is 0v when pin 1 to gnd & pin2 to 5v and , other pins are disconnected.

As I suspected, your GLCD is not generating the needed negative voltage.

If the photo in post #1 of the back of the GLCD module is your GLCD module, you can see that it is missing the 7661MOA chip and the surrounding circuitry which is what generates the negative voltage.
With components not populated, the Vee pin is floating with no voltage since it is not connected to anything.

but pin 18 is 0v to 1.5v when pot is connected and rotated.( pin 1 to gnd & pin2 to 5v and pot is connected, other pins are disconnected).

That is because while Vo is an input, in can have some amount of positive voltage on it from the other circuitry on the board.
I'm guessing that if you were to measure the voltage on Vo when nothing is connected to that pin, you would measure 1.5v.

When you hook the pot to it, it can back feed voltage from the center wiper to the Vee pin.


You need a negative voltage to get pixels to show up.
Your GLCD is not providing this.
You could ask the seller about it. Ask if the GLCD was supposed have the negative Vee power supply
or if there are others that do have it.

You will have to generate a negative voltage.
You could source and populate the missing parts on the GLCD pcb.
or you could build your own external circuitry.
There are several different types of designs for how to do this.
Some use simple components like diodes and capacitors but require a clock/pulse signal - which could be generated by the Arduino.
Some use chips that are designed for this purpose.

If you google around you should be able to find information about it.

Some of the simpler designs won't generate more negative voltage than the original supply voltage.
i.e. if you supply +5v, you won't get more than -5V
I'm not sure how negative of a voltage you need for that display, but you may need more than -5v.

If you wanted to use one of the simpler designs,
I would recommend that you first do some experimentation to see what the needed negative voltage is to ensure that the voltage your circuit generates it is low enough.

--- bill

I suggest that you just try a 9V battery as a negative supply to your pot.
Adjust for best contrast. Measure the voltage on VO pin.

I suspect that it will be about -4V. In which case you could buy a -5V module locally.
Or wait for a few weeks. -5V module from China

David.

I just measured the voltage on two of the ks0108 displays I have.
Apparently the voltage can vary a lot between displays.
One is a Very old display from the 80's and it needs -8.32v for optimum contrast.
Its range is very narrow and the contrast from no pixels to all pixels on is just a few 1/100s of a volt.

Another newer one needs -3.3v for optimum contrast and the range is about 1/2 volt either way.

--- bill

Thank you bill and David.
My problem solved.

I use max232 as negative voltage, and get -8.8v .
then by pot, I changed it to -6.6v and give this to Vo.

Ah-ha. So the "best" contrast was at -6.6V

This means that the -5V modules would be no good.
And any PWM charge pump solution would require a voltage doubler.

i.e. the MAX232 was probably the best solution. Especially if your dev board already had a MAX232.

I am intrigued. All the KS0108 modules that I have seen populate their negative voltage circuitry.
Pleas post a link to the actual display you bought e.g. Ebay sale page.

David.

david_prentice:
I am intrigued. All the KS0108 modules that I have seen populate their negative voltage circuitry.

This is only the third one I've seen in about 10 years of playing with these and working on the ks0108/glcd/openGLCD library.

--- bill

david_prentice:
Pleas post a link to the actual display you bought e.g. Ebay sale page.

I bought from local seller, that has not website

I presume that you can access Ebay, AliExpress, ... and most online shops.

In which case you can compare your item with the online shop.
Identify your item. Post the link with a note to say it "looks like" the item you bought in your local market.

I have never bought any electronics from a local shop or market. Wormshill is not very sophisticated.
I buy from mail-order shops in UK or China.

Royal Mail is very fast and reliable for UK orders.
Chinese Mail takes longer.

David.

1 Like