fbpx

Interface LCD with 8051

Liquid crystal display is a very essential part in all embedded devices from calculator to printing machines,LCD works with voltage pluses ,with two are more kind of IC drivers in LCD display from LCD module.

Lcd Pin Configuration

Lcd Command

Hardware Required

  • Lcd.
  • PotentioMeter.
  • 8051 MicroController.

Circuit

Virtual Circuit

Code

 #include <REGx51.h> 
 void delay()
 {
  int i,j;
  for(i=0;i<1000;i++)
  {
   for(j=0;j<100;j++);
  }
 }
 // cmd Function Is Command To Lcd
 void cmd()
 {
 P3_0=0;
 P3_1=1;
 P2=a;
 delay();
 P3_1=0;
 }
 // dat Function Is Send Data To Display In Lcd
 void dat()
 {
 P3_0=1;
 P3_1=1;
 P2=a;
 delay();
 P3_1=0;
 }
 void main()
 {
 a=0x38;
 cmd();
 a=0x0C;
 cmd();
 a=0x01;
 cmd();
 a='M';
 dat();
 a='A';
 dat();
 a='K';
 dat();
 a='E';
 dat();
 a='R';
 dat();
 a='T';
 dat();
 a='E';
 dat();
 a='C';
 dat();
 a='H';
 dat();
 delay();
 }

Leave a Reply

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