This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C51 LCD help needed

Hello EveryBody, I am working on LCD (16x2) and i have some problems with the programming. I am using C51 language for my LCD.
I am using that LCD in 8-bit mode and i have connected my AT89S8252 (with some pull-ups)
P0 DB
P2.0 RS
P2.1 RW
P2.2 E
and i have interfaced my LCD with my MCu but my problem is that i am getting the LCD not working ...

CODE in C51

#include <reg52.h>
#include <stdio.h>

sbit RS=P1^6;
sbit E =P1^4;
sbit RW=P1^5;

pausa(int j)
{ int i;
  for (i=0;i<j;i++)
  continue;
}


variaE()
{
  E =1;
    ;
  E =0;
 }


void delay(int m)
{
        int j;
        for(j=0;j<=m;j++)
        continue;
}

LCDWI (char n)
{
  RW =0;
  RS=0;
  E =0;
  P0=n;
  E =1;
  E =0;
  pausa(50);
}


LCDWD(char n)
{
  RW=0;
  RS=1;
  E=0;
  P0=n;
  E=1;
  E=0;
  pausa(50);
}

print_LCD(char a,char *s)
{
LCDWI(a);
while(*s != 0)
LCDWD(*s++);
}


i_LCD()
{
  RS=0;
  E=0;
  P0=0x30;variaE();delay(10);variaE();delay(1);variaE();delay(1);
  P0=0x20;variaE();variaE();variaE();
  LCDWI(0x38);
  LCDWI(0x0c);
  LCDWI(0x06);
  LCDWI(1);
  delay(50);
}


void main()
{
 i_LCD();
 print_LCD(0x80,"LCD Thermometer");

}

0