Hafeez Anwar
Newbie level 5
Hi.
I am interfacing Mobile(C100) with 8051 via serial port using AT commands. I have written the code for it and I am just sending a simple command AT to the 8051. But the mobile doesn't give me any response. or it is giving me response but I am not able to see it. Plz help me if you have got any idea about it or at least give me some reference regarding this topic. here is the code.
#include<reg51.h>
void send(unsigned char);
void main(void)
{
unsigned char m;
TMOD = 0X20;
TH1=0xFD;
SCON = 0x50;
TR1 = 1;
send('A');
send('T');
send('\r'); // for "enter" button
while(RI==0);
m = SBUF;
P1 = m;
RI = 0;
}
void send(unsigned char a)
{
SBUF = a;
while(TI==0);
TI=0;
}
I am interfacing Mobile(C100) with 8051 via serial port using AT commands. I have written the code for it and I am just sending a simple command AT to the 8051. But the mobile doesn't give me any response. or it is giving me response but I am not able to see it. Plz help me if you have got any idea about it or at least give me some reference regarding this topic. here is the code.
#include<reg51.h>
void send(unsigned char);
void main(void)
{
unsigned char m;
TMOD = 0X20;
TH1=0xFD;
SCON = 0x50;
TR1 = 1;
send('A');
send('T');
send('\r'); // for "enter" button
while(RI==0);
m = SBUF;
P1 = m;
RI = 0;
}
void send(unsigned char a)
{
SBUF = a;
while(TI==0);
TI=0;
}