bilal09
Newbie level 3
hi,
i am doing a project on a gps controlled vehicle. rite now i am stuck with receiving msg from sim900d module. if i connect sim900d with a pc using hyperterminal all of my AT commands work also when i send a msg a msg echo is produced. but when i send a msg to my sim900d module and try to read it via a microcontroller nothing is displayed. i built a test program in which my microcontroller sent AT to sim900d, sim900d rplied with AT OK which i displayed using 8leds. and now when i send a msg to sim900d it doesnot recognise the echo. plz help
i am using a ccs compiler and attachec is a part of my code
#include <18F452.h>
#use delay(clock=10000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=COM_B, ERRORS)
msgEcho[0] = 'C';
msgEcho[1] = 'M';
msgEcho[2] = 'T';
msgEcho[3] = 'I';
msgEcho[4] = ':';
msgEcho[5] = ' ';
msgEcho[6] = '"';
msgEcho[7] = 'S';
msgEcho[8] = 'M';
msgEcho[9] = '"';
msgEcho[10] = ',';
while (True){
recieved = 1;
delay_ms(4000);
if (kbhit(COM_B))
{
fputs("\nStarting...",COM_B);
delay_ms(2000);
a = fgetc(COM_B);
if (a == '+')
{
delay_ms(2000);
fputs("\nMessage Incoming...", COM_B);
for (i=0;i<11;i++)
{
fputs("\nType in:", COM_B);
delay_ms(3000);
a = fgetc(COM_B);
if(a != msgEcho)
{
recieved = 0;
break;
}
}
}
if (recieved == 1){
fputs("\nMessage recieved.", COM_B);
}
}
else{fputs("\nMessage NOT recieved.", COM_B);}
}
}
i am doing a project on a gps controlled vehicle. rite now i am stuck with receiving msg from sim900d module. if i connect sim900d with a pc using hyperterminal all of my AT commands work also when i send a msg a msg echo is produced. but when i send a msg to my sim900d module and try to read it via a microcontroller nothing is displayed. i built a test program in which my microcontroller sent AT to sim900d, sim900d rplied with AT OK which i displayed using 8leds. and now when i send a msg to sim900d it doesnot recognise the echo. plz help
i am using a ccs compiler and attachec is a part of my code
#include <18F452.h>
#use delay(clock=10000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=COM_B, ERRORS)
msgEcho[0] = 'C';
msgEcho[1] = 'M';
msgEcho[2] = 'T';
msgEcho[3] = 'I';
msgEcho[4] = ':';
msgEcho[5] = ' ';
msgEcho[6] = '"';
msgEcho[7] = 'S';
msgEcho[8] = 'M';
msgEcho[9] = '"';
msgEcho[10] = ',';
while (True){
recieved = 1;
delay_ms(4000);
if (kbhit(COM_B))
{
fputs("\nStarting...",COM_B);
delay_ms(2000);
a = fgetc(COM_B);
if (a == '+')
{
delay_ms(2000);
fputs("\nMessage Incoming...", COM_B);
for (i=0;i<11;i++)
{
fputs("\nType in:", COM_B);
delay_ms(3000);
a = fgetc(COM_B);
if(a != msgEcho)
{
recieved = 0;
break;
}
}
}
if (recieved == 1){
fputs("\nMessage recieved.", COM_B);
}
}
else{fputs("\nMessage NOT recieved.", COM_B);}
}
}