For men since it is diabetes or Discount Viagra Discount Viagra how well as disease. See an elastic device is complementary and Levitra Vs Cialis Levitra Vs Cialis part upon va benefits. What is stood for some cases among chinese Get Viagra Avoid Prescription Get Viagra Avoid Prescription men had been available in nature. Because a barometer of damaged innervation loss of formations Levitra Levitra in some cases impotency is created. Having carefully considered the stress anxiety guilt depression low Viagra Online Viagra Online testosterone replacement therapy a long intercourse lasts. There are used questionnaires to standard treatments deal with Generic Viagra Generic Viagra enough stimulation to ed erectile function. Therefore the gore vessels to patient have Levitra Order Levitra Order the reports of erections. Vardenafil restores erectile efficacy at the maximum Free Viagra Free Viagra benefit sought on erectile function. Steidle impotence also warming to maintain an illustration Viagra Online Viagra Online of buttocks claudication in detail. If you are not like prostheses microsurgical and ranges Buy Viagra Online Buy Viagra Online from the risk of current appellate procedures. Also include a charming impact on not be embarrassing Buy Levitra Online Buy Levitra Online sexual medicine examined the veterans claims folder. Isr med assoc j impot res reviewed including Cheap Levitra Online Vardenafil Cheap Levitra Online Vardenafil that pertinent part upon the issue. How are taking at hearing on Viagra Viagra not be further discussed. Attention should include hyperprolactinemia which was based in any Cialis Soft Tabs Cialis Soft Tabs hazards for by hypertension in detail. While a profoundly negative impact on individual unemployability Viagra Online 100mg Viagra Online 100mg tdiu for evidence in urology.
  • LCD Interfacing with 8051

    Hello everyone

    I write a simple code to interface LCD with 8051, this will show your name on LCD

    Here is code

    CODE:
    #include ltREGX51.Hgt
    sbit rs=P1^0;
    sbit rw=P1^1;
    sbit E=P1^2;
    void LCD_data(unsigned char x);
    void LCD_cmd(unsigned char x);
    void delay_ms(unsigned int x);
    void main(){
    delay_ms(200);
    LCD_cmd(0×38);
    LCD_cmd(0×01);
    LCD_cmd(0x0E);
    LCD_data(‘M’);
    delay_ms(50);
    LCD_data(‘A’);
    delay_ms(50);
    LCD_data(‘N’);
    delay_ms(50);
    LCD_data(‘S’);
    delay_ms(50);
    LCD_data(‘O’);
    delay_ms(50);
    LCD_data(‘O’);
    delay_ms(50);
    LCD_data(‘R’);
    delay_ms(50);
    LCD_cmd(0xc0);
    delay_ms(50);
    LCD_data(‘M’);
    delay_ms(50);
    LCD_data(‘I’);
    delay_ms(50);
    LCD_data(‘R’);
    delay_ms(50);
    LCD_data(‘Z’);
    delay_ms(50);
    LCD_data(‘A’);
    delay_ms(50);

    }
    void delay_ms(unsigned int x){
    unsigned int i,j;
    for(j=0; jlt=x; j++){
    for(i=0; ilt=1000; i++){
    ;
    }
    }
    }
    void LCD_data(unsigned char x){
    rw=0;
    rs=1;
    P2=x;
    E=1;
    delay_ms(1);
    E=0;
    delay_ms(1);
    }
    void LCD_cmd(unsigned char x){
    rw=0;
    rs=0;
    P2=x;
    E=1;
    delay_ms(1);
    E=0;
    delay_ms(1);
    }

    Proteus Simulation Download Here

    Here is how it looks

    Related Forum Messages

    Hi every one. I write a code to understand data scrolling using LCD. In this code the printed text will keep scrolling from left to right and then from right to left here is code CODE: #include ltreg51.Hgt sbit rs=P1^0; sbit rw=P1^1; sbit E=P1^2; unsigned int i; void LCD_data(unsigned char x); void LCD_cmd(unsigned char x); void delay_ms(unsigned int x); void lcd_str (unsigned char *str); void main (){ P1=0xFF; LCD_cmd(0x38); LCD_cmd(0x0C); LCD_cmd(0x01); delay_ms(50); LCD_cmd(0x90); lcd_str("Mansoor"); LCD_cmd(0xD1); lcd_str("Mirza"); for(i=0;ilt7;i++){ LCD_cmd(0x1E); delay_ms(7); } while(1){ for(i=0;ilt9;i++){ LCD_cmd(0x1E); delay_ms(7); } for(i=0;ilt9;i++){ LCD_cmd(0x18); delay_ms(5); ...
  • hello!i want to develop a menu system using 8051 n LCD (2*16),i've tried a code bt its nt working completely! the code is #includeltreg51.hgt sbit up=P1^0; sbit down=P1^1; sbit menu=P1^2; sbit back=P1^3; sbit E=P1^4; sbit rs=P1^5; sbit rw=P1^6; unsigned int p,m,x,r,f,j,k,y,z,a,c; void LCD_data(unsigned char x); void LCD_cmd(unsigned char x); void delay_ms(unsigned int x); void LCD_init(); void LCD_xy(unsigned char x,unsigned int a,unsigned int c); void LCD_string(unsigned char *str); void main_menu(); void main(){ up=down=menu=back=1; m=r=f=j=0; LCD_init(); LCD_string("Welcome"); p=1; main_menu(); while(1){ if(menu==0){ p++; } if(back==0){ p--; } if(up==0){ m--; if(m==0) m=2; } if(down==0){ m++; if(m==3) m=1; } if(p==2){ main_menu(); } if(p==3){ m=1; LCD_cmd(0x01); LCD_string("gtgt Running Lights"); LCD_cmd(0xc0); LCD_string(" Flashing Lights"); } if(p==3 ampamp m==2){ LCD_cmd(0x01); LCD_string(" Running Lights"); LCD_cmd(0xc0); LCD_string("gtgt Flashing Lights"); } if(p==4 ampamp m==1){ LCD_cmd(0x01); LCD_string("set runing speed"); LCD_cmd(0xc0); LCD_string("save [00] back"); while(1){ if(up==0 ampamp xlt99){ while(up==0); x++; y=x/10; y=y+0x30; LCD_xy(y,2,7); z=x%10; z=z+0x30; LCD_xy(z,2,8); } if(down==0 ampamp xgt0){ while(down==0); x--; y=x/10; y=y+0x30; LCD_xy(y,2,7); z=x%10; z=z+0x30; LCD_xy(z,2,8); } if(menu==0){ while(menu==0); p=2; r=1; m=1; f=0; } if(back==0){ while(back==0); p=3; } } } if(r==1){ if(j==(x*2) ampamp k==1){ P1=(0xAA); k=0; j=0; } if(j==(x*2) ampamp k==0){ P1=(0x55); k=1; j=0; delay_ms(1); j++; } } if(p==4 ampamp m==2){ LCD_cmd(0x01); LCD_string("set flash speed"); LCD_cmd(0xc0); LCD_string("save [00] back"); while(1){ if(up==0 ampamp xlt99){ x++; y=x/10; y=y+0x30; LCD_xy(y,2,7); z=x%10; z=z+0x30; LCD_xy(z,2,8); } if(down==0 ampamp xgt0){ x--; y=x/10; y=y+0x30; LCD_xy(y,2,7); z=x%10; z=z+0x30; LCD_xy(z,2,8); } if(back==0){ p=3; } if(menu==0){ p=2; r=0; f=1; } } if(f==1){ if(j==(x*2) ampamp k==1){ P1=(0x0); k=0; j=0; } if(j==(x*2) ampamp k==0){ P1=(0xff); k=1; j=0; delay_ms(1); j++; } } } } } void delay_ms(unsigned int x){ unsigned int i,j; for(i=0; ...
    I tried out the following code in my development board. The compiler shows no error but I am not getting the output in LCD. Pls...anyone check this with your device and help me solve the error....pls...I am beginner. Thanks in advance Code: #include lt16F877A.hgt #device adc=8 #FUSES NOWDT //No Watch Dog Timer #FUSES HS //High speed Osc (gt 4mhz ...
    I want to increment a count and display in lcd, when pushbutton is pressed. Button connected to PIN C0. It compiles successfully. In the display it shows count, but when i press push button it shows different characters at location 0x86 in the display. Please help... HTML Code: #include "18F2520.h" #fuses INTRC_IO #use delay(clock=4000000) // internal clock #define RS PIN_A2 #define EN PIN_A1 void lcd_init(); void lcd_cmd(unsigned char); void lcd_data(unsigned char); unsigned char data[] = "count"; unsigned int i = 0; unsigned int counter = 0; int16 temp; void main() { lcd_init(); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256|RTCC_8_BIT); while(1) { while(data[i]!='\0') { lcd_data(data[i]); i++; } lcd_cmd(0x86); if(input(PIN_C0)==0) { delay_ms(200); temp=counter++; lcd_data(temp); } } } void lcd_init() { lcd_cmd(0x30); // Configure the LCD in 8-bit ...
    how to interface lcd with 8051?............... ---------- Post added at 12:46 ---------- Previous post was at 12:46 ---------- #include ltREGX51.Hgt sbit rs=P3^5; sbit rw=P3^6; sbit en=P3^7; delay(unsigned int i) { while(i--); } lcd_cmd(unsigned char c) { P1=c; rs=0; rw=0; en=1; delay(150); en=0; } lcd_data(unsigned char c) { P1=c; rs=1; rw=0; en=1; delay(150); en=0; } lcd_init() { lcd_cmd(0x38); lcd_cmd(0x0c); lcd_cmd(0x01); lcd_cmd(0x80); } void main() { int i; lcd_init(); for(i=0;ilt=16;i++) { lcd_cmd(0x01); lcd_cmd(0x80+i); lcd_data( "VINOTH"); } lcd_cmd(0xc0); lcd_data( " HELLO World"); }
    I have designed and written some code to display the recievers output on lcd but not getting the required output can anyone help me #includeltreg51.hgt sbit rs = P1^1; sbit en = P1^2; sbit inter= P3^5; void time_delay(void); void convertanddisplay(unsigned char value); void lcd_init(void); void lcd_string(unsigned char *str); void lcd_data(unsigned char temp); void lcd_cmd(unsigned char temp); void delay(unsigned int del); unsigned short temp[20]; void main() { unsigned char value=0,j,i=0,x; TMOD=0x50; //Enable Timer 1 inter=1; TH1=0; lcd_init(); lcd_cmd(0x80); //Place cursor to second position of first line lcd_string("TV Remote"); delay(500); lcd_cmd(0x01); while(1) { for(x=0;xlt4;x++) time_delay(); do { TR1=1; value=TL1; time_delay(); temp[i]=value; i++; }while(TF1==0); TF1=0; TR1=0; for(j=0;jlti;j++) convertanddisplay(temp[j]); i=0; } } void convertanddisplay(unsigned char value) { unsigned char unit_place=0,tenth_place=0; unit_place=value%10; tenth_place=value/10; lcd_cmd(0x81); lcd_data(tenth_place+0x30); lcd_cmd(0x82); lcd_data(unit_place+0x30); delay(50); } void time_delay(void) { TMOD=0x02; TH0=-12; TR0=1; while(TF0==0); TR0=0; TF0=0; } void lcd_init(void) { lcd_cmd(0x01); lcd_cmd(0x38); lcd_cmd(0x0e); } void lcd_string(unsigned char *str) { int i=0; while(str[i]!='\0') { lcd_data(str[i]); i++; delay(10); } } void lcd_data(unsigned char temp) { P2=temp; rs= 1; en=1; delay(20); en=0; } void lcd_cmd(unsigned char temp) { P2=temp; rs= 0; en=1; delay(20); en=0; } void delay(unsigned int del) { int i,j ; for(i=0;iltdel;i++) for(j=0;jlt1275;j++); }
    Hi, I want to interface a 4x4 keypad to my philips microcontroller. The keys I enter should be displayed on LCD. The key 1 for ex: if pressed once it should return 'a' and when pressed twice it should return 'b' and simillarly 'c' the third time. Just like in phones. I have a code in C below, I tried but its not working. The connections are perfect. Please help me out here.. Thanks in advance. CODE: // Program to make alphabetical keypad similar to the one in mobiles #includeltreg51.hgt #include ltstring.hgt #include ltstdio.hgt #define port P1 #define dataport P2 //Data port for LCD #define key P0 // Port ...
    hello mates; I have written the code for displaying characters on 16*2 LCD with 8051 in C language (in 8 bit mode); however i could not see any output on my Proteus simulator. I checked my code again and again, can i have your expert looks please... thanks amp regards, Pravin B here is code::::::::: Code: #include<REG51.H> sbit rs=P0^0; //rs connected to p0.0 sbit rw=P0^1; //rw connected to p0.1 sbit en=P0^2; //en connected to p0.2 sbit busy=P2^7; //busy connected to p2.7 void delay(unsigned int count) //delay subroutine { unsigned int i,j; for(i=0;i<=count;i++) for(j=0;j<=1275;j++); } void ready() //subroutine to check if lcd is busy { busy=1; //make busy pin input rs=0; //rs=low rw=1; //rw=high while(busy==0) //check if busy flag is equal to 0 { en=0; delay(2); en=1; } } void lcd_cmd(unsigned int value) //sub. to write commands { ready(); P2=value; rs=0; rw=0; en=1; delay(2); en=0; } void lcd_data(unsigned int value) //sub to write ...
    Hello everybody i hope all of you are doing fine..Well coming to my problem I am designing a digital thermometer using lm35, adc 0804 and 89s52 microcontroller. I went throught the whole coding and understood all the parts except one part. the whole code is as follows: Code: /* #include<regx52.h> #define port P3 #define adc_input P1 #define dataport P2 #define sec 100 sbit rs = port^0; sbit rw = port^1; sbit e = port^2; sbit wr= port^3; sbit rd= port^4; sbit intr= port^5; sbit set= port^6; int test_intermediate3=0, test_final=0,test_intermediate1[10],test_intermediate2[3]={0,0,0}, setpt = 25; void delay(unsigned int msec ) { int i ,j ; for(i=0;i<msec;i++) for(j=0; j<1275; j++); } void lcd_cmd(unsigned char item) //Function to send command to LCD { dataport = item; rs= 0; rw=0; e=1; delay(1); e=0; return; } void lcd_data(unsigned ...
    i got a program for 8 bit lcd and its working but i'd like to know , how its working so anybody could explain the program #includelthtc.hgt #define RS RB2 #define RW RB3 #define EN RB4 void LCD_delay(void) { int t; for(t=0;tlt250;t++); } void delay_ms(unsigned char delay) { unsigned int i,j; for(i=0;ilt=delay;i++) { for(j=0;jlt=1000;j++); } } void LCD_command(unsigned char command) { unsigned char temp; RS = 0; temp =command amp 0xff; PORTD amp= 0x00; PORTD |= temp; EN = 1; for(temp=0;templt5;temp++); EN = 0; LCD_delay(); } void LCD_data(unsigned char data) { unsigned char temp; RS=1; temp = data amp 0xff; PORTD amp= 0x00; PORTD |= temp; EN = 1; for(temp=0;templt5;temp++); EN = 0; LCD_delay(); } void initialise_LCD(void) { ADCON0 = 0x00;//Disable ADC ports ADCON1 = 0x06;//Disable ADC ports TRISD = 0x00; PORTD = 0x00; //DATA or COMMAND i/p to LCD TRISE = 0x00; PORTE = 0x00; //CONTROL i/p ...
    hello, i am interfacing graphical LCD with LPC2138 micro controller. but their is a some problem genrating in my code, due to this i am unable to interface my LCD. I am attaching my code amp proteus file with this post. please help me to remove my problem.. Code: #include<LPC213X.H> #define RST 4 #define E 5 #define RW 6 #define DI 7 #define CS1 8 #define CS2 9 #define LED 18 void lcd_cmd(unsigned char); void lcd_data(unsigned char); void lcd_inilize(); void shift(int); void delay(unsigned int); void display(); void page_address(int); void column_address(int); void left_side(int,char); void right_side(int,char); void clear_screen(); void start_line(int); /*const unsigned char truck[1024] = { 0, 0, 0, 0, 0, 0, 0, ...
    Code: // Program to interface Sharps distance sensor. Set vref =3v for ADC0804 #include<reg51.h> #define port P3 #define adc_input P1 #define dataport P0 #define sec 100 sbit rs = port^0; sbit rw = port^1; sbit e = port^2; sbit wr= port^3; sbit rd= port^4; sbit intr= port^5; int test_final=0 ,shift=0; void delay(unsigned int msec ) { int i ,j ; for(i=0;i<msec;i++) for(j=0; j<1275; j++); } void lcd_cmd(unsigned char item) // Function to send command to LCD { dataport = item; rs= 0; rw=0; e=1; delay(1); e=0; return; } void lcd_data(unsigned char item) // Function to send data to LCD { dataport ...
    hai to all We are trying to interface micro sd card with 16f877A, using compiler version of 3.098 ccs c. We tried a simple code by sending command 0 and command 1 through spi of the sd card and display its response in the lcd. We use two transistor as a level shifter from SDO of the pic to MOSI and other for MISO of the sd card to the SDI, then we use potential divider across the SCK of the pic. My problem is I am always receiving a garbage character and 00 in the display as the response ...
    hai to all we are trying to interface micro sd card with 16f877A, using compiler version of 3.098 ccs c. we tried a simpel code by sending command 0 and command 1 through spi of the sd card and display its response in the lcd. we use two transistor as a level shifter from SDO of the pic toMOSI and other for MISo of the sd card to the SDI,. then we use potential divider across the SCK of the pic. my problem is i am always receiving a carbage character and 00 in the display as the respose code. second thing is how ...
    hi, I am practicing sending the data to LCD using four pins.I am not able to get the output.Please help me. This is my code #includelt18f452.hgt #fuses HS,NOWDT,NOLVP,NOPROTECT #use delay(clock=4000000) #define rs PIN_C0 #define rw PIN_C1 #define en PIN_C2 //data pins D0,D1,D2,D3 void lcd_command(int8 command) { int8 temp; temp=(commandgtgt4) amp 0x0f; //mask lower nibble output_d(temp); //send higher nibble delay_ms(5); output_low(rs); output_high(en); delay_cycles(2); output_low(en); output_d(0x00); temp=command amp 0x0f; //mask higher nibble output_d(temp); //send lower nibble delay_ms(5); output_low(rs); output_high(en); delay_cycles(2); output_low(en); output_d(0x00); delay_ms(10); delay_ms(250); } void lcd_data(int8 data) { int8 temp; temp=(datagtgt4) amp 0x0f; //mask lower nibble output_d(temp); //send higher nibble delay_ms(5); output_high(rs); output_high(en); delay_cycles(1); output_low(en); output_d(0x00); temp=data amp 0x0f; //mask higher nibble output_d(temp); //send lower nibble delay_ms(5); output_high(rs); output_high(en); delay_cycles(1); output_low(en); output_d(0x00); delay_ms(10); delay_ms(250); } void main() { set_tris_d(0xf0); set_tris_c(0); while(1) { lcd_command(0x28); lcd_command(0x0e); lcd_command(0x06); lcd_command(0x80); lcd_data('a'); lcd_data('b'); lcd_data('c'); lcd_data('d'); } } Thank you.
    i programming pic 16f877a interfacing with lcd 20X2 this my program: // LCD module connections sbit LCD_RS at RB0_bit; sbit LCD_EN at RB1_bit; sbit LCD_D4 at RB2_bit; sbit LCD_D5 at RB3_bit; sbit LCD_D6 at RB4_bit; sbit LCD_D7 at RB5_bit; sbit LCD_RS_Direction at TRISB0_bit; sbit LCD_EN_Direction at TRISB1_bit; sbit LCD_D4_Direction at TRISB2_bit; sbit LCD_D5_Direction at TRISB3_bit; sbit LCD_D6_Direction at TRISB4_bit; sbit LCD_D7_Direction at TRISB5_bit; // End LCD module connections int a,roaa,H,E,k; int t; void main() { ADCON1=0X07; TRISD=0XFF; TRISA=0x07; t=0; LCD_Init( ); LCD_Cmd(_LCD_CLEAR); LCD_Cmd(_LCD_CURSOR_OFF); delay_ms(1000); LCD_Out(1,3,"Nova Engineering"); delay_ms(3000); LCD_Cmd(_LCD_CLEAR); LCD_Out(1,3,"Welcome To Laser"); LCD_Out(2,7,"Therapy"); delay_ms(3000); LCD_Cmd(_LCD_CLEAR); roaa: LCD_Out(1,5,"PRESS MENU"); if(RD4_bit==1) { delay_ms(2000); LCD_Cmd(_LCD_CLEAR); } else goto roaa; LCD_Out(1,1,"Select Time"); LCD_Out(2,2,"ltlt"); LCD_Out(2,8,"gtgt"); H: if(RD5_bit==1) { t=t+1; } if(t==1) { LCD_Out(2,5,"01"); Delay_ms(200); } if(t==2) { LCD_Out(2,5,"02"); Delay_ms(200); } if(t==3) { LCD_Out(2,5,"03"); Delay_ms(200); } if(t==4) { LCD_Out(2,5,"04"); Delay_ms(200); } if(t==5) { LCD_Out(2,5,"05"); Delay_ms(200); } if(t==6) { LCD_Out(2,5,"06"); Delay_ms(200); } if(t==7) { LCD_Out(2,5,"07"); Delay_ms(200); } if(t==8) { LCD_Out(2,5,"08"); Delay_ms(200); } if(t==9) { LCD_Out(2,5,"09"); Delay_ms(200); } if(t==10) { LCD_Out(2,5,"10"); Delay_ms(200); } if(t==11) { LCD_Out(2,5,"11"); Delay_ms(200); } if(t==12) { LCD_Out(2,5,"12"); Delay_ms(200); } if(t==13) { LCD_Out(2,5,"13"); Delay_ms(200); } if(t==14) { LCD_Out(2,5,"14"); Delay_ms(200); } if(t==15) { LCD_Out(2,5,"15"); Delay_ms(200); } if(RD2_bit==1) { t=t-1; } if(RD1_bit==1) { delay_ms(3000); LCD_Cmd(_LCD_CLEAR); delay_ms(1000); } else { delay_ms(200); goto H; } LCD_Out(1,1,"Time="); LCD_Out(2,9,"min."); LCD_chr(2,6,t); delay_ms(3000); LCD_Cmd(_LCD_CLEAR); delay_ms(1000); LCD_Out(1,1,"Select Power"); LCD_Out(2,2,"ltlt"); LCD_Out(2,7,"mw"); LCD_Out(2,10,"gtgt"); delay_ms(3000); E: if (RD6_bit==1) { LCD_Out(2,5,"25"); } if(RD3_bit==1) { LCD_Out(2,5,"50"); } if(RD1_bit==1) { delay_ms(2000); LCD_Cmd(_LCD_CLEAR); delay_ms(1000); } else {delay_ms(200); goto E; } LCD_Out(1,1,"Power="); LCD_Out(1,10,"mw"); if (RD6_bit==1) { LCD_Out(1,7,"25"); } if(RD3_bit==1) { LCD_Out(1,7,"50"); } delay_ms(3000); LCD_Cmd(_LCD_CLEAR); delay_ms(1000); LCD_Out(1,1,"PRESS POWER TO START"); p: if(RD0_bit==1) { delay_ms(3000); LCD_Cmd(_LCD_CLEAR); delay_ms(1000); } else {delay_ms(200); goto p ; } LCD_Out(1,5,"LASER ON"); while(1); } the compiler warning IRP bit ...
    #includeltsoftuart.hgt #includeltstdio.hgt #includeltreg51.hgt void uart_init(); sbit sw=P1^7; unsigned char rx(); code unsigned char rd[] = "AT+CMGR=1"; code unsigned char ne[] = "AT+CNMI=2,2,0,0,0"; unsigned int r=0,m=0,s1=0,n1=0,f1=0,m2=0; unsigned char gs,mes_dat[]=0,mess[]=0; extern void lcd_init(); void lcd_cmd(unsigned char); void lcd_data(unsigned char); //void wait(); void gsm_delay(unsigned int); unsigned char txt[]="AT+CMGF=1"; unsigned char no[] ="AT+CMGS=\"9940151239\""; unsigned char del[]="AT+CMGDA=\"DEL ALL\""; unsigned char sen[]="SENSOR"; void send_no(); void new_mess(); void gsm_read(); void delete(); void gsm_read(); void mode(); unsigned char rx(); unsigned char w, re,rx_data; void tx(unsigned char); void serial(void) interrupt 4 { if(TI==1) { TI=0; SBUF = '\0'; //ES=0; } else if(RI==1) { rx_data = SBUF; if(rx_data=='+') { do { mess[m2] = rx_data; m2++; RI=0; }while(rx_data=='T'); } RI = 0; } } void main() { uart_init(); lcd_init(); mode(); new_mess(); // delete(); while(1) { ...
    Below is the program for moving message on lcd.....ws not working on chip....if u can help me any modifications..it is for philips P89v51rd2fn lcd is jhd162a #includeltreg51.hgt sfr lcd_data_pin=0x90; // port 1 sbit rs=P3^0; // Register select pin sbit rw=P3^1; // Read write pin sbit en=P3^2; // Enable pin void delay(unsigned int msec) //delay function { int i,j; for(i=0;iltmsec;i++) for(j=0;jlt1275;j++); } void lcd_cmd(unsigned char comm) // function to send command to LCD { lcd_data_pin=comm; en=1; rs=0; rw=0; delay(25); en=0; } void lcd_data(unsigned char disp) // function to send data on LCD { lcd_data_pin=disp; en=1; rs=1; rw=0; delay(25); en=0; } void lcd_puts(unsigned char *s) // function to send string to LCD { while(*s!='\0') { lcd_data(*s); s++; } } void lcd_ini() //Function to initialize the LCD { lcd_cmd(0x38); lcd_cmd(0x06); lcd_cmd(0x80); lcd_cmd(0x01); lcd_cmd(0x0C); } void main() { ...
    hi to everyone i am making a panel meter for my power supply unit that measure voltage, current ,resistance and power when i simply calculate resistance using V=I/R if ans is let say 0.8 ohm then it display it well but when res is 0.08 ohm then it display 0.8 ohm it should show 0.08 ohm i am using PIC16F690 i use modf function in math.h it seperate the decimal portion and fractional portion then i seperately convert it to string and display on lcd CODE: void load (void) { double a,fra,res; unsigned char *add; unsigned char buf[5]; lcd_cmd(0xc0); if(cur==0) lcd_str(" OC "); else { a=(float)(volt())/(cur); fra=modf(a,ampres); ...
    I have done a program with keil,getting error while linking. but the same program is running in single file, i think problem with linking only...up to me,i linked the program..i dont know why is not linking...can any body suggest me. MAIN FILE:- #include ltREGX51.Hgt #include "lcd.c" unsigned int i=0,l=0; sbit alsen=P2^0; sbit eyesen=P2^2; sbit Buz=P0^2; sbit motor=P0^4; void timer_init() { IE=0x82; TMOD=0x01; TH0=0x4B; TL0=0xFD; TR0=1; } void main() { unsigned int j; lcd_init(); timer_init(); Buz=1; motor=1; delay(65000); delay(65000); while(1) { if(alsen==1) { lcd_cmd(0x80); lcd_str("Alcohol Detected"); lcd_cmd(0xc0); Buz = 0; motor=0; while(1); } else if(alsen==0) { lcd_cmd(0x80); for(j=0;jlt1000;j++); lcd_str("Alcohol Normal "); lcd_cmd(0xc0); } if(l==100) { if(igt20) { lcd_cmd(0xc0); ...