Go Down

Topic: 128x64 LCD connecting to arduino (Read 3277 times) previous topic - next topic

ammygo

May 05, 2012, 07:01 pm Last Edit: May 05, 2012, 07:06 pm by ammygo Reason: 1
Hi, I have lcd 128x64 12864zb someone like this: http://www.sparkfun.com/products/710
and don't know how to connect lcd to my arduino mega 2560
lcd have 20 legs: GND, VCC, V0, RS, RW, E, DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7, PSB, NC, RST, VOUT, A, K.
can anyone tell me how to connect this lcd to my arduino?

thanks!

copiertalk

down in the comments for that product it points to a link in the playground.

http://www.arduino.cc/playground/Code/GLCDks0108

ammygo


dc42

I think that LCD display you have is based on the ST7920 controller chip. The giveaway is the PSB pin, which selects serial or parallel operation.

The standard GLCD driver for Arduino doesn't handle that controller, but there are several that do, including my own rather basic controller which you can find at https://www.dropbox.com/sh/mgl9r2hks91noiz/_cqLvyIjIX, and u8glib at http://code.google.com/p/u8glib/wiki/u8glib.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

ammygo

#4
May 06, 2012, 04:01 pm Last Edit: May 06, 2012, 04:04 pm by ammygo Reason: 1
this is my lcd pictures:
http://postimage.org/image/ntkyc963f/
http://postimage.org/image/x30g7zhjb/

there should I put youre file?
I just know that A and K is lcd light
what should I do with other lcd pins?

dc42

A and K are the backlight LED. There may or may not be a series resistor already. Usually, you can see where the LED is soldered to the board at one edge, then you can use a multimeter to see whether there is any resistance between those connections and the A and K connections.

For wiring the other LCD connections to the Arduino, if you are using my driver then they are listed in the .ino file. It is a serial mode driver, so the D0-D7 pins are not connected.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

RandallR

DC42,
I was looking at you u8glib and I am impressed.  However, you use a 4050 to translate 5v to 3.3v.  I was wondering why.  The place where I bought my display said VDD was 5v, however the also said the viewing angle was 6 o'clock.  Something may be lost in the Chinese translation.

I do not know anything about these libraries but they claim to be for this display
Arduino Serial: http://www.dfrobot.com/image/data/FIT0021/LCD12864RSPI.rar
Arduino Parallel: http://www.dfrobot.com/image/data/FIT0021/LCD12864R.rar

dc42

u8glib isn't mine so I can't answer your question. I looked at the dfrobot serial library but didn't find it helpful (AFAIR it just displays a bitmap), so I wrote my own.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

RandallR

DC42,
If you have done this before, would you mind giving us as simple "Hello World" including the wiring connection?

So far I have for the serial interface:
Pin
1 - VSS - Ground
2 - VDD - +5
3 - V0  - Contrast - Connect to the wiper of a 10k - 20K pot connected across +5 and Gnd
4 - RS -
5 - R/W -
6 - E -
7 - DB0
8 - DB1
9 - DB2
10 - DB3
11 - DB4
12 - DB5
13 - DB6
14 - DB7
15 - PSB - Gnd
16 - NC
17 - RST
18 - VOUT
19 - BLA - Back Light Anode - through a 220 ohm resistor to +5
20 - BLK - Back Light Cathode - Gnd

Unassigned pins
Arduino
D10 Slave Select (SS)
D11 Master Out Slave In (MOSI)
D13 Serial Clock (SCK)

My guesses are
4 - RS - SS
5 - R/W - MOSI
6 - E - SCK
---- or ----
17 - RST - SS
8 - DB1- MOSI
7 - DB0 - SCK

But these are SWAGs

dc42


DC42,
If you have done this before, would you mind giving us as simple "Hello World" including the wiring connection?


It's all in the zip file in my dropbox, see reply #3. The wiring is described in comments in the .ino file.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

RandallR

At first, I did not get your zip file because of an SSL warning from my browser.  After I ignored the warning, I retrieved you file.

Bottom line, it works great.  Thanks.

BTW: you don't need to define MOSIpin or SSpin.  They are already define in Pins_Arduino.h.  It might simplify your code a little.

Go Up