madtoilet
Joined: 02 Apr 2008 Posts: 36
|
interfacing GSM to PIC |
Posted: Thu Apr 10, 2008 5:42 pm |
|
|
Hey, i know alot of people have been asking about this and i have read through most of the topics on the forum (using search).
Though alot of the topics were helpful, i'm still unclear on certain aspects. here is my code for it
Code: |
#include "D:\Program Files\PICC\Devices\LCD.h"
#include "string.h"
#fuses HS,NOWDT,NOPROTECT, NOLVP
#use delay(clock=4mhz)
#use rs232(baud=4800, bits=8, parity=N, stop=1, xmit=PIN_C6, rcv=PIN_C7, stream=GSM, ERRORS)
#define CZ 0x1A
void gsm_call(void)
{
char c;
output_low(PIN_C4); //selecting multiplexer
output_high(PIN_C5);
delay_ms(500);
/*
putc('A');
putc('T');
*/
fprintf(GSM, "AT+CMGF=1\r\n");
delay_ms(2050);
fprintf(GSM, "AT+CMGS=4153851526\r\n");
delay_ms(2000);
fprintf(GSM, "check%c\r\n", CZ);
}
|
this is the function that i call. It isn't quite working. I'm to send a message out from the GSM module.
i'm confused as to how i'm to send carriage returns and whether my CZ definition is right for replacing ctrl-z |
|