Microcontroller: PIC16F877A
software:MikroC
I am newbie in mikro C programming and AT command to send SMS in microcontroller.
I tried this Command code via hyperterminal it worked.
i have connect it with PIC16F877A via max232
My problem is:
when connect using microcontroller it won't send message to my phone and reply data from gsm modem.
Hypertiminal Command:
Code: Select all
AT+CMGF=1 [enter]
O.K [received]
AT+CMGS="xxxxxx" [enter]
> [received]
Testing123 ctr+Z [sent]
Code: Select all
[b]Programming:[/b]
void ADC_value_to_PC(){
uart1_write_text("at+cmgf=1");
UART1_Write(13);
UART1_Write(10);
delay_ms(5000);
UART1_Write_text("AT+CMGS=\"xxxxxxx\"");
UART1_Write(13);
UART1_Write(10);
delay_ms(5000);
UART1_Write_Text("Testing123");
UART1_Write(0x1A);
}
void main() {
TRISA=0x01; //I/O declarations
TRISB=0x00;
TRISC=0x00;
TRISD=0x00;
TRISE=0x00;
PORTA=0xFE; //Ports declarations
PORTB=0x00;
PORTC=0x00;
PORTD=0xff;
PORTE=0x07;
uart1_init(9600);
delay_ms(5000);
ADC_value_to_PC(); //Call function
}