How to display an image on Graphics LCD using AT89C52

Summary

The Graphics LCD as the name suggests is a type of LCD which can display graphics. The graphical representation of any data presents good understanding than just characters. More user friendly applications can be designed by using the graphical LCDs. The graphical LCD can be used for advertisement boards or information boards and so on. This article explains the method of displaying image on a 128x64 graphical LCD using AT89C52. For basic operations and working, refer Graphics LCD interfacing with 8051
Display-Image-on-GLCD-by-interfacing-it-with-8051

Description

Microcontroller AT89C52 has been used to control the operations of the graphical LCD. The Graphics LCD used here is JHD12864E. This LCD is divided into two parts which are controlled by two different controllers. Each of these parts is divided into rows and columns. For basic instructions and programming procedure, refer to interfacing Graphics LCD with 8051. Also see displaying text on Graphics LCD.
 
For an image to be displayed on (128x64) graphics LCD, the image must have following features:
·         It should be in Windows BitMap format (.bmp)
·         It should be black and white (1 bit per pixel)
·         It should not have any compression
·         Its size should be 128 x 64 pixels
 
The hex code for an image can be generated from any of the bitmap code generating software available on internet. These codes are stored in an array and the array is stored in a header file with ‘.h’ extension. This header file must be included in main program. (The header file declarations for this project is given in Code2) The connections of Graphical LCD with controller are shown in circuit diagram.
 
Programming Steps:
A function is written to display the image in the format of a two dimensional array with size: [8][128].
a)    First, set the column and page to 0.
 
b)   Column is made to vary from 0 to 128 while row is kept constant. The corresponding hex code from the two dimensional array is then sent to the LCD Data Port.
 
c)     [ lcddata(&val[ (j*128) ],128); ] This condition is used to display codes on LCD from column 0 to 127. j*128 is given to skip 128 bytes when page(row) changes.

 

Circuit Diagram

Video

Code

This Code is only visible to Registered users. Please Login/Register

Code2

This Code is only visible to Registered users. Please Login/Register

Components

Graphical LCD | GLCD Module Image
Graphics LCD

The 16x2 Character LCDs have their own limitations; they can only display characters of certain dimensions. The Graphical LCDs are thus used to display customized ch...
AT89C52 Microcontroller Image
AT89C52 Microcontroller
 
AT89C52 is an 8-bit microcontroller and belongs to Atmel's...