Shop OBEX P1 Docs P2 Docs Learn Events
Odd Voltage Fluctuation — Parallax Forums

Odd Voltage Fluctuation

cparkercparker Posts: 14
edited 2006-08-09 17:17 in BASIC Stamp
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

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-08-08 05:58
    CP -

    End your program as shown below, and the symptoms should disapear:

    EndPgm:

    GOTO EndPgm ' Loop forever

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-08 14:10
    Hello,

    ·· 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
  • cparkercparker Posts: 14
    edited 2006-08-09 16:37
    Excellent. I'm sure I just overlooked that in the manual. Thanks!

    CP
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-08-09 17:17
    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" smile.gif

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
Sign In or Register to comment.