Not able to receive message from PIC using GSM Module

Status
Not open for further replies.

santoshhiremani

Newbie level 4
Joined
Mar 21, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,351
Hi,
I'm working on an GSM module SIM300 which works fine when i test in windows terminal but when try to send message from PIC18F2550, not able get message from it it is my code

void main(void)
{

//Configuration of Modem
ADCON1 = 0x0F; // default all pins to digital
TRISC = 0b11000000; // RC7(RX) as input , RC6(TX) as output
TRISA = 0b00000000;
TRISB = 0b00000000;

OSCCON = 0b01110110; //select 8 MHz clock

OpenUSART (USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH, 51);

putrsUSART((const far rom char *)"AT\r\n");
Delay10KTCYx(500);
putcUSART(0x0D);
while(!BusyUSART());
//50x10k instruction cycle = 0.5s delay

putrsUSART((const far rom char *)"AT+CMGF=1\r\n"); //Operatng in SMS text mode
Delay10KTCYx(500);
putcUSART(0x0D);
while(!BusyUSART());
Delay10KTCYx(500); //50x10k instruction cycle = 0.5s delay

putrsUSART((const far rom char *)"AT+CMGS=\"+917411901273\"\r"); //Sending SMS to recipant
Delay10KTCYx(500);
putcUSART(0x0D);
putcUSART(0x0D);
putrsUSART((const far rom char *)"\n\r");
Delay1KTCYx(500);
putcUSART(0x3E);
while(!BusyUSART());
Delay10KTCYx(500); //50x10k instruction cycle = 0.5s delay

putrsUSART((const far rom char *)"Hello"); //message to be sent
while(!BusyUSART());
Delay10KTCYx(500); //50x10k instruction cycle = 0.5s delay
putcUSART(0x1A);// send ctrl + Z
Delay10KTCYx(1000);
CloseUSART();
//}
}


when i see out put of microcntroller in terminal i got following response

AT+CMGS="+917411901273"
>HelloAT
AT+CMGF=1
AT+CMGS="+917411901273"
>HelloAT
AT+CMGF=1
AT+CMGS="+917411901273"
>HelloAT
AT+CMGF=1
AT+CMGS="+917411901273"
>HelloAT
AT+CMGF=1
AT+CMGS="+917411901273"
>HelloAT
AT+CMGF=1
AT+CMGS="+917411901273"
>HelloAT
AT+CMGF=1
AT+CMGS="+917411901273"
>HelloAT
AT+CMGF=1
AT+CMGS="+917411901273"
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…