Modem Auto Answer-Hanging for 1 min...


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115

    Default Modem Auto Answer-Hanging for 1 min...

    Trying to set up a modem, found that PIC 16F877 hangs for a minute or so when the program executes the Hserout ["ATS0=3",13,10] command. Monitoring the serial port I get:

    ATS0=

    and then the program freezes for a minute. After that, a string <00> follows!

    ATX3
    AT&K0
    ATS0=<00>

    Here is a snippet of the program:

    hserout ["ATX3",13,10]
    pause 500
    hserout ["AT&K0",13,10] 'No Dial tone, no Flow Control
    Pause 800
    Hserout ["ATS0=3",13,10] 'Auto Answer in 3 rings
    pause 500

    If anyone has any idea what's going on here, please help!

    Ioannis

    P.S. I tried to send the commands as one like ATs=0x3&K0 and seems to work. I am just concerned about timing....
    Last edited by Ioannis; - 13th August 2005 at 22:30.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Have you tried issuing a single command string?

    hserout ["ATX3 AT&K0 ATS0=3",13,10]

    Just wondering if you are trying to stuff the next command into the modem whilst it's still trying to acknowledge the first one you gave it. So increase the pause also.

  3. #3
    harrisondp's Avatar
    harrisondp Guest


    Did you find this post helpful? Yes | No

    Default

    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:
    Code:
    DEFINE HSER_CLROERR 1
    Harrison

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    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

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    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!!!
    Attached Files Attached Files
    Last edited by Ioannis; - 16th August 2005 at 12:52.

Similar Threads

  1. No Modem response
    By jimboho in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 11th November 2004, 05:58

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts