Can this Sure GLCD use Arduino library

And all the connections are as per the above table? Does the lcd light up?

Riva - when I initially tried to upload the code I did not have the 9V supply connected. When you suggested that I try to upload with the display disconnected, I removed the display from the breadboard and the code uploaded successfully, so then I plugged the 9V supply into the board just in case it was drawing more current than the USB could supply.

cowasaki - yes I have checked the connectionS and they are as shown in the PDF that Docedison posted the link to in reply #2 of this thread. The LCD back light is lighting up.

Edit - I investigated a little further and found out that the code will not upload with the display connected to the breadboard with either USB only power or with both USB and 9V supply connected simultaneously, but if I remove the display from the breadboard the code will upload with only USB power connected or both USB and 9V

Pedro147:
Edit - I investigated a little further and found out that the code will not upload with the display connected to the breadboard with either USB only power or with both USB and 9V supply connected simultaneously, but if I remove the display from the breadboard the code will upload with only USB power connected or both USB and 9V

The display should be wired for type B pinouts. It sounds like the your drawing to much current. Is the backlight powered from the arduino 5V pin? Disconnect it (pin 19 on the LCD) and see if you can upload code then.

It is wired up as type B, and I disconnected pin 19 power and still no upload. I have checked and rechecked the connections and they are all correct

Pedro,
See the KS0108/GLCD playground page. There is quite a bit of information about this issue.
Play close attention to the glcd reset pin wiring, and make
sure to read all the notes about it and troubleshooting when uploading is
not working.

BTW, I don't particularly recommend the pdf file for documentation as it is
not actively maintained anymore.
The included html documentation is better and more complete.
The wiki/playground page has even more up to date notes in it since it is updated after the release.

--- bill

Thanks Bill,

I will have a look at the wiki/playground page, as that is the latest information, and see what I can work out,

Pedro

Pedro147:
Thanks Bill,

I will have a look at the wiki/playground page, as that is the latest information, and see what I can work out,

Pedro

The wiki explains a simple workaround.
--- bill

I looked at the wiki “GLCD reset pin NOTE” and tried -

  1. leave reset line (display pin 18) disconnected. Code would upload but nothing displaying on glcd.
  2. connected reset line to Vcc (+5V) Code would upload but nothing displaying on glcd.
    The only other thing I could see to try was
    “small fraction of the glcds out there will need a reset pulse. For those that need a reset pulse and connecting the glcd to the arduino reset line causes the autoreset on the aruduino board to fail, the library must be used to reset the glcd which requires another Arduino pin. In order to enable this functionality edit the pin configuration file and uncomment the line that looks like this:
    // Reset Bit - uncomment the next line if reset is connected to an output pin //#define glcdRES 19 // Reset Bit “
    I found the line to uncomment in the ks0108_Arduino file of the config folder, but I do not understand what this means
    “And then connect the Arduino pin specified by glcdRES to the glcd module's reset pin.”
    Other than the glcd’s reset pin is pin 18, and that the only Uno pins left are A5 (D19?) and Tx Rx pins 0 and 1 and D1 D2.
    Just to clarify, regarding the contrast pot connections, I have a 10k pot with the centre (wiper) pin connected to pin 3 of the glcd, one outer pot pin connected to glcd pin 18 and the other outer pot pin to glcd pin 1 and ground. Also I have a 220 0hm resister fitted in the back light pin 20 ground line.
    I apologise for my lack of understanding, so much to learn. Thanks everyone for your time Pedro.

According to the datasheet, glcd pin 18 is not the reset pin.
glcd pin 18 is Vee which is the negative voltage used to drive the contrast
circuit. It should be hooked up to one leg of the pot.
The glcd reset pin is glcd pin 17.

What code are you uploading?
I highly recommend using the diag sketch as it can offer clues as
to what is going on.
My guess is that something is not hooked up correctly.

