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

p89v51rd2 code simukation working but after burning not working

I am using following program for P89v51rd2. In Keil simulation is working but when i am burning same using Flash Magic ,it is not working. I have checked Memory Data using Flash Magic It is same as in Keil Debugger.Nothing is working after burning ,no port data updation is taking place. Please help Me.

//Program for RFID based Secured access system using 8051 microcontroller
#include <intrins.h>
#include <p89v51rx2.h>
sfr lcd_data_pin=0xA0;  //P2 port
sbit rs=P1^0;
sbit rw=P1^1;
sbit en=P1^2;


void delay(unsigned int count)  //Function to provide time delay
{
        int i,j;
        for(i=0;i<count;i++)
        for(j=0;j<1275;j++);
}

void lcd_command(unsigned char comm)   //Lcd command funtion
{
        lcd_data_pin=comm;
        en=1;
        rs=0;
        rw=0;
        delay(1);
        en=0;
}

void lcd_data(unsigned char disp)  //Lcd data function
{
        lcd_data_pin=disp;
        en=1;
        rs=1;
        rw=0;
        delay(1);
        en=0;
}

lcd_string(unsigned char *disp)  //Lcd string function
{
        int x;
        for(x=0;disp[x]!=0;x++)
        {
                lcd_data(disp[x]);
        }
}

void lcd_ini()                            //Function to initialize the LCD
{
        lcd_command(0x38);
        delay(5);
        lcd_command(0x0F);
        delay(5);
        lcd_command(0x80);
        delay(5);
}


void main()
{
                                                                // Trigger Timer 1
        lcd_ini();
        lcd_command(0x80);                                      //Place cursor to second position of first line
        lcd_string("Pls scan your ID");
        delay(200);

}


Regards
Manish

Parents
  • Dear paramasivam ; Thanks for trying my program...this is error due to declaration of function...whenever you specify function before "Main" it is know as function prototype decleration...so please insure you have declear rightly before "main", for more details please refer any "c language" book.secondly i did mistake by setting LCD brightness too high that is why it was appearing as not working.

    Regards
    Manish Puraswani

Reply
  • Dear paramasivam ; Thanks for trying my program...this is error due to declaration of function...whenever you specify function before "Main" it is know as function prototype decleration...so please insure you have declear rightly before "main", for more details please refer any "c language" book.secondly i did mistake by setting LCD brightness too high that is why it was appearing as not working.

    Regards
    Manish Puraswani

Children