Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

hi!Does anyone know how to write code sending sms after reply OK on at89c51????

Status
Not open for further replies.

Ni yanfang

Member level 3
Member level 3
Joined
Jul 30, 2013
Messages
59
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
432
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??
 

Hi, MAX232 is already connected to the controllers serial port know?? If so u just need need to write a code for sending SMS. Use the command AT+CMGS.
 

can you post me code here please?

- - - Updated - - -

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.
 

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
 
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
OK Thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top