Go Down

Topic: Graphical LCD (ST7920 Driver) - Wiring Help Needed (Read 10854 times) previous topic - next topic

TheFoeHammer

I recently bought this GLCD: http://www.mindkits.co.nz/CatalogueRetrieve.aspx?ProductID=1237732&A=SearchResult&SearchID=1809692&ObjectID=1237732&ObjectType=27

It should work with the LCD12864 Library in the Arduino Playground (http://www.arduino.cc/playground/Code/LCD12864) but I have no idea how to wire it to the Arduino  :'(

In the LCD12864 library documentation says i needed to connect these pins:

EN = Arduino Pin 18
RS = Arduino Pin 17
RW = Arduino Pin 16
D7 = Arduino Pin 7
D6 = Arduino Pin 6
D5 = Arduino Pin 5
D4 = Arduino Pin 4
D3 = Arduino Pin 11
D2 = Arduino Pin 10
D1 = Arduino Pin 9
D0 = Arduino Pin 8
CSEL1 = Arduino Pin 14

But the LCD I bought has different pin names so I don't know what goes where.

Here is a picture of the back of my LCD:


(Click to enlarge)

As you can see it has the pins:

VSS
VDD
V0
RS
R/W
E
DB0 -> DB7
PSB
NC
rst
Vout
A
K

I'm taking a guess that E from the LCD12864 Library documentation  corresponds to EN and R/W corresponds to RW but I don't know which pin corresponds to CSEL1.

Basically what I'm asking is for a wiring diagram to connect the GLCD in the image above to my Arduino UNO, any help will be appreciated immensely as I'm just itching to get this up and running.
                                 

floresta

This looks like an interesting display but you need better documentation.

The LCD12864 library documentation says:
You also need to connect a POT with 5V on one side, ground on the other, and 5V (perhaps with 150 Ohm resistance) + LCD Pin 19 to the wiper (middle one usually). Otherwise you won't see much.  
This is total gibberish.  Typically the VOUT pin (almost always pin 18) goes to one end of the pot, VSS (pin 1) goes to the other end, and VO (pin 3) goes to the wiper.

The LCD12864 library documentation says:
If you need to change these values, you can find them in the LCD12864.h file. I tend to put CSEL in pin 12 in order to get the extra analog pin for joystick connections, etc...
When you look at the .h file there is no reference to the CSEL pin.  When you look at the .cpp file you will see that the constructor only has 11 values in it's argument and CSEL is the missing one.

I think mindkits should supply you with some better documentation.  Specifically, you need documentation for the QC12864B board rather than for the ST7920 controller chip which is allegedly under one of the epoxy blobs on that board.  Perhaps someone who reads some of the Asian languages can help you with this part since a Google search for 'QC12864B' does not turn up any English language results.

Quote
I'm taking a guess that E from the LCD12864 Library documentation  corresponds to EN and R/W corresponds to RW ...
Correct.

Quote
but I don't know which pin corresponds to CSEL1.
This may be left over from some other GLCD program.  Many of the GLCD devices use two chip select lines.

Don

dupleg

#2
Dec 08, 2010, 12:47 am Last Edit: Dec 08, 2010, 12:49 am by dupleg Reason: 1
i have the same lcd. the csel1 is actually ur PSB. and u may connect it to analog pin 0. mine works like that  :D

let me know if the info helps. i usually find most replies useless as people talk about something else in the reply rather than answering the question  >:(

this is my first reply to someone in 1 year  ::)

oh and btw, VSS is ground, and Vdd is 5v or 3.3v pin on ur board. goodluck :P

floresta

#3
Dec 08, 2010, 02:19 am Last Edit: Dec 08, 2010, 02:21 am by floresta Reason: 1
Quote
i have the same lcd. the csel1 is actually ur PSB. and u may connect it to analog pin 0. mine works like that
Normally I would doubt that the pin that is used to switch between a serial and a parallel input (PSB) would be implemented by a connection clearly labeled as a chip select (CSEL1), but see below.  I doubt that either would need to be driven by an "analog" pin.

My previous comment about the .h and the .cpp files
"When you look at the .h file there is no reference to the CSEL pin.  When you look at the .cpp file you will see that the constructor only has 11 values in it's argument and CSEL is the missing one."
were based on following the link provided by mindkits.  The corresponding .h file on the Arduino site does indeed provide for CSEL1 and in the .cpp file all the program does with this pin is to drive it high, which when connected to the PSB pin will put the display in the parallel mode.  There are lots of commented out references to CSEL1 and CSEL1 which leads me to believe that the author cobbled up another GLCD program to deal with this display.  His technique provides an excellent example of how to waste the resources of an output pin.

Quote
i usually find most replies useless as people talk about something else in the reply
I assume that you are referring to some other thread.
.
Don

TheFoeHammer

Thank you all for the help, I've managed to render to the LCD now but I don't know how to hook up the potentiometer for the contrast correctly (currently I can pretty much see nothing as the back light isn't on), I tried the way floresta explained but I don't think I did it correctly :(

Can someone explain to me how to set the contrast for this LCD with a 10K Potentiomer?

TheFoeHammer

Don't worry guys I worked it out  ;D

Thanks for all the awesome help everyone :D

floresta

#6
Dec 08, 2010, 02:09 pm Last Edit: Dec 08, 2010, 02:41 pm by floresta Reason: 1
Quote
Can someone explain to me how to set the contrast for this LCD with a 10K Potentiomer?
Without a datasheet for the pc board we are just guessing.   It would be nice to know what voltage is supplied by pin 18.  Try moving the one lead from VSS to VDD.  This means that one end of the pot is on pin 2, the other on pin 18, and the wiper is on pin 3.  Typically for character mode LCDs you should have a slightly positive (with respect to VSS) voltage at pin 3 and for graphical LCD you need a slightly negative voltage.  This connection should enable you to achieve either, assuming that pin 18 supplies a negative voltage like most GLCDs.


[glow][EDIT] [/glow] It appears that this device requires a positive voltage on pin 3, perhaps as high as 7 volts, which must therefore be supplied from pin 18.  This would mean that my original connection information in Reply #1 was correct.

Don

floresta

Quote
Don't worry guys I worked it out
It would help if you posted how you 'worked it out' so that someone else with the same problem could benefit from your experience.

Don


mrquesito

Hello,

I'm trying to wire up the ST7920 display, but I'm intrigued about the fact that the library says that you must connect, for instance, EN to Arduino pin 18. How would it be possible on an Uno, since it has just 13 digital pins? There's probably an easy answer, but I've just worked with 2x16 text displays so far.
I could use a Mega, but I think that only 13 I/O digital pins are needed, according to the schematic (http://www.satistronics.com/myfiles/file/LCD/YB12864ZB.pdf)
Another question: is VOUT a pin that provides the excess of voltage?

Thank you,

Juan.

Go Up