CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

AT Commands through a PIC18f2550

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Carlos Silva
Guest







AT Commands through a PIC18f2550
PostPosted: Sun Apr 06, 2008 11:42 am     Reply with quote

hya

can some1 help me in programing a PIC18f2550 to send AT commands in a GSM module so that i can SMS´s through it?

AT
AT+CMGF=1
AT+CMGW="telphone number"
<text>
AT+CMSS=index

This AT commands allow sending SMS´s through the GSM module linked to a PC using hyperterminal
Now i wanna use the PIC instead of the hyperterminal, can you guys help me?


Cheers from Portugal,
Carlos Silva
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

PostPosted: Sun Apr 06, 2008 12:54 pm     Reply with quote

hi, that is pretty straight-forward:
you configure the UART:
#use rs232(baud=9600,xmit=PIN_C6, rcv=PIN_C7, STREAM=GSM,ERRORS)
and then use printf or fprintf function to send characters out of the PIC.
printf("ATcommand\r");
fprintf(GSM,"ATcommand\r");
Samuel
Guest







PostPosted: Thu Apr 10, 2008 9:39 am     Reply with quote

we still cant send the at comands using that program that carlos put into the forum, we try to use somthing like this to send a sms in the index 3

void main(){


fprintf(GSM,"AT+CPIN=1983\r");
delay_ms(2000);
fprintf(GSM,"AT+REG ?\r");
delay_ms(2000);
fprintf(GSM,"AT\r");
delay_ms(2000);
fprintf(GSM,"AT+CMGF=1\r");
delay_ms(2000);
fprintf(GSM,"AT+CMSS=3\r");
delay_ms(2000);
}

and nothing lol can some1 help us please Smile
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Thu Apr 10, 2008 9:41 am     Reply with quote

Need more info:

What were the settings for the PC which worked ? Baud rate etc...
Where is the rest of your code, especially the fuses and #use rs232 settings ?

Does the PIC work when connected to the PC ?

You may need \r\n at the end of the line!
Samuel
Guest







PostPosted: Thu Apr 10, 2008 11:45 am     Reply with quote

ok this is the code that we are using can u help please? Smile

#include <18F2550.h> //ficheiro .h correspondente à PIC a utilizar
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN //fuses configurados para a PIC18F2550
#use delay(clock=48000000) //velocidade de funcionamento
#use rs232(baud=9600,xmit=PIN_C6, rcv=PIN_C7, STREAM=GSM,ERRORS)
#include <usb_cdc.h>


void main(){


fprintf(GSM,"AT+CPIN=1983\r");

delay_ms(10000);
fprintf(GSM,"AT+REG ?\r");
delay_ms(10000);
fprintf(GSM,"AT\r");
delay_ms(10000);
fprintf(GSM,"AT+CMGF=1\r");
delay_ms(10000);
fprintf(GSM,"AT+CMSS=3\r");
delay_ms(10000);


}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group