Hi. I am using gprs/gsm modem (Q2403). max232 and at89c51. all connect already, I have no ideas how to write code for sending sms, then microcontroller will receive OK . all my port o of AT89c51 connect with DB0 to DB7 of LCD1. And my port 2.0 of AT89c51 connect with RS of LCD1. port 2.1 of AT89c51 connect with R/W and port 2.2 connect with E of LCD1.
Please anyone help??? any sample code??
Yes all setting is OK. But I need to write c language on sending sms after reply OK on at89c51 using AT command.
If you do not knoe about AT command. can you just post the code.
void sendSms(char *msg) {
UART_Send("AT+CMGS=\"0300xxxxxx\""); //0300xxxxxx is supposed to be the destination number
delay_us(2); // wait for '>' to appear
UART_Send(msg); // send the msg string
UART_Sendchar(0x1A); /send ctrl+z to signal end of msg and wait for OK from gsm module
}
i assumed that you can write UART based functions yourself
void sendSms(char *msg) {
UART_Send("AT+CMGS=\"0300xxxxxx\""); //0300xxxxxx is supposed to be the destination number
delay_us(2); // wait for '>' to appear
UART_Send(msg); // send the msg string
UART_Sendchar(0x1A); /send ctrl+z to signal end of msg and wait for OK from gsm module
}
i assumed that you can write UART based functions yourself