shri devi
Junior Member level 1
Here i have send a code, to send a message from gsm to mobile but it does not work can anybody help me please.
#include <16f877a.h>
#include <stdio.h>
#use delay (clock = 20000000)
#fuses hs, noprotect, nowdt, nolvp
#use rs232(baud=9600, bits=8, xmit=pin_c6,rcv=pin_c7, parity=n, stream=GSM)
void main ()
{
set_tris_b(0);
fprintf(GSM,"at\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM, "at+cmgf=1\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM,"at+csmp=17,168,0,0\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM, "at+cmgs=\"+*******\"\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM, "TEST1..");
delay_ms(100);
fputc(0x1A,GSM);
delay_ms(100);
}
#include <16f877a.h>
#include <stdio.h>
#use delay (clock = 20000000)
#fuses hs, noprotect, nowdt, nolvp
#use rs232(baud=9600, bits=8, xmit=pin_c6,rcv=pin_c7, parity=n, stream=GSM)
void main ()
{
set_tris_b(0);
fprintf(GSM,"at\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM, "at+cmgf=1\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM,"at+csmp=17,168,0,0\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM, "at+cmgs=\"+*******\"\r\n");
fputc(0x0D,GSM);
fputc(0x0A,GSM);
delay_ms(100);
fprintf(GSM, "TEST1..");
delay_ms(100);
fputc(0x1A,GSM);
delay_ms(100);
}
Last edited: