SERIN timeout
Archiver
Posts: 46,084
Helen-
What does happen when "the modem is on but does not respond within
the time"? Does execution fall through to the next statement as if
the SERIN were complete (how do you know?)? If so, what's is in the
scratchpad at that point?
If you haven't done so already, try adding a DEBUG statement,
flashing LED or some indication at the start of your program as
an indication that your program has (re)started. This will let you
know if glitches are causing your Stamp to reset.
You probably already know this, but the timeout applies only to
receiving some/any data, not specific data such as the "+". So if
any data is received by your Stamp at intervals < one minute, it
won't time out even if it never sees a "+".
Regards,
Steve
On 23 Feb 04 at 11:04, hcussen wrote:
> I am using a BS2pe to communicate with a modem through a MAX242
> chip, using the following code to send the AT commands:
>
> SEROUT MOD_RX,188,[noparse][[/noparse]command,$0D]
> SERIN MOD_TX,188,60000,No_Response,[noparse][[/noparse]WAIT ("+"), SPSTR 10]
>
> The timeout function works if the modem is not powered up but does
> not work if the modem is on but does not respond within the time.
What does happen when "the modem is on but does not respond within
the time"? Does execution fall through to the next statement as if
the SERIN were complete (how do you know?)? If so, what's is in the
scratchpad at that point?
If you haven't done so already, try adding a DEBUG statement,
flashing LED or some indication at the start of your program as
an indication that your program has (re)started. This will let you
know if glitches are causing your Stamp to reset.
You probably already know this, but the timeout applies only to
receiving some/any data, not specific data such as the "+". So if
any data is received by your Stamp at intervals < one minute, it
won't time out even if it never sees a "+".
Regards,
Steve
On 23 Feb 04 at 11:04, hcussen wrote:
> I am using a BS2pe to communicate with a modem through a MAX242
> chip, using the following code to send the AT commands:
>
> SEROUT MOD_RX,188,[noparse][[/noparse]command,$0D]
> SERIN MOD_TX,188,60000,No_Response,[noparse][[/noparse]WAIT ("+"), SPSTR 10]
>
> The timeout function works if the modem is not powered up but does
> not work if the modem is on but does not respond within the time.
Comments
using the following code to send the AT commands:
SEROUT MOD_RX,188,[noparse][[/noparse]command,$0D]
SERIN MOD_TX,188,60000,No_Response,[noparse][[/noparse]WAIT ("+"), SPSTR 10]
The timeout function works if the modem is not powered up but does
not work if the modem is on but does not respond within the time.
Please help.
Helen
Change your baud mode to
188 + $4000
and give it a go.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: hcussen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=V86VMwsbDCrqQSgqS_g_6t2g0kPmInrxtzzMuHT3-6zKfKjqkSYlOZfXdGuBor5bnXE_E7lDOdTpU4YT0bGRiCIZ]helen@t...[/url
Sent: Monday, February 23, 2004 5:04 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] SERIN timeout
I am using a BS2pe to communicate with a modem through a MAX242 chip,
using the following code to send the AT commands:
SEROUT MOD_RX,188,[noparse][[/noparse]command,$0D]
SERIN MOD_TX,188,60000,No_Response,[noparse][[/noparse]WAIT ("+"), SPSTR 10]
The timeout function works if the modem is not powered up but does
not work if the modem is on but does not respond within the time.
Please help.
Helen
I should have said that the modem communicates fine most of the time
with true data but occasionally it does not send out a reply after it
has transmitted. This is when the timeout function doesn't work.
The problem may be that the modem is causing noise on the power rail
supplying the 5V reg to the stamp. The modem draws 4.4 V amd up to
2.5A so I am using an LT1529 in conjunction with an MJ3001 power
transistor. I have a 10uF cap on the emitter but this has not
improved things. The problem is intermittent so it is very difficult
to resolve.
Any suggestions would be greatly appreciated.
Thanks,
Helen
PS.I did try chaging the baud mode but this stopped all comms between
the stamp and the modem.
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> I'm betting your modem wants inverted data and you're specifying
true.
> Change your baud mode to
>
> 188 + $4000
>
> and give it a go.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: hcussen [noparse][[/noparse]mailto:helen@t...]
> Sent: Monday, February 23, 2004 5:04 AM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] SERIN timeout
>
>
> I am using a BS2pe to communicate with a modem through a MAX242
chip,
> using the following code to send the AT commands:
>
> SEROUT MOD_RX,188,[noparse][[/noparse]command,$0D]
> SERIN MOD_TX,188,60000,No_Response,[noparse][[/noparse]WAIT ("+"), SPSTR 10]
>
> The timeout function works if the modem is not powered up but does
> not work if the modem is on but does not respond within the time.
>
> Please help.
>
> Helen
I do have debug statements in the code which is why I know it is
latching up. What you said about SERIN looking for any data during
the timeout period explains a lot. I now just have to work out how
to avoid the wrong data causing a latch-up.
Thanks a lot,
Helen
--- In basicstamps@yahoogroups.com, "S Parkis" <parkiss@e...> wrote:
> Helen-
>
> What does happen when "the modem is on but does not respond within
> the time"? Does execution fall through to the next statement as if
> the SERIN were complete (how do you know?)? If so, what's is in
the
> scratchpad at that point?
>
> If you haven't done so already, try adding a DEBUG statement,
> flashing LED or some indication at the start of your program as
> an indication that your program has (re)started. This will let you
> know if glitches are causing your Stamp to reset.
>
> You probably already know this, but the timeout applies only to
> receiving some/any data, not specific data such as the "+". So if
> any data is received by your Stamp at intervals < one minute, it
> won't time out even if it never sees a "+".
>
> Regards,
>
> Steve
>
> On 23 Feb 04 at 11:04, hcussen wrote:
>
> > I am using a BS2pe to communicate with a modem through a MAX242
> > chip, using the following code to send the AT commands:
> >
> > SEROUT MOD_RX,188,[noparse][[/noparse]command,$0D]
> > SERIN MOD_TX,188,60000,No_Response,[noparse][[/noparse]WAIT ("+"), SPSTR 10]
> >
> > The timeout function works if the modem is not powered up but does
> > not work if the modem is on but does not respond within the time.
line from the modem? It should time out. And if it does, that
indicates that there happens to lot of noise on the phone line. Like
Steve pointed out, the incoming phone line has to be absolutely quiet
for the 1 minute timeout interval, or else the interval will reset.
Any noise whatsoever will restart it. It is not just waiting
specifically for the "+". That is a big problem when using a Stamp
in a fully automated modem system on potentially noisy phone lines
without an additional "watchdog".
How do you mean, "modem draws 4.4 V and up to 2.5A". What modem
draws 2.5 amps?
-- Tracy
>Thanks Jon,
>
>I should have said that the modem communicates fine most of the time
>with true data but occasionally it does not send out a reply after it
>has transmitted. This is when the timeout function doesn't work.
>
>The problem may be that the modem is causing noise on the power rail
>supplying the 5V reg to the stamp. The modem draws 4.4 V amd up to
>2.5A so I am using an LT1529 in conjunction with an MJ3001 power
>transistor. I have a 10uF cap on the emitter but this has not
>improved things. The problem is intermittent so it is very difficult
>to resolve.
>
>Any suggestions would be greatly appreciated.
>
>Thanks,
>
>Helen
>
> >
>>
Original Message
>> From: hcussen [noparse][[/noparse]mailto:helen@t...]
>> Sent: Monday, February 23, 2004 5:04 AM
>> To: basicstamps@yahoogroups.com
>> Subject: [noparse][[/noparse]basicstamps] SERIN timeout
>>
>>
>> I am using a BS2pe to communicate with a modem through a MAX242
>chip,
>> using the following code to send the AT commands:
>>
>> SEROUT MOD_RX,188,[noparse][[/noparse]command,$0D]
> > SERIN MOD_TX,188,60000,No_Response,[noparse][[/noparse]WAIT ("+"), SPSTR 10]
>>
>> The timeout function works if the modem is not powered up but does
>> not work if the modem is on but does not respond within the time.
>>
>> Please help.
>>
>
> > Helen