Your PIC's input buffer may be overflowing, which may cause the pic to 'freeze'.
Add the following line if you don't already have one in your program:
HarrisonCode:DEFINE HSER_CLROERR 1
Your PIC's input buffer may be overflowing, which may cause the pic to 'freeze'.
Add the following line if you don't already have one in your program:
HarrisonCode:DEFINE HSER_CLROERR 1
Thanks for the replies.
Melanie:
Yes I tried to send the commands all together and it seems to work OK. But I do not know why, since there is no check from the program if the module has accepted the previous string...
I was thinking that the problem might be from the PIC itself side.
harrisonsp:
The command suggested is always included in my programs. Also the response from the module is set to be in numeric mode rather than in ASCII, so the flow is reduced to a zero for "OK".
Still mystery covers the case....
Ioannis
No, I don't think it's the PIC. I would place money on it being the modem.
With a lot of modems with 'Hayes Style' command set, when you issue a command, the modem will reply (even if it's OK or just a plain CRLF).
It is possible that during this reply the PIC has issued the next command (intercommand Pause too short)... and in so doing the modem has lost part of the next command string receiving a corrupted sequence which in turn has caused it to timeout.
You could verify this by increasing the Pauses to something really long (eg PAUSE 5000 rather than 500) and see if it still hangs. If it doesn't, then that's the reason... your modem probably has poor firmware that can't simultaneously cope with a new command string whilst the reply to the previous one is still being processed.
Don't quote me, but I think there's a command to suppress these responses from the modem... you could always issue that first. That might also stop the problem.
Hmm, how much would you bed on it?? **smiles**!
The problem is still there. I just moved the sub's from top of program to the bottom of it and this part works OK now! Any explains? I usually put all sub's on top.
It is weird...
Ioannis
P.S. Of course half of the sub's do not work!!!
Last edited by Ioannis; - 16th August 2005 at 13:52.
Is that an invitation?
Short of going through your program line by line I can't comment, but what version of PBP are you using? I do recall early versions of PBP did have some issues, and I do recall some strange things in 2.42... but ceratinly not now.
Just curious if when you send all commands at once are you certain that all commands are received and processed? The PIC might sending the info too fast and the modem is only responding to one of the commands when it replies "OK". This I think would be along the same lines as Melanie thoughts.
Thanks all. Well, Melanie of course it is! I do challenge you!
By no means I asked to go through line by line. Just for reference the code was included.
The version is latest. I had from time to time problems with subroutines and the way was to shorten the length of each one. Now, the symptom is quite strange and the program execution even more. As stated earlier the third Hserout executes to the point ats0= and then it stops for about a minute! This I saw with my eyes on a terminal program. By now there is no explanation as to what might happening.
If the three commands are joined then the execution flows like calm water.
About the modem, cocacolakid, the modem has no problem to process the commands, since the CR/LF has not arrived yet.
Ioannis
Bookmarks