fbpx

Interface GLCD With PIC

Description

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 applications 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 the screen.GLCD screen will change when we modify the content of graphic RAM.
  • The 128×64 LCD is divided into two equal halves.
  • The whole LCD is divided equally into pages.
  • Each half is controlled by a separate KS0108 controller.
  • 128×64 LCD has 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 Page Information

GLCD Pin Configuration

Hardware Required

  • Glcd.
  • PotentioMeter.
  • Pic16f877a MicroController.

Circuit

Virtual Circuit

Code

 sbit GLCD_CS1 at RC5_bit;
 sbit GLCD_CS2 at RC4_bit;
 sbit GLCD_RS at RC3_bit;
 sbit GLCD_RW at RC2_bit;
 sbit GLCD_EN at RC1_bit;
 sbit GLCD_RST at RC0_bit;
 sbit GLCD_CS1_Direction at TRISC5_bit;
 sbit GLCD_CS2_Direction at TRISC4_bit;
 sbit GLCD_RS_Direction at TRISC3_bit;
 sbit GLCD_RW_Direction at TRISC2_bit;
 sbit GLCD_EN_Direction at TRISC1_bit;
 sbit GLCD_RST_Direction at TRISC0_bit;
 void main()
 {
 Glcd_Init();
 do
 {
 Glcd_Fill(0xFF);
 Delay_ms(1000);
 Glcd_Fill(0x00);
 Delay_ms(1000);
 Glcd_Rectangle(5, 5, 40, 40, 1);
 Delay_ms(3000);
 Glcd_Fill(0x00);
 Delay_ms(1000);
 Glcd_Circle(50, 50, 10, 1);
 Delay_ms(1000);
 }
 while(1);
 } 

Leave a Reply

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