For now stick with either of your options #1, or #2 (from your previous post) with respect to the
reset line (just a reminder, reset is glcd pin 17 not glcd pin 18).
I would start with leaving the glcd reset pin disconnected.

First thing,
go back and verify each of the wires between the glcd and the arduino to make sure
that they match the datasheet - that is much better than just going by "type A", or "type B".
Use the datasheet to determine where each wire needs to go.
This is why having the correct datasheet is critical. Without that, it is next to impossible
to get the connections correct.

To verify your arduino connections, look at the datasheet pinout, then look at the table on the wiki.
Using the table on the wike page, focus on 2 columns:

  • Arduino 168
  • Function

What you do is follow down the data sheet pinout for each of the 20 pins.
Some pins are voltage gnd, vcc, - those are easy.
(connect the backlight pin LEDA to the resistor then to VCC)
There is Vee which connects to 1 leg of the pot.
There are also some special glcd pins like reset, and Vo.
reset will be left disconnected for now.
Vo (contrast voltage input) will be connected to the center wiper of the pot.
Then there are the data and control glcd pins that must be connected to Arduino pins.
For each pin on the datasheet that is a data or control pin, look at the wiki table column "Function"
to locate the function, then look left to the "Arduino 168 column"
to see where which Arduino pin the glcd pin should be connected to.

For example, on your sheet you can see that
glcd pin 4 is D/I
Now go down the function column on the wiki table then go left to see that in the Arduino 168 column
that should be hooked up to Arduino pin 17.
a few more exmaples:
glcd pin 14 is DB7 which hooks to Arduino pin 7
glcd pin 16 is CS2 which hooks to Arduino pin 15 (analog 1)

As far as actual connections go, how are you attaching the wires to the glcd module?
soldering them? Soldering a 20 pin header and using a breadboard?

Can you post some clear closeup pictures of your wiring:

  • a closeup of the wires connected to the Arduino
  • a closeup of the wires connected to the glcd module
  • a wider shot that shows everything.
    The goal of the photos is to be able to identify where all the wires are going.
    If I can see that I can be a second set of eyes to see if anything looks out of place.

It would also help to run the diag sketch and post the output from the serial port here.
That will offer some clues as to what is happening.

--- bill

Thanks for taking the time to help me here Bill,

you explain things in a very clear and concise manner. I have soldered a header pin strip to the display and this is plugged into a breadboard. My soldering looks good to me but I might check the continuity of all these joints just to be sure. As for photos of my setup, I will have to tidy up the wiring layout so that you can see where they all go to (too many wires) I also ran the diag sketch but when I tried to copy/paste the serial monitor output , to save as a text file Windoze XP, it did not work. Ctrl-A (select all), Ctrl-C (copy) then Ctrl-V (paste) into notepad. So I had to do a screen capture of the first section of the serial monitor output and attach it as two images Serial_monitor_1 and Serial_monitor_1. I will post the set up photos ASAP,

Pedro.

Serial_monitor_1.bmp (320 KB)

Serial_monitor_2.bmp (156 KB)

A BUSY timeout means that the library is checking to see if the glcd module is
ready after powering up and after waiting longer than should be necessary,
it wasn't. This is normally due to a wiring issue. (it could be related to the glcd reset pin)
The glcd is more than likely actually ready but because of a wiring issue
the library is not seeing the proper glcd status.

One common error is getting the glcd pins reversed.
From looking at the photos on the ebay link you provided, it appears
that the glcd has pins 1 and 20 labeled. Just make sure to not to accidentally
reverse them when using the header and breadboard.

What kind of wire are you using?
I'm assuming you are plugging the wires into the Arduino headers
and the breadboard. Stranded wire doesn't work very well for this.
Solid core wire is best.

If you want to verify your wiring against the library configuration, look
at the serial diag output.
It displays each function followed by the arduino pin and port information as:
function:ArduinoPin#(portinfo)

