Odd Voltage Fluctuation
This is probably something obvious so forgive me....
I have a simple relay circuit with a 1k resistor between pin 0 and the base of an NPN transistor, emitter connected to ground, and +5v connected to the relay, then to the collector. When I upload a simple 1 line BS2 program which does HIGH 0, the relay quickly switches off/on about once per second. I can also see a quick drop in voltage on my digital voltmeter. However, when I add a loop to the program after the HIGH 0, which prints some DEBUG, and pauses, the fluctuation doesn't happen.
It's as if something is causing the stamp to reset about once per second when the stamp isn't doing any debug.
Any idea what could cause this?
Thanks.
CP
Boulder, CO
I have a simple relay circuit with a 1k resistor between pin 0 and the base of an NPN transistor, emitter connected to ground, and +5v connected to the relay, then to the collector. When I upload a simple 1 line BS2 program which does HIGH 0, the relay quickly switches off/on about once per second. I can also see a quick drop in voltage on my digital voltmeter. However, when I add a loop to the program after the HIGH 0, which prints some DEBUG, and pauses, the fluctuation doesn't happen.
It's as if something is causing the stamp to reset about once per second when the stamp isn't doing any debug.
Any idea what could cause this?
Thanks.
CP
Boulder, CO
Comments
End your program as shown below, and the symptoms should disapear:
EndPgm:
GOTO EndPgm ' Loop forever
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
·· When you end your program with END (or nothing, which implies END) the BASIC Stamp goes into low power mode, waking up every 2.3 seconds when the internal counter resets, at which point the I/O lines temporarily change states.· Use Bruce's suggestion to avoid this, or use the command STOP at the end of your program.· Both will prevent this.· I hope this helps.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
CP
Not really, unless you're occasioned to scanning the small print, and footnotes like I do. Like it or not, you just obtained your "Tenderfoot Badge"
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->