Currently I'm doing on a project interfacing PIC16F877 with GSM Modem (MOD9001).
However, I failed to send sms from the PIC through the GSM Modem.
Is there anyone can help me to check on my coding? Am I doing the wrong coding?
The following is my coding:
#include <16f877a.h>
#include <stdio.h>
#use delay (clock = 20000000)
#fuses hs, noprotect, nowdt, nolvp
#define use_portb_lcd true
#use rs232(baud=9600, bits=8, xmit=pin_c6,rcv=pin_c7, parity=n, stream=GSM)
#byte portb=6
#byte portc=7
#byte portd=8
void main ()
{
set_tris_b(0);
fprintf(GSM,"at\r\n");
delay_ms(1000);
fprintf(GSM, "at+cmgf=1\r\n");
delay_ms(2000);
fprintf(GSM,"at+csmp=17,168,0,0\r\n");
delay_ms(2000);
fprintf(GSM, "at+cmgs=\"+601xxxxxx\"\r\n"); //xxxxxx is my phone #
delay_ms(2000);
fprintf(GSM, "TEST1..");
delay_ms(5000);
putc(0x1A);
delay_ms(5000);
}