0% found this document useful (0 votes)
54 views2 pages

ST7920 GLCD Tutorial - Opensourceszs

ST7920 GLCD tutorial

Uploaded by

tecniloco80
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views2 pages

ST7920 GLCD Tutorial - Opensourceszs

ST7920 GLCD tutorial

Uploaded by

tecniloco80
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ST7920 GLCD tutorial - opensourceszs https://sites.google.com/site/opensourceszs/project-arduino/st7920-glcd-t...

ST7920 12864B V2.0 Wiring and Arduino Documentation (ug8lib)


PINS CONNECTIONS:
PINS:

PIN 1 on LCD [VSS] to Ground


PIN 2 on LCD [VDD] to 5V (powered by ardiuno)
PIN 3 on LCD [V0] to middle pin of the POT
PIN 4 on LCD [RS] to D10 (arduino)
PIN 5 on LCD [R/W] to D11 (arduino)
PIN 6 on LCD [E] to D13 (arduino)
PIN 15 on LCD [PSB] to Ground
PIN 18 on LCD [VOUT] to PIN3 Pot (*)
PIN 19 on LCD [BLA] to 5V
PIN 20 on LCD [BLK] to Ground

Pot:
PIN 1 to 5V (powered by arduino)
PIN 2 to PIN 3 on LCD [V0]
PIN 3 to PIN 18 on LCD [VOUT]

DATASHEET:
Forum Discussion: http://forum.arduino.cc/index.php?topic=133736.0

Hello World Sample Code:

#include "U8glib.h"

// setup u8g object, please remove comment from one of the following constructor calls

U8GLIB_ST7920_128X64 u8g(13, 11, 10, U8G_PIN_NONE); // SPI Com: SCK = en = 13, MOSI
= rw = 11, CS = di = 0

void draw(void) {
IMAGES:
// graphic commands to redraw the complete screen should be placed here

u8g.setFont(u8g_font_unifont);

//u8g.setFont(u8g_font_osb21);

u8g.drawStr( 0, 22, "Hello World!");

void setup(void) {

// flip screen, if required

// u8g.setRot180();

// set SPI backup if required

//u8g.setHardwareBackup(u8g_backup_avr_spi);

// 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

1 of 2 5/30/2015 10:55 AM
ST7920 GLCD tutorial - opensourceszs https://sites.google.com/site/opensourceszs/project-arduino/st7920-glcd-t...

void loop(void) {

// picture loop

u8g.firstPage();

do {

draw();

} while( u8g.nextPage() );

// rebuild the picture after some delay

delay(500);

Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites

2 of 2 5/30/2015 10:55 AM

You might also like