help with rt-g12864a display and arduino uno

Hi, i am new with arduino and i want to connect st-g12864a display with arduino but i can't get info about it so could you please give me an example how to do it, this is the datasheet of the display http://www.bluemoon-lcd.com/english/pdf/G12864A.pdf thanks

That is a ks0108 based display.
I'd recommend using one of these libraries:
http://playground.arduino.cc/Code/GLCDks0108
https://bitbucket.org/bperrybap/openglcd/wiki/Home
https://code.google.com/p/u8glib/

They are all very complete and feature rich.
They have different capabilities, and different licensing terms so read
the documentation to determine which one you like.

Just as an FYI I was the co-author of GLCDv3 but am no longer maintaining or supporting
it as I have moved on to openGLCD which I am supporting.
So there is no longer anyone actively maintaining the GLCDv3 code.

--- bill

Do you have any example of this.. sorry but i am just getting started with arduino...

Those libraries include a substantial amount of documentation and include
many examples.
You will have to read the documentation to decide which one you like.

--- bill

Hi, i get ir works using u8glib but i have something like the picture attached, so how can i align the screen, thanks

DSC_0086[1].jpg

Looks like a chip select issue.
You can probably solve it by swapping the wires going to the chip select pins.

I can't remember for sure, but I think Oliver's default pin wiring of u8glib is the same as what I've used in openGLCD.
So you may be able to install the openGLCD library and have it "just work" with
your existing wiring.
openGLCD includes a diagnostic sketch to help diagnose issues like what you are seeing.

If the wiring is different, you could go into the openGLCD config files and easily change
the wiring to match what you have, so you can easily switch back and forth between the
two libraries.

--- bill

I think Bill is right about the chip-select lines. Try to exchange the pin numbers for CS1 and CS2 in the u8glib constructor.

oliver

Thank you guys so i got it work fine, now im triying to use with ethernet shield w5100 but i the display doesnt work correctrly, this is mi code:

#include "U8glib.h"
#include <SPI.h>
#include <Ethernet.h>

U8GLIB_KS0108_128 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 14, 15, 17, 16);

byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2,3);

EthernetServer server(80);

void setup() {

  Ethernet.begin(mac, ip);
  server.begin();
  //configura display 
  // assign default color value
  if ( u8g.getMode() == U8G_MODE_R3G3B2 ) {
    u8g.setColorIndex(255);     // white
  }
  else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) {
    u8g.setColorIndex(3);         // max intensity
  }
  else if ( u8g.getMode() == U8G_MODE_BW ) {
    u8g.setColorIndex(1);         // pixel on
  }
  else if ( u8g.getMode() == U8G_MODE_HICOLOR ) {
    u8g.setHiColorByRGB(255,255,255);
  }  
}
void creaMarcos(void){
  u8g.setDefaultForegroundColor();
  //CABECERA
  u8g.drawBox(0, 0, 105, 8);  
  //MARCO IZQUIERDO
  u8g.drawBox(0, 8, 1, 56);
  //MARCO DERECHO
  u8g.drawBox(127, 0, 128, 64);
  //BASE
  u8g.drawBox(0, 61, 128, 3);
}
void creaCabecera(void) {
  // graphic commands to redraw the complete screen should be placed here  
  u8g.setFont(u8g_font_5x8);
  u8g.setDefaultBackgroundColor();
  u8g.drawStr( 3, 7, "DEMO");  
}
void creaWebserver(void){
  // Escucha nuevos clientes
  EthernetClient client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
	  client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          client.print("<center><h1 style='color:red'>DOMSIP</h1></center>");        
          client.println("</html>");
          break;
        }
        if (c == '\n') {

          currentLineIsBlank = true;
        } 
        else if (c != '\r') {
          currentLineIsBlank = false;
        }
      }
    }
    delay(1);
    client.stop();
  }
}
void loop() {
  creaWebserver();
  u8g.firstPage(); 
  do {
    creaMarcos();
    creaCabecera();
  } while( u8g.nextPage() );
  delay(500);
}

DSC_0089[1].jpg

Is it working correctly without the ethernet shield?

Oliver

yes, without ethernet works fine when i comment in setup

Ethernet.begin(mac, ip);
  server.begin();

and in loop

creaWebserver();

Pin collision.
On Uno, pin 11 is MOSI which is used by the SPI h/w
And then there is some nasty SS (slave select) code
in the ethernet library.
On an UNO board it will slam PORTB bit 2 which is
digital pin 10.

So you have collisions with digital pins 10 and 11

--- bill

Any sugestion to solve this..

change the pins you use.

sorry, but i can't understand.
I tried changing arduino ping 10, 11 to 12, 13 and
change this code

U8GLIB_KS0108_128 u8g(8, 9, 12, 13, 4, 5, 6, 7, 18, 14, 15, 17, 16)

but doesnt work