/*LCD DRIVER*/
//PROGRAMED BY BALAJI ANY BUG REPORT:mail id:[email protected]
#include<reg51.h> //HEADER FILE IN KEIL 3
#define S P3 //DEFINE PORT HERE
sbit rs=P2^0; //PLEASE SELECT CONTROL BIT FOR LCD
sbit rw= P2^1;
sbit en=P2^2;
void cmdwrite(int value); //FUNCTION FOR COMMAND WRITE
void datawrite(int value); //FUNCTION FOR DATAWIRTE
void delay(int itime); //FUNCTION FOR DELAY
void main()
{
S=0X00; //PORT CONFIGURE AS THE OUTPUT
cmdwrite(0x38);
cmdwrite(0x0E);
cmdwrite(0X01);
cmdwrite(0X06);
cmdwrite(0X84);
datawrite(0x41);//PASSING THE VALUE FOR DISPLAY THE CHAR A
datawrite(0x42);
}
void cmdwrite(int value)
{
S=value;
rs=0;
rw=0;
en=1;
delay(1);
en=0;
}
void datawrite(int value)
{
S=value;
rs=1;
rw=0;
en=1;
delay(1);
en=0;
}
void delay(int itime) //USER DEFINED DELAY
{
int i,j;
for(i=0;i<itime;i++) //IF U WANT TO MORE DELAY CHANGE THE PASSING THE VALUE
for(j=0;j<1275;j++);
}