Hi to all,
can any one help me?
am doing project on GPS Location Alarm.
am using pic16f887 and gm862-gps
and i have to send sms as the alarm.now am working on the gsm to send d sms.
i am able to send the sms using hyperterminal ,both in pdu and text format.
i have done the program to send the releavent AT commands to the modem also.
i can see the result using hyperterminal.it sends the next statemnt only after pressing "ok".but when i send the program to modem its not responding.
am not able to see anything on the hyperterminal.
i am using rs232 interface als.whr TX(pic) to pin 11 and RX(pic) to pin 12.and pin 14(rs 232 ) to 2 of DB9 connector,pin 13 to 3 to DB9,and 15(rs232) and 5(DB9) grounded.now i have connected female DB9 and male DB9 from the same point one is to the modem other to pc.
can u help me why the gsm modem is not responding?
#include <stdio.h>
#include <htc.h>
#include "sci.h"
#include "usart.h"
#include <stdlib.h>
/* A simple demonstration of serial communications which
* incorporates the on-board hardware USART of the Microchip
* PIC16Fxxx series of devices. */
#include <string.h>
void main(void)
{
INTCON=0;
init_comms();
sci_CheckOERR();
printf("AT\r\n");
sci_CheckOERR();
while(1){
if(getch()=='O'){
if(getch()=='K'){
break;
}
}
}
sci_CheckOERR();
printf("AT+CMGF=0\r\n");
while(1)
;
}
void putch(unsigned char byte)
{
/* output one byte */
while(!TXIF) /* set when register is empty */
continue;
TXREG = byte;
}
unsigned char getch() {
/* retrieve one byte */
while(!RCIF) /* set when register is not empty */
continue;
return RCREG;
}
unsigned char
sci_CheckOERR(void)
{
if(OERR) /* re-enable after overrun error */
{
CREN = 0;
CREN = 1;
}
return ;
this is my code.
here i have omitted few lines after at+cmgf=0
now iam able to send dis to hyperterminal
bt problem is modem not responding
can u help me?
mail the reply to
anjujohn11@gmail.com