Pages: 1 ... 11 12 [13] 14 15 ... 21   Go Down
Author Topic: GLCD library version 3  (Read 79010 times)
0 Members and 1 Guest are viewing this topic.
Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2712
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Akim14,
I'll post answers in your other thread:
http://arduino.cc/forum/index.php/topic,90198.msg0.html#new

--- bill
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello:

I am very new to the forum and the Arduino products.  I have just purchased a Mega2650 and it comes with a 128x64 display.  I have tested the board with LED bulb with "Blink" and it work.  But I can never get even the blacklight of the Display works, it is black.  I been searching for document and now come to this GLCD library topic and find the download here, http://code.google.com/p/glcd-arduino/downloads/list, should I download the file and add to my Arduino program.  it also states in the readme file that a sketchbook directory, I don't have a sketchbook directory should I just create one.

anyway, I am try to do the first step, to make the display lit up.  Oh, I have follow the Point B for setup the pins.

Thank you.

cc


Logged

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

The google site you have if for the GLCD library, that I'm maintaining.
glcd v3 RC3 is the latest version.
There is also some information about the older v2 version here:
http://www.arduino.cc/playground/Code/GLCDks0108

You actually do have a sketchbook directory.
Bring up the IDE and click on [File]->Preferences

You sketchbook directory can be anywhere you want.
The location that the IDE is looking for you sketchbook is
in the text box right there at the top of the "preferences" dialog.

Wherever that directory is, you will need to create a directory called
"libraries", then extract the zip image into that directory.
So you will end up with
{sketchbook directory}/libraries/glcd ....

Make sure you have properly identified the glcd type as incorrect wiring up the glcd
could damage the glcd or the Arduino board.

Make sure the datasheet that you have for you glcd module is for the glcd that you have
by verifying that the part number on the back of the glcd matches what is in the datasheet.

Some glcds have labeled pins but many do not, make sure you properly identify pin 1.

If you need help, just ask additional questions and I'll be happy to help.

--- bill



Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your prompt reply.

I have made the LCD display lit up.  It is blue now.  I have installed the glcd  in the sketchbook location. 

I got message "Done compiling" and "Binary sketch size: 6108 bytes (of a 258048 byte maximum) after upload the sketch,
I used the "HelloWorld" and "GLCDdiags" files  Under File of IDE,  Sketchbook>libraries>glcd> both of them got the above messages and the green light on the board blinks with "HelloWorld" and stay green with "GLCDdiags".  Please advise how can I made "Hello World" or anything dispaly on my LCD display.

thanks again.
cc

Logged

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

Diags reports information out the serial port.

Unless the glcd is bad, incorrect wiring is always the cause for the glcd not working properly.

Since the backlight is now working, you have changed something with the wiring.

Make sure that you have the correct data sheet and wiring up the glcd according to the datasheet
and the documentation included with the library.
Wiring is not something you want to be guessing
as incorrect wiring can damage the glcd or the Arduino board.

When things are not yet working. Use the diags sketch.
Until diags pass, there is no reason to try to run any other sketch.
Diags will display useful information on the serial port
about how the library is configured and any potential testing failures.

--- bill

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, Bill:

Thanks again.

Here is the datasheet I used to do the wiring
          http://fritzing.org/projects/128x64-lcd/
I also read the  the ks0108mega.h file
        #define glcdDI        36    // D/I Bit
       // Reset Bit  - uncomment the next line if reset is connected to an output pin
      #define glcdRES         30    // Reset Bit

it seems the only difference for the datasheet I used and those states at the config file is those I copied above, is there a difference of D/I bit and RS.  My reset is 17 not 30, should I use 30 instead.

When I compile the sketch, do I need to disconnect the reset, let the sketch upload and connect the reset.

I have used the GLCDdiags and nothing happen to the LCD display.  you mentioned about using the diag and until it pass, is this diag the same as the GLCDdiags sketch I used.  When I compiled the GLCDdiags, other than the comment regarding the byte, there is no other information.  You also said diag reports information out the serial port, where can I find the serial port, bear with me, I know it sounds kind of stupid.

thanks
cc
Logged

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

Hi, Bill:

Thanks again.

Here is the datasheet I used to do the wiring
          http://fritzing.org/projects/128x64-lcd/

That is not a data sheet. That is a wiring diagram.
A data sheet will show all the technical information about the lcd panel
and will have the pinout for the lcd panel.
There are many different pinouts for ks0108 glcds and if things are improperly hooked up
it can damage the glcd or the Arduino board.
That is why it is very important to locate a proper datasheet for a glcd to see
the functions for each of the 20 pins to ensure that the pin connections to the Arduino are correct.
Here is what a couple of ks0108 datasheets look like:
http://www.longtech-display.com/produts/LCD%20MODULES/longtech%20pdf/LGM12864B.pdf
http://docs.bgmicro.com/pdf/lcd1030.pdf

Pretty much all glcds have their model silk screened on the back of the board.
Look at the back of the board and you should see the lcd model.
It will usually have "12864" somewhere in the model name.
You can do a google search with the model name to locate a datasheet for the glcd.

Quote
I also read the  the ks0108mega.h file
        #define glcdDI        36    // D/I Bit
       // Reset Bit  - uncomment the next line if reset is connected to an output pin
      #define glcdRES         30    // Reset Bit

it seems the only difference for the datasheet I used and those states at the config file is those I copied above, is there a difference of D/I bit and RS.  My reset is 17 not 30, should I use 30 instead.
Sorry about any confusion here.
RS and DI are the same. Some data sheets call the pin RS and some call it DI.
They are the same thing.

The numbers like 36 for glcdDI and 30 for glcdRES are Arduino pin#s.
All the numbers you see in the glcd pin config files like ks0108_Mega.h are arduino pin #s.
Numbers like "17" for reset are the glcd pin number.

If you want the glcd library to control the reset signal on the glcd, you hook
the arduino pin number for glcdRES to the reset signal pin number on the glcd.
In your case that would be hooking up Arduino pin# 30 to glcd pin #17.
Make sense?

Quote
When I compile the sketch, do I need to disconnect the reset, let the sketch upload and connect the reset.

Unfortuantely there are some issues with AutoReset on certain Arduino boards
which can cause uploads to fail when the the Arduino reset line is hooked directly to the glcd
reset pin.
The real issue is that some glcd modules need a reset pulse and some don't.
On the glcds that don't need a reset some glcds can work with the glcd reset pin tied to vcc
as shown in your wiring diagram. Some glcds will work when the glcd reset signal is left unconnected.

For the glcds that need a reset pulse the problem is that
some Arduino boards will not auto reset if the glcd reset pin is hooked up to the Arduino board reset pin.
For those glcds you must control the glcd with an arduino pin.

The safest thing to do at this point would be to eliminate any potential reset issue by letting
the library control the reset pin.
To do that you uncomment the line like you did and then hook Arduino pin 30 to the glcd reset signal pin.

After the glcd is working, if you don't want to use an arduino pin to reset the glcd, you can
try connecting the glcd reset pin to VCC instead. But if you do that make sure to go into the
ks0108_Mega.h header file and comment out the glcdRES line to make sure the glcd library
does not try to use the pin.


Quote
I have used the GLCDdiags and nothing happen to the LCD display.  you mentioned about using the diag and until it pass, is this diag the same as the GLCDdiags sketch I used.
Yes sorry about my wording.

Quote
When I compiled the GLCDdiags, other than the comment regarding the byte,
"byte"? Not sure what you mean by this.

Quote
there is no other information.  You also said diag reports information out the serial port, where can I find the serial port, bear with me, I know it sounds kind of stupid.

In the IDE if you click on the serial monitor icon, it will bring up the serial monitor.
Set the baud rate to 9600 and you will see the diagnostic messages from the GLCDdiags sketch.

If you post the information from diags, it will help to diagnose what is happening.

--- bill
« Last Edit: February 25, 2012, 12:48:25 am by bperrybap » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, Bill:

thanks a lot. 

I have checked the wiring with datasheet, the board is SG12864J4.  I have followed the pinoutB from this link :http://www.arduino.cc/playground/Code/GLCDks0108

I have complied the GLCDdiags again, and here is the information from the Serial Monitor, I can only read that is a problem with the initialization of the GLSD and issue of reset.  I don't know how to fix it. 

Following is an extract the information from the serial monitor, it doesn't allow me to cut and paste and I just typed it out.   
---------------------------------------------------------
Reported Arduino Revision: 1.0
---------------------------------------------------------
GLCD Lib Confirguration: glcd ver: 3 dlrd_Device ver: 1 gText ver: 1
GLCD Lib build date: Mon Dec 5 10:50:07 CST 2011
GLCD Lib build number: 442
panel Configuration:ks0108
pin Configuration:ks0108-Mega
-------------------------------------------------------------
GLCD:ks0108 DisplayWidth:128 DisplayHeight:64
Chips:2 ChipWidth:64 ChipHeight:64
CSEL1:33 (PIN_C4)  CSEL2:34 (PIN_C3)
RW:35 (PIN_C2) DI:36 (PIN_C1)  EN:37(PIN_C0)
DO:22 (PIN_A0) D1:23 (PIN_A1) D2:24 (PIN_A2) D3:25 (PIN_A3)
D4:26 (PIN_A4) D5:27 (PIN_A5) D6:28 (PIN_A6) D7:29 (PIN_A7)
Delays: tDDR:320 tAS:140 tDSW200 twH:450 twL:450
ChipSelects: CHIP0: (33, 0x1, 34, 0x0)  CHIP1: (33, 0x4, 34, 0x1)
Date mode: byte
--------------------------------------------------------------------------
Diag Loop: 9
Initializing GLCD
GLCD initialization failed: RESET wait Timeout (status code: 2)
--------------------------------------------------------------------------

Can you teach me how to cut and paste from the serial monitor.  BTW, I tried to open the Mega.h file but I  cannot open it from my file directory, i.e. users/xxxxx/Document, how can I modify the .h file.  I know probably in the future I need to uncomment the reset or change the file.

thanks again
have a nice weekend.
cc
Logged

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

You can copy and paste from the terminal window.
Just highlight the text in the terminal window,
then move to the window where you want to paste it and click the middle mouse button
to paste the highlighted text.

See this thread for some information about that error:
http://arduino.cc/forum/index.php?topic=88878.0
(ignore his information and just scroll down to my explanation of the error)

That error is always due to a wiring error.
Look at the diag output and wire up the glcd panel according the pins you see in the output.

You can see that glcd RW should be hooked up to arduino 35
glcd DI to Arduino 36
glcd CS1 to Arduino 33
glcd D4 to Arduino 26
etc...
Make sure that the wiring to the glcd is using the reported arduino pins for each glcd function.

Make sure you pot is wired correctly:

----- GND
------------------------------------- Vo (glcd pin 3)
----- Vee (glcd pin 18)

I don't know what you mean by this:

Quote
BTW, I tried to open the Mega.h file but I  cannot open it from my file directory, i.e. users/xxxxx/Document, how can I modify the .h file.  I know probably in the future I need to uncomment the reset or change the file.

I assume you mean {sketchbook directory}/libraries/glcd/config/ks0108_Mega.h  ?
You showed some text from that file in your previous posts. Can't you open the file for editing using your favorite
text editor


--- bill
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good Day, Bill:

Thank you so much.  The GLCDdiags finally works smiley

cc
Logged

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

What was the issue?
So, if possible, I can update the documentation to be clearer.

--- bill
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

is there a chance to use a shift register with the glcd library?
i ran out of free digi io´s, so i want to use a shift register (shiftout).

thanks
moe
Logged

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

Not right now.

While a simple shift register can be made to work, there are couple of technical hurdles.
The first is that it requires a frame buffer, the code already supports this but it does
consume quite a bit of: RAM 1024 bytes for a 128x64 display. This would preclude its use
on a m168 - (maybe thats not that big of an issue) but it may also not be acceptable
in some other environments.

The second is a performance issue.
The Arduino shiftout() routine implementation is not very fast.
There are better ways to write the code to make it much faster and
there are also other ways to clock out serial data than the way the Arduino guys implemented
their shiftout() routine that are even faster.

I've thought about designing a backpack board and offering it for sale.
The biggest challenge is that there are so many different glcd pinouts
that you can't make just one board.
I could make it where it has 2 sets of 20 pin holes on it and you pick
the correct set, but that is error prone and if the incorrect set is picked
it can blow up the glcd.
I'd really rather provide it as full solution (display & backpack combination)
to ensure it all works with the display

In the mean time, there is another library that works
with a SPI or I2C interface:
http://arduino.cc/forum/index.php/topic,52271.0.html

There is also this project which is pretty interesting but I'm not sure if works
with the latest glcd library.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284207458

--- bill
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi bill,

thanks for your reply.

to use the i2c bus is very interesting. i´m a arduino beginner, so it seems a little bit difficult at first sight.
also to purchase the MCP23017 is not that easy in germany.
i ll try to get one.

my glcd type is a CFAG12846B-TMI-V
http://www.crystalfontz.com/product/CFAG12864BTMIV

i hope the code will work with that kind of glcd type too
what do u think?

---moe
Logged

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

Nick's library was done on a ks0108 which is the same type of module that you pointed to.
The pinouts for his module may be different from yours, but it is the same controller on the
glcd module.

Keep in mind that Nick's library is different from this one and is a simpler design
so it doesn't have as much functionality as the glcd v3 library.

--- bill
Logged

Pages: 1 ... 11 12 [13] 14 15 ... 21   Go Up
Jump to: