Microcontroller › 8051 › 8051 keeps executing › Hi ajish thanks a lot for all
August 8, 2013 at 10:32 am
#10303
Sandeep
Participant
Hi 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 recieved
Now 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]=’