Pages: 1 [2] 3   Go Down
Author Topic: Can this Sure GLCD use Arduino library  (Read 2252 times)
0 Members and 1 Guest are viewing this topic.
Norfolk UK
Offline Offline
Edison Member
*
Karma: 66
Posts: 2479
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Riva - I removed the display from the breadboard [too many wires to disconnect from the Uno  smiley-cool] and the code uploaded but still nothing showing on the display. I also plugged an external 9V power supply into the barrel jack of the board.
Sorry Pedro147 I can't really help with the display though I will look in some detail later (meant to be working).
Did you have the 9V supply connected before when it failed to upload the sketch or have you since connected it? If it was running off 9V then maybe there is a screen/wiring problem or it's still drawing to much power.
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 514
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: May 17, 2013, 08:39:53 am by Pedro147 » Logged


Norfolk UK
Offline Offline
Edison Member
*
Karma: 66
Posts: 2479
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 514
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 514
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 514
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 17, 2013, 09:29:45 pm by Pedro147 » Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 514
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.35 KB, 515x634 - viewed 26 times.)

* Serial_monitor_2.bmp (155.85 KB, 482x328 - viewed 30 times.)
« Last Edit: May 18, 2013, 02:16:09 am by Pedro147 » Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 514
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

These displays must be very touchy or else I have been at this for too long today  smiley-lol 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 (324.89 KB, 485x680 - viewed 27 times.)

* Serial_monitor_6.bmp (99.91 KB, 488x419 - viewed 25 times.)
Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
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
Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 514
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* GLCD 009.jpg (814.25 KB, 2048x1536 - viewed 26 times.)
Logged


Pages: 1 [2] 3   Go Up
Jump to: