Microcontroller › 8051 › plz tell the problem in this lcd program.it is not showing the output › please use this code and
June 19, 2013 at 3:47 pm
#9990
Participant
please use this code and reply to this mailid the code is correct or wrong and one more thing pl send correct microcontroller no .ex p89v51rd2 like that .
if u have any question pl contact me
+919940840471 after 6 pm
#include<reg51.h>
#define command P1
#define data P2
sbit rs = P1^0;
sbit rw = P1^1;
sbit e = P1^2;
void delay_ms(unsigned int m)
{
int i,j;
for(i=0;i<m;i++);
for(j=0;j<233;j++);
}
void lcd_command(unsigned char value)
{
P1=value;
rs=0;
rw=0;
e=1;
delay_ms(100);
e=0;
}
void lcd_data(unsigned char value)
{
P2=value;
rs=1;
rw=0;
e=1;
delay_ms(100);
e=0;
}
void init()
{
lcd_command(0x38);
lcd_command(0x0e);
lcd_command(0x06);
}
void main()
{
init();
lcd_command(0x80);
lcd_data(‘s’);
delay_ms(10);
lcd_data(‘i’);
delay_ms(10);
lcd_data(‘r’);
delay_ms(10);
}