Pages: [1]   Go Down
Author Topic: 128x64 LCD connecting to arduino  (Read 2354 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
« Last Edit: May 05, 2012, 12:06:28 pm by ammygo » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 209
Office meets Adruino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

and need 128x64 code sample
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: May 06, 2012, 09:04:38 am by ammygo » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Sr. Member
****
Karma: 1
Posts: 314
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Sr. Member
****
Karma: 1
Posts: 314
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Sr. Member
****
Karma: 1
Posts: 314
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: