bpramod
Member level 1
Hi friends
i programmed 8051 using keil to send message by SIM300,,the connection between the sim300 and 8051 is correct..also the microcontroller and sim300 are working correctly individually but when i connect both and Reset but message is not sending...so what is the problem?,,,& my c code is as follow...plz help me
plz help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!:sad::-(
i programmed 8051 using keil to send message by SIM300,,the connection between the sim300 and 8051 is correct..also the microcontroller and sim300 are working correctly individually but when i connect both and Reset but message is not sending...so what is the problem?,,,& my c code is as follow...plz help me
Code:
#include<reg51.h> // include at89x51 . h
#include<stdio.h>// include stdio . h
#include<stdlib.h>// include stdlib . h
unsigned char Command_AT[]=" AT\r";
unsigned char Command_echo[]="ATe0\r"; //echo off//
unsigned char Command_save[]="AT&W\r"; //save settings//
unsigned char Command_CMGF[]="AT+CMGF=1\r";
// AT+CMGF for selecting Text Mode
unsigned char Command_CMGS[]="AT+CMGS =\"+919538847904\"\r";
// recepient mobile number
unsigned char msg02[]="Hello!";
void initialize_serialcommunication(void)
{
SCON = 0x50;
TMOD = 0x20;
TH1 = 0xFD;
TL1 = 0xFD;
TR1 = 1;
TI = 1;
}
void delay2(void)
{
unsigned int i;
for(i=0;i<65000;i++);
}
void gsmcmdsend(unsigned char *cmd)
{
while(*cmd!='\0')
{
SBUF=*cmd;
while(TI==0);
TI=0;
cmd++;
}
}
void gsminit(void)
{ // AT COMMANDS
delay2();
delay2();
delay2();
delay2();
delay2();
delay2();
delay2();
gsmcmdsend(Command_AT);
delay2();
gsmcmdsend(Command_echo);
delay2();
gsmcmdsend(Command_save);
delay2();
gsmcmdsend(Command_CMGF);
delay2();
gsmcmdsend(Command_CMGS);
delay2();
gsmcmdsend(msg02);
delay2();
SBUF = 0x1A;
while(TI==0); TI = 0;
}
void main (void)
{
initialize_serialcommunication();
gsminit();
while (1);
}
plz help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!:sad::-(
Last edited by a moderator: