Why do the BASIC Stamps output pins toggle briefly when I use the SLEEP, NAP or END commands or allow my program to end naturally?
Inside the BASIC Stamp’s interpreter chip is a watchdog timer whose main purpose is to reset the interpreter chip if, for some reason, it should stop functioning properly. The SLEEP and NAP commands also utilize the watchdog timer to periodically (every 2.3 seconds to be exact) “wake-up” the BASIC Stamp from its low-power mode. Upon reset the I/ O pins are set to inputs for approximately 18 mS before returning to their previous directions and states. If you have an output pin set to a logical 1 state (+ 5V) and you use the SLEEP command, every 2.3 seconds during sleep mode that I/ O pin will switch to an input for 18 mS causing a momentary signal loss. This “power glitch” is easily viewable with an LED and a 470 ohm resister tied to an I/ O pin and switched on just before entering sleep mode. In many cases this problem can be remedied by tying a pull-up or pull-down resistor to the I/ O pin in question to provide a constant source of power should the I/ O pin change directions. Allowin