rememberramu
Newbie level 3
Hello,
I am doing a project, I have to send and receive sms using microcontroller.
I am using AT89s52 microcontroller and nokia 6610i mobile phone. I have successfully sent and red sms from hyper terminal of PC. So nokia 6610i supports required at commands.
Then I cut the serial data cable (DUK 50) of nokia 6610i, and made serial interface in microrontroller using max232 IC. I have connected Tx Rx and ground pin of mobile i.e. ( pin no. 6 for Rx , pin no. 7 for Tx and pin no. 8 for GND) to the max 232 . The microcontroller circuit perfectly communicates with hyperterminal.
I have wrote code to send sms from mobile in c. Because I have keil compiler which convert .C code to .hex . Here is my actual code in C.
I am getting required command in hyper terminal but mobile is not sending sms. I don't know where to start debugging.
Can you please help me.
Please provide me circuit diagram for microcontroller and 6610i interfacing, and also code for sending SMS.
Regards, Ram
I am doing a project, I have to send and receive sms using microcontroller.
I am using AT89s52 microcontroller and nokia 6610i mobile phone. I have successfully sent and red sms from hyper terminal of PC. So nokia 6610i supports required at commands.
Then I cut the serial data cable (DUK 50) of nokia 6610i, and made serial interface in microrontroller using max232 IC. I have connected Tx Rx and ground pin of mobile i.e. ( pin no. 6 for Rx , pin no. 7 for Tx and pin no. 8 for GND) to the max 232 . The microcontroller circuit perfectly communicates with hyperterminal.
I have wrote code to send sms from mobile in c. Because I have keil compiler which convert .C code to .hex . Here is my actual code in C.
Code:
#include<reg51.h>
void sertx(unsigned char x);
void main(void)
{
unsigned char i, j, k, l;
unsigned char txstr[]="at+cmgf=1";
unsigned char txstr1[]="at+cmgs=\"9841871924\"";
unsigned char txstr2[]="abc";
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
P2=0x00;
sertx(0x0D);
sertx(0x0A);
for(i=0; i<9; i++)
{
sertx(txstr[i]);
}
for(j=0; j<10; j++)
for(k=0; k<250; k++)
for(l=0; l<250; l++);
sertx(0x0D);
sertx(0x0A);
for(i=0; i<20; i++)
{
sertx(txstr1[i]);
}
for(j=0; j<5; j++)
for(k=0; k<250; k++)
for(l=0; l<250; l++);
sertx(0x0D);
sertx(0x0A);
for(i=0; i<3; i++)
{
sertx(txstr2[i]);
}
sertx(0x1A);
while(1);
}
void sertx(unsigned char x)
{
SBUF=x;
while(TI==0);
TI=0;
}
I am getting required command in hyper terminal but mobile is not sending sms. I don't know where to start debugging.
Can you please help me.
Please provide me circuit diagram for microcontroller and 6610i interfacing, and also code for sending SMS.
Regards, Ram