I need some help in writing a code which will enable the 8051 to send a text sms using a GSM modem TR800 to any number. I have no clue as where to start. I have tried the following:
#include <reg51.h>
void SerTx(unsigned char);
void main(void){
int i =0;
TMOD=0x20; //use Timer 1, mode 2
TH1=0xFD; //9600 baud rate
SCON=0x50;
TR1=1; //start timer
while (i<2) {
SerTx('A');
SerTx('T');
SerTx('\\');
SerTx('r');
i+=1;
}
}
void SerTx(unsigned char x){
SBUF=x; //place value in buffer
while (TI==0); //wait until transmitted
TI=0;
}
Any help will be appreciated. Thanks!