Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

interfacing pic18f452 with sim900d

Status
Not open for further replies.

bilal09

Newbie level 3
Joined
Mar 2, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,314
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);}
}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top