Strange Relay Pulsing
Archiver
Posts: 46,084
Martin-
When you allow your Stamp program to "fall off the edge of the world"
by running out of instructions to execute, it enters the END mode.
See the manual for the gory details of END, but the main thing here
is your Stamp pins all become inputs (not driven) briefly every ~2.3
seconds. In your second program, waiting forever for the "ATTN:" to
arrive prevents this condition.
The usual approach to prevent this problem is to end your program
with an endless loop:
loop:
GOTO loop
or with a STOP statement. Your final program will probably always
have a next thing to be done so this problem solves itself normally.
Regards,
Steve
On 2 Apr 01 at 23:53, martin@i... wrote:
> Can anyone explain why the following code causes a relay to pulse
> off about every 2 seconds instead of staying on...
When you allow your Stamp program to "fall off the edge of the world"
by running out of instructions to execute, it enters the END mode.
See the manual for the gory details of END, but the main thing here
is your Stamp pins all become inputs (not driven) briefly every ~2.3
seconds. In your second program, waiting forever for the "ATTN:" to
arrive prevents this condition.
The usual approach to prevent this problem is to end your program
with an endless loop:
loop:
GOTO loop
or with a STOP statement. Your final program will probably always
have a next thing to be done so this problem solves itself normally.
Regards,
Steve
On 2 Apr 01 at 23:53, martin@i... wrote:
> Can anyone explain why the following code causes a relay to pulse
> off about every 2 seconds instead of staying on...
Comments
is NOT a COMMAND!
what this is?
ACJacques
martin@i... wrote:
>
> Can anyone explain why the following code causes a relay to pulse off
> about every 2 seconds instead of staying on...
>
> output 0
> out0 = 1
>
> ...but with this code no pulsing effect...
>
> output 0
> out0 = 1
> SERIN 16, 16780, [noparse][[/noparse]WAIT("ATTN:")]
>
> ...the relay saying on as it should.
>
> It's as if the first one is looping which is stopped by the WAIT in
> the SERIN command.
>
> The relay is controled by a transistor relay driver circut, but I
> don't see how this is a hardware issue.
>
> Thanks,
> Martin
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
about every 2 seconds instead of staying on...
output 0
out0 = 1
...but with this code no pulsing effect...
output 0
out0 = 1
SERIN 16, 16780, [noparse][[/noparse]WAIT("ATTN:")]
...the relay saying on as it should.
It's as if the first one is looping which is stopped by the WAIT in
the SERIN command.
The relay is controled by a transistor relay driver circut, but I
don't see how this is a hardware issue.
Thanks,
Martin
martin@infinitefunctions.com writes:
about every 2 seconds instead of staying on...
output 0
out0 = 1
...but with this code no pulsing effect...
output 0
out0 = 1
SERIN 16, 16780, [noparse][[/noparse]WAIT("ATTN:")]
...the relay saying on as it should.
It's as if the first one is looping which is stopped by the WAIT in
the SERIN command.
The relay is controled by a transistor relay driver circut, but I
don't see how this is a hardware issue.
Consult the manual regarding END and the 18ms "wink" that occurs every 2.3
seconds (also happens during SLEEP). ·Your second listing fixes the problem
by waiting in an infinite loop (the SERIN) -- the Stamp program never "ends"
and doesn't go into low-power mode.
You can fix your first listing by adding STOP at the end.
[/font]
acjacques@infolink.com.br writes:
is NOT a COMMAND!
what this is?
Yes, it is -- for the BS2 family. ·This is the same as Dir0 = 1.
[/font]
My completed program doesn't run into this problem and now I know why.
Just wanted to make sure this is a 'feature' and not a bug. [noparse]:)[/noparse]
Martin