Forum Replies Created
-
AuthorPosts
-
Shailesh TambeParticipant
If you think the code is proper. Kindly check the Brightness of LCD & adjust it. If we haven’t adjusted the Brightness of LCD properly, it appears to be blank
Shailesh TambeParticipantThanks alot for the information Amrith …………… I didn’t knew this
Shailesh TambeParticipantCheck if Flash Magic Software has been properly installed and then open the Flash magic window.
Before loading the program “”Go to ISP” option and select “Read Device Signature” option and then try to load the program. Check if this thing works.
Shailesh TambeParticipantYou have to do some necessary changes in the program as per the microcontroller, the connections and the LCD that you might be using. This program is for 16×2 LCD using P89V51RD2 Microcontroller. ‘b’ in this program is defined as PB7 to check the LCD status.
Shailesh TambeParticipantTry out this code……………… it should work
#include<reg51.h>#include<string.h>sbit rs = P2^0;sbit rw = P2^1;sbit en = P2^2;sbit b = P1^7;void writecmd(unsigned char a);void writedat(unsigned char b);void busy();void writestr(unsigned char *s);void delay(unsigned int msec);void writecmd(unsigned char a){busy();rs=0;rw=0;P1=a;en=1;en=0;}void writedat(unsigned char b){busy();rs=1;rw=0;P1=b;en=1;en=0;}void busy(){en=0;P1=0xFF;rs=0;rw=1;while(b==1){en=0;en=1;}en=0;}void writestr(unsigned char *s){unsigned char i,len;len=strlen(s);for(i=0;i<len;i++){writedat(*s);s++;}}void delay(unsigned int msec){int count1,count2;for(count1=0;count1<msec;count1++)for(count2=0;count2<1275;count2++);}void main(){P1=0x00;P2=0x00;writecmd(0x3C); // Initialize the LCDdelay(50);writecmd(0x0E); // turn display ON for cursor blinkingdelay(50);writecmd(0x01); //Clear the LCD Screendelay(50);writecmd(0x06);delay(50);writestr(“HAPPY”);delay(50);writecmd(0xC0);delay(50);writestr(“BIRTHDAY”);delay(50);while(1);}Shailesh TambeParticipantMay I know, do you want to use both the lines of LCD ?
-
AuthorPosts