//checking for AT commands
gsmcmdsend(gsm_cmd1);
while(Rx_data()!='O');
while(Rx_data()!='K');//Waiting for modem response
//removing echo char
gsmcmdsend(gsm_cmd2);
while(Rx_data()!='O');
while(Rx_data()!='K');//Waiting for modem response
//setting the text command
gsmcmdsend(gsm_cmd3);
while(Rx_data()!='O');
while(Rx_data()!='K'); //Waiting for modem response
//setting the Baudrate command
gsmcmdsend(gsm_cmd4);
while(Rx_data()!='O');
while(Rx_data()!='K');//Waiting for modem response
//setting the save to modem EEPROM command
gsmcmdsend(gsm_cmd5);
while(Rx_data()!='O');
while(Rx_data()!='K');//Waiting for modem response
//to enable the sms strchr (buf, 't')
gsmcmdsend(gsm_cmd6);
while(Rx_data()!='O');
while(Rx_data()!='K');//Waiting for modem response
}
void Recv_frm_mob()
{
unsigned char count;
while((Rx_data())!=':');
while((Rx_data())!='+'); //wait till " receive
for(count=0;count<12;count++) // then store 12 digit phone number including
{
phone[count]=Rx_data();
}
phone[count]='\0';
while(Rx_data()!='\n'); //wait till next line
for(count=0;count<2;count++) // store message
{
pass[count]=Rx_data(); //
}
pass[count]='\0'; //Add null char to string to indicate end of string
}
void snd2mob()
{
unsigned char code message[]=" Hello;
Tx_Str("AT+CMGS="); // send cmd to modem
Tx_data('"');
Tx_Str(phone); //send phone no to modem
Tx_data('"');
enter();
while(Rx_data()!='>'); //till waiting for '>' symbol
Tx_Str(message);
i am in office and cant spend time with you....download AVR tutorials and do some example programs given in it or see the example in the avr installed directory for serial communication.... i cant be online for more time.....