fbpx

Interface Glcd With 8051

  • The graphical LCD is made up of a grid of pixels.
  • The 16×2 Character LCDs have their own limitations.
  • The Graphical LCDs are thus used to display customized images and characters.
  • GLCD used in many application such as video games, mobile phones.
  • LCD has a display format of 128×64 (resolution) dots.
  • There are 64 horizontal lines and each line has 128 pixels.
  • The glcd has a graphic RAM where each bit in ram corresponds to one pixel on screen.Glcd screen will change when we modifiy the content of graphic ram.
  • The 128×64 LCD is divided into two equal halves.
  • Whole LCD is divided equally into pages.
  • Each half being controlled by a separate KS0108 controller.
  • 128×64 LCD it have 128 columns and 64 rows. In total there are (128×64 = 1024) pixels.
  • 128×64 LCD is divided equally into two halves. Each half is controlled by a separate controller and consists of 8 pages.
  • Controller can select by CS (chip select).
  • Each page consists of 8 rows and 64 columns.
  • Two horizontal pages make 128 (64×2) columns and 8 vertical pages make 64 rows (8×8).

Glcd Pin Configuration

Hardware Required

  • Glcd.
  • PotentioMeter.
  • 8051 MicroController.

Circuit

Virtual Circuit

Code

 #include <REGx51.h>
 sbit cs1=P3^5;
 sbit cs2=P3^4;
 sbit re=P3^5;
 void delay(unsigned int d)
 {
 unsigned int i,j;
 for(i=0;i< d;i++)
 for(j=0;j<j++);
 }
 void lcdcmd(char value)
 {
 P1=value;
 P3_1=0;
 P3_0=0;
 P3_2=0;
 delay(300);
 P3_2=1;
 delay(300);
 P3_2=0;
 }
 lcddat(char data1)
 {
 P1=data1;
 P3_1=0;
 P3_0=1;
 P3_2=0;
 delay(300);
 P3_2=1;
 delay(300);
 P3_2=0;
 }
 void main()
 {
 cs1=0;
 cs2=1;
 re=1;
 lcdcmd(0x3F); //Display on
 lcdcmd(0x40); //Set y-address
 lcdcmd(0xB9); //Set x-address page 0
 lcdcmd(0xC0); //start line
 delay(3000);
 lcddat(0x7F); // E
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x41);
 lcddat(0x7F); //L
 lcddat(0x40);
 lcddat(0x40);
 lcddat(0x40);
 lcddat(0x40);
 lcddat(0x00);
 lcddat(0x7F); // E
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x41);
 lcddat(0x00);
 lcddat(0x3E); // C
 lcddat(0x41);
 lcddat(0x41);
 lcddat(0x41);
 lcddat(0x22);
 lcddat(0x00);
 lcddat(0x01); // T
 lcddat(0x01);
 lcddat(0x7F);
 lcddat(0x01);
 lcddat(0x01);
 lcddat(0x00);
 lcddat(0x7F); // R
 lcddat(0x09);
 lcddat(0x19);
 lcddat(0x29);
 lcddat(0x46);
 lcddat(0x00);
 lcddat(0x3E); // O
 lcddat(0x41);
 lcddat(0x41);
 lcddat(0x41);
 lcddat(0x3E);
 lcddat(0x00);
 lcddat(0x7F); // N
 lcddat(0x04);
 lcddat(0x08);
 lcddat(0x10);
 lcddat(0x7F);
 lcddat(0x00);
 lcddat(0x00); // I
 lcddat(0x41);
 lcddat(0x7F);
 lcddat(0x41);
 lcddat(0x00);
 lcddat(0x3E); // C
 lcddat(0x41);
 lcddat(0x41);
 lcddat(0x41);
 lcddat(0x22);
 lcddat(0x00);
 lcddat(0x46); // S
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x31);
 lcddat(0x00);
 cs1=1;
 cs2=0;
 lcdcmd(0x3F); //Display on
 lcdcmd(0x40); //Set y-address
 lcdcmd(0xB9); //Set x-address page 0
 lcdcmd(0xC0); //start line
 lcddat(0x7F); // M
 lcddat(0x02);
 lcddat(0x04);
 lcddat(0x02);
 lcddat(0x7F);
 lcddat(0x00);
 lcddat(0x7E); // A
 lcddat(0x11);
 lcddat(0x11);
 lcddat(0x11);
 lcddat(0x7E);
 lcddat(0x00);
 lcddat(0x7F); // K
 lcddat(0x08);
 lcddat(0x14);
 lcddat(0x22);
 lcddat(0x41);
 lcddat(0x00);
 lcddat(0x7F); // E
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x49);
 lcddat(0x41);
 lcddat(0x00);
 lcddat(0x7F); // R
 lcddat(0x09);
 lcddat(0x19);
 lcddat(0x29);
 lcddat(0x46);
 lcddat(0x00);
 while(1);
 }

Leave a Reply

Your email address will not be published. Required fields are marked *