- This topic has 1 reply, 2 voices, and was last updated 11 years, 1 month ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › GSM WITH PIC
hai,
i am new to pic. i want to interface a gsm modem with pic16f877 for sms sending application for that i write the code.but the serial terminal working properly [through proteus] but i didnt get the message pls help me to solve the problem. the code is
#include<16f877A.h>
#use delay(clock=20000000)
#fuses HS,NOWDT,NOPROTECT,NOLVP,PUT,NOBROWNOUT
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_c7)
int i,j;
void at_cmds();
void main()
{
for(j=0;j<=5;j++)
{
delay_ms(500);
}
for(i=0;i<=5;i++)
{
delay_ms(2000);
at_cmds();
printf(“this is the %x th message”,i);
putchar(0X1A);
printf(“nr”);
delay_ms(1500);
printf(“n”);
}
while(1);
}
void at_cmds()
{
printf(“nATnr”);
delay_ms(1000);
printf(“AT+CMGF=1”);
delay_ms(1000);
printf(“rAT+CMGS=”9842584477″n”);
delay_ms(1000);
}
If I were you I will use Hyperterminal to check all.
First connecting Hyperterminal to the GSM and making it works by hand.
Second connecting Hyperterminal to the PIC and seeing if I receive the correct commands.
If all it´s OK then connect PIC to the GSM