I am using 89s52 microcontroller to interfacing with GSM module 'SIMCOM300'. The logic which i develope is as bellow:
1) 1st i execute all commands i.e AT, AT+CMGF=1, AT+CSMS=0, AT+CPMS="SM", AT+CNMI 2) AFTER this controller will do its other operation 3) when new msg received sci receive interrupt will store '+CMTI: "SM", <index> response from gsm in buffer. 4] after this i take the index from buffer & read the corresponding msg content. 5) again the receive interrupt will occure & the whole data rcv from gsm is store in another buffer. 6) so with this i am getting the senders mobile n0.,time of sending, & actual data. 7) Depending on the actual data microcontroller will perform the action.
actual problem: 1) i am use '+' sign to check new msg indication, if '+' sign occur then next data will automatically save in buffer. but while doing this if another sms received then gsm module gives response of that message. i want this new response to store in buffer but the previous message response already fulfil the condition
so give me the solution to handle two sms received at a time by gsm module.....
Note that +CMTI is an unsolicied message - a message the modem can send to you without you first having polled the modem by sending a command to the modem.
But the modem will only send unsolicited messages when the serial interface is idle. If you already have an ongoing transfer of SMS data, then the modem will have to wait with next unsolicited message since no two text lines can intermix.
Next thing - if you are slow to retrieve one SMS, then the modem gets a chance to receive more SMS messages. But how much memory do you think <index> consumes? You don't need to store the full string. You can keep a small ring-buffer of indices until you get time to retrieve the actual SMS data.
Next thing is taht even if you fail to process the +CMTI string, you can still query the module for available SMS messages.
Discussion for some strange reason split into new thread. http://www.keil.com/forum/19462/
Stay in this thread! "Reply" really do means something very different from "Start a Thread".
Okay sir,
I understand what to do.
i will try & see what is the result...
thank you for giving your valuable time & guidence
Hello sir,
Thanks for your previous guidence.
I have one more problem regarding SIM.
SIM controller gives error as '+CMS ERROR: 517' regarding the message commands like: AT+CMGL, AT+CPMS, AT+CMGD, AT+CMGR ETC
I search about this error then i got 2 information regarding this 1) Invalid character in PDU 2) "+CMS ERROR: 517". This means, that the SIM card is not ready
BUT i am using TEXT mode for doing sim operations.
and i got the solution for 2nd information is
To wait for SIM to get ready and then proceed.
I used command AT+CMGL="ALL" for this but for this command it also gives same error.
when I insert same SIM in different mobile and after switch on the mobile it gives error as INSERT SIM.
Please help me to resolve this problem. i have tried my best but its not responding....
THANKS
Note that none of this has anything to do with Keil - nor even the 8051.
You should be speaking to your SIMCOM representative for support.
"I search about this error then i got 2 information"
I think this is a proprietary code - so you must refer to the specific SIMCOM documentation.
"BUT i am using TEXT mode for doing sim operations"
See above. But, even so, remember that GSM itself always uses PDU - text mode is simply an alternative interface between the module and the external application.
"I used command AT+CMGL="ALL" for this but for this command it also gives same error"
Of course it will! If the SIM is not ready, then it's not ready for any commands!
Check your SIMCOM documentaion to see if the module can give you any notification of when the SIM is ready...
"I insert same SIM in different mobile and after switch on the mobile it gives error as INSERT SIM"
Sounds like you have a faulty/damaged SIM, then?