You can use this to verify the wiring by looking at the arduino pin# and making sure
that it connects to the glcd pin associated with the designated function as indicated
by the datasheet.
example
DI:17(PIN_C3)
means that Arduino pin 17 must connect to the glcd DI function which according
to the datasheet is glcd pin 4

If you are positive that the wiring is correct, then it may require enabling s/w reset.
This is done by going into the config file and uncommenting the line with the glcdRES
(to uncomment the line remove the comment indicator the two slashes at the beginning of the line)
Then hook arduino pin 19 to the glcd reset pin (glcd pin 17).

--- bill

These displays must be very touchy or else I have been at this for too long today XD I verified the wiring by checking the data sheet against the pin allocations on the serial monitor. After trying the config file uncommenting and reset line to Uno pin 19 procedure which was unsuccessful, I connected the reset line to Vcc and uploaded the GLCD diags sketch again. This time to my surprise the test was successful. I have attached the screen capture of the serial monitor output. I then tried to upload the Hello World sketch but nothing showed on the screen. After leaving all this experimenting alone for a while (to let my sanity return) I tried to upload the GLCD diag sketch again but it is back to the initial “initialisation failed: BUSY”error. I had changed nothing since the upload when the initialisation tests passed. I am still using the multi stranded jumper leads until I can fit some solid core wires. Any clue as to what might be going on. Maybe I need to leave it for a while, but it is perplexing that it eventually initialised correctly and then suddenly went back to the initial error, Pedro

Serial_monitor_5.bmp (325 KB)

Serial_monitor_6.bmp (99.9 KB)

Pedro147:
Any clue as to what might be going on. Maybe I need to leave it for a while, but it is perplexing that it eventually initialised correctly and then suddenly went back to the initial error, Pedro

I am still using the multi stranded jumper leads until I can fit some solid core wires.

Stranded wires are very difficult to work with.
unless they are the stranded wires with the solid pins on the ends like these:
http://www.ebay.com/itm/65pcs-Multi-Color-Mixed-Breadboard-Jumper-Cables-For-Arduino-Code-Wire-Prototype-/350766025178?pt=LH_DefaultDomain_2&hash=item51ab48c9da

Those types of stranded wires are prefect for this kind of stuff.
If the ends of the wires are stranded and just twisted together,
they are difficult to push into the headers or a breadboard.
If the connections between the wires and the sockets are marginal, all kinds of weird things can happen.
Simply touching or moving something can cause connection issues.
On the female headers like what is on the Arduino board, stray strands can also twist around
and short to the adjacent pin under the plastic header.
I would say never use wires with stranded ends or expect issues.

How long are your wires? Long wires can also cause issues.

As far as initialization goes,
Other than faulty wires/wiring, there is no reason I can think of why tieing glcd reset
to VCC would work, when using the additional pin for s/w reset wouldn't work.
The best solution to guarantee a proper initialization every time is to use the
additional pin for software reset.
If connecting the glcd reset pin to VCC or leaving it disconnected,
then the only way to reset the glcd module is to power it off.
What that means is that in order to start a clean initialization, the board
and glcd must be power cycled.
Without power cycling, a single faulty initialization can lead to seeing things not working because
of something going wrong in the past.

Using the extra pin to allow the library to reset the glcd is the best way
to ensure that the library and the glcd are both starting clean during
initialization. It uses an extra pin which is why it isn't the default.
The next best way is to use the reset pin from the Arduino, but because
of the poor auto-reset circuit on the Arudino, it doesn't work on some
boards.
If tying gcd reset to VCC or leaving it disconnected, the board and glcd
need to be power cycled between tests to ensure the glcd is starting
from a clean uninitialized/power-up state since there is no way
to reset it.

When diags worked, were you seeing the diag images on the display
and can you adjust the pixel intensity by adjusting the contrast pot?
The html documentation included in the library has a section on diags with sample images of what
the display will look like during diags.

Can you post some photos of your setup?
Photos would help.

