128x64 LCD connecting to arduino

Hi, I have lcd 128x64 12864zb someone like this: Graphic LCD 128x64 STN LED Backlight - LCD-00710 - SparkFun Electronics
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!

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

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

and need 128x64 code sample

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 Dropbox - File Deleted - Simplify your life, and u8glib at Google Code Archive - Long-term storage for Google Code Project Hosting..

this is my lcd pictures:

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

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.

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

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.

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

RandallR:
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.

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.

Here is an adaptation of the hackvision Pong for 128x64 displays based on the ST7920 chip which uses your controller (thank you). It uses two buttons for up and down and a beeper on pin 8.

TFTPong.zip (12.3 KB)