#include <16f876a.h>
#fuse hs, nowdt, noput, noprotect, nodebug, brownout, nowrt
#use delay(clock=20000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8, stream=GSM)
#int_rda
void serial_isr()
{
char c;
c=fgetc(GSM);
}
void main()
{
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
fprintf(GSM, "AT\n\r");
delay_ms(7000);
fprintf(GSM, "AT+CMGF=1\n\r");
delay_ms(3000);
fprintf(GSM, "AT+CMGS=\"+6**********\"\n\r");
delay_ms(3000);
fprintf(GSM, "hello FROM mcu");
putc(26);
while(true)
{
delay_ms(1000);
}
}
#fuse hs, nowdt, noput, noprotect, nodebug, brownout, nowrt
#use delay(clock=20000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8, stream=GSM)
#int_rda
void serial_isr()
{
char c;
c=fgetc(GSM);
}
void main()
{
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
fprintf(GSM, "AT\n\r");
delay_ms(7000);
fprintf(GSM, "AT+CMGF=1\n\r");
delay_ms(3000);
fprintf(GSM, "AT+CMGS=\"+6**********\"\n\r");
delay_ms(3000);
fprintf(GSM, "hello FROM mcu");
putc(26);
while(true)
{
delay_ms(1000);
}
}