--- bill

My stranded wire are the type with pins on the end and none of them are what I would call particularly long. I have now got the diag sketch uploading with the glcd reset line tied to pin 19 of the Uno with the appropriate modification to the config file. There are no images showing on the glcd and the contrast pot seems to do nothing, but I assume that it will not do anything until there is some image to adjust the contrast of. I have attached some images of my setup but it is difficult to get any that are very helpful. I will try and reconfigure the circuit so that you can see where everything is going,

thanks Pedro.

Bill,
thanks for your help and all the time you spent "educating" me, but I got it working. A simple mistake on my part i.e. plugging the reset line into a row that was not connected to glcd pin 17. Oh well I have learn't some things about these displays and reading data sheets etc.

Pedro.

Great!
That is a great photo by the way. Probably one of the best I've seen for this.
So many that people post are blurry, have poor lighting, or simply don't capture all the wires.

A couple of things look odd, and maybe some are picture "tricks" and perhaps
you already fixed them.

The resistor and sharing bread board "holes":
It looks like the resistor is trying to share holes with other wires.
Red wired on the power rail, and a blue wire that goes off to the pot or maybe it is
the red wire in column 40.
While it can physically be done,
it isn't reliable and will have issues, since often the wires are not exactly the same size
so one wire may not get proper connection if any. Best to never do that.

Red Anode wire:
There is a red wire that looks like it goes over to maybe pin 19? (the backlight Anode?)
doesn't look like it is connected to anything. Maybe the resistor actually connects to it instead of the blue wire?
The resistor needs to connect between the Anode and the power rail.
(maybe it does if the resistor is connected to the red wire vs the blue wire)

Vee signal to pot:
It looks like the blue wire that appears to be sharing a wire with the resistor
is not connected to the glcd. Without that connection to Vee, no pixels
will show up.
(Maybe you meant Vee and pin 18 instead of Reset and pin 17 in your post?)


So I'm guessing you have figured out how the rows and power rails are all connected now.
The gap in the middle of the board separates the two columns.
One thing to be careful of is using both power rails. In this case you connected them
but only used one. But suppose you had used them both. For example hooked up
glcd pin 2 or glcd pin 2 to the upper rail instead of the bottom rail. It might not have worked.
This is because you can get what is known as ground bounce. The ground and power levels being
used for the some parts of the glcd would not necessarily be the same as the levels being
used for the signals. This occurs because during signal switching, chips use more power for that
very brief period of time and when they "suck" on the power lines the power lines can momentarily
droop or a ground can momentarily float up.
To cure this you could use some capacitors across the rails.
It is best to use as few rails as possible, disconnect unused rails, and then to keep all the power and ground inputs
as close to each other as possible on the rails. This can help avoid those types of things.

Anyway, glad it is all up and working.

--- bill

Bill,
I am glad that my photo was clear as it it hard to get a good shot of some breadboard layouts. I do not know how I missed that basic mistake that I made by plugging the reset line into a breadboard strip that was not connected to the glcd, oh well. Thanks for the tips for bread boarding and I will take them all on board. Now that I have the display working with the test sketches I have been trying out a few of the drawing functions documented in the HTML file attached to the library. I worked out some basics like drawing a circle etc but was wondering if there are any good “tutorials” or the like that you know of or is it just a matter of looking at sketches and the function descriptions in the HTML document and experimenting.Thanks again for all your help and the work that you do on this forum, it is appreciated,

Pedro.

There may be some tutorials out there, but I don't know of any.
For now, you'll have to look at the example sketches and the API documentation
to try to get a feel for how things work.

Most of the calls are fairly obvious.
Text areas are a bit novel and may take a bit to get used to, but once
you declare them and initialize them they are pretty easy to use.

One of the things I'm working on that will be in a future release is that
many of the API functions in the HTML documentation will include an
example of how to use the function.

--- bill

Thanks again Bill 8)