Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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?

0
Posted

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?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123