Hi guys please let me know if I can post a question regarding GSM modem over here My modem is working fine just when I try to receive msg through at+cmgr=1 1st character I get is not '+' Its not related to h/w but programming and response of GSM modem for at commands so is it ok if I post my query over here?
Thanks Andy, you can see in one of the above post I've written my initialization code
at<CR> ate0<CR> atv0<CR> at+cmgf=1<CR> at+cpms="SM"<CR>
so I hope for
at+cmgr=1<CR>
I should get '+' as my first character Am I correct? One more thing after reading/manipulating that msg I'm deleting it
at+cmgd=1<CR>
so next msg should be at index 1, right?
One more thing micro controller is sending proper commands to modem as i said in one of the post above as I program modem for something else and then run initialization code it works fine(configured according to initialization code) and even msg used to be deleted after execution of code
"Am I correct?"
No.
Re-read what I said earlier about response formatting...
Ya Andy even I thought I should get LF as my 1st response character however when I tried to do at+cmgr=1<CR> on hyperterminal (with given initialization), I got response on same line thats why I done programming that way anyway I'll be on vacation for few days so will try it with LF after few days. Anyway till then if required I'll post any other problems. Thanks a lot
Rather than relying specifically on receiving a '+', how about allowing your receiver to "skip" all whitespace until a '+' is received - then capture the next 4 characters, and check...
hmmm, Thats nice idea Andy Thanks I'll try that one when i get back
Hi guys, I'm back - that was long holiday, apart from that I solved the problem with msg handling - we can use at+cnmi=2,1 Now when gsm modem/module is initialized with this command will give +CMTI: <msg memory>,<msg index> when msg is received so now we can initialize with at+cnmi and then just wait for '+'
OK now thats done my program is working correctly but only for 1st time coz after that NVRAM contents used to be erased does reading NVRAM deletes the byte?(surely not in lifetime but just asking to be sure) - like if(XBYTE[PhNumber + i] == RecPhNumber[i])
where PhNumber is define - #define PhNumber 0x21 (RAM location)
That would seem an extremely odd behaviour if it were true!
But, since you haven't said what NVRAM you're using, it is impossible to say whether or not it would be true in your particular case.
You can find out for yourself by reading the datasheet(s) for the specific part(s) that you are actually using...
Ohh sorry its DS12887 (RTC with 114 bytes of general NVRAM) I need an RTC as well as NVRAM thats why I chose this IC. I read the datasheet but only for programming I guess I'll have to read it thoroughly.
Of course you will!
Any other approach will always end in tears!