Electronics

LCD 128x64 Graphical Display Yellow Background

AED 51.45

1

Description

The 12864B Graphic LCD module is a 128 x 64 pixel LCD display with a Yellow backlight and white foreground. The display is fully programmable and can display a combination of both graphics and text. It can operate in both parallel and serial (SPI) modes which can be configured by the external pin PSB. In SPI mode only 3 data pins are required to drive this display. No potentiometer is required to set the contrast as this is pre-set by the factory to an optimum level.

Specifications:



Encapsulation:COB(Chip-on-Board)
Display Format:128x64 dots
Display Type: STN, Transflective, Positive, Yellow
Controller: ST7920
Interface:8-bit parallel interface or serial SPI modes
Backlight: Yellow
Driving Scheme:1/64 Duty Cycle, 1/9 Bias
Power Supply Voltage:5.0 V
Operation temperature:-20°C to +70°C
Storage temperature:-30°C to +80°C


PSB:



this LCD shipped with the PSB (parallel/serial select) pin shorted to VDD by a 0-ohm resistor fitted to R9 on the back of the LCD (see image above). This fixes the LCD in parallel mode. If this resistor is fitted and you wish to use the LCD in the serial mode you will either need to move the resistor to R10 or completely remove it and ground the PSD pin.

Arduino Connections In Serial (SPI) Mode:

For Arduino Uno

MODULE..........................UNO
K (backlight cathode).........GND
A (backlight anode)..........+5V
PSD (SPI Mode).................GND (SEE NOTE)
E (SCK)..........................D13
R/W (MOSI)....................D11
RS (CS)..........................D10*
VDD.............................+5V
VSS..............................GND

For Arduino Mega

MODULE..........................MEGA
K (backlight cathode).........GND
A (backlight anode)..........+5V
PSD (SPI Mode).................GND (SEE NOTE)
E (SCK)..........................D52
R/W (MOSI)....................D51
RS (CS)..........................D53*
VDD.............................+5V
VSS..............................GND

*This pin is configured in software, see '#define CS_PIN 10' line in example sketch below.

Arduino Library for LCD 128x64 Graphical Display Yellow Background 12864B
:


There are a number of pre-written libraries available for this module. For the Arduino example sketch is shown below, we have chosen to use the u8glib library. You can download a snapshot of this library here:

u8glib_arduino_v1.12.zip

The latest version and AVR versions of this library can be downloaded here



/*

PINOUT:

MODULE UNO
K (backlight cathode) GND
A (backlight annode) +5V
PSD (SPI Mode) GND (SEE NOTE)
E (SCK) D13
R/W (MOSI) D11
RS (CS) D10
VDD +5V
VSS GND

Connection to the V0 pin (contrast) is not required.

Note: Some versions of this LCD are shipped with the PSB (parallel/serial select) pin
shorted to VDD by a 0 ohm resistor fitted to R9 on the back of the LCD. This fixes the
LCD in parallel mode. If this resistor is fitted and you wish to use the LCD in serial mode you will either need to move the resistor to D10 or completely remove it and ground the PSD pin.

U8glib library copywrite notice:

Universal 8bit Graphics Library, http://code.google.com/p/u8glib/

*/



/* Include the U8glib library */
#include "U8glib.h"

/* Define the SPI Chip Select pin */
#define CS_PIN 10

/* Create an instance of the library for the 12864 LCD in SPI mode */
U8GLIB_ST7920_128X64_1X u8g(CS_PIN);

void setup() 
{
}

/* Main program */
void loop() 
{
/* Start of a picture loop */
u8g.firstPage(); 

/* Keep looping until finished drawing screen */
do 
{
/* Set the font */
u8g.setFont(u8g_font_courB14);

/* Display some text */
u8g.drawStr( 35, 26, "HOBBY");
u8g.drawStr( 8, 46, "COMPONENTS");

/* Draw a simple border */
u8g.drawFrame(5,5,117,54);
u8g.drawFrame(3,3,121,58);

}while(u8g.nextPage());
}