Forum Replies Created
-
AuthorPosts
-
SandeepParticipant
Hi ajish
I have tried a simple LCD program also , its working fine
my problem is
serial data i/p has to put on to string say str[20] a global array
den serially display it on the LCD
so now , displaying the string on the LCD is working fine ,but storing the serial input characters in an array is giving the problem i guess
and next,
in my main function think i am firsst displaying “hello world ” on my LCD and then my program enters a while(1); loop
now incase i get a recieve interrupt -> it jumps to ISR gets the character and stores in th array
and den i need to print the string but after the ISR but it goes into the while(1);
what to do ?
den i thought i will use polling method to get the data, but that seems to be a bad practice.
wat do i do now ?
Thank you
Sandeep
SandeepParticipantHi ajish thanks a lot for all ur replies
I found the bug
the Tx of 8051 was getting connected to Tx of SIM900 and same with Rx , it happened because i was using a male to male connector.
now that is resolved
data recieved was seen on LCD when i used
ch= SBUF;
str[count++]=ch; // used to store the data
lcd_data(str[count-1]); // directly showing wat ever i recievedNow wrote a code to display the stored data in str[] , which is not happening
code is:
char str[20];
void lcd_data(char data1){P0=data1;RS=1;RW=0;E=1;delay(10);E=0;}void serial_rx() interrupt 4{char ch;if(RI==1){ch= SBUF;if(ch==0X0D){carr=1;}if(ch==0X0A){linefd=1;}if(ch!=0x0D && ch!= 0x0A){str[count++]=ch;lcd_data(str[count-1]);}if(ch==0X0D && carr==1 ){str[count]=’