sleep command
I have an interactive project that I am trying to run from a 9V
battery and am trying to figure out how to use the sleep command so I
can conserve battery life. Is there any way of getting the stamp to
wake up if a button is pushed during it's sleep time??? Any
information will be greatly appreciated.
battery and am trying to figure out how to use the sleep command so I
can conserve battery life. Is there any way of getting the stamp to
wake up if a button is pushed during it's sleep time??? Any
information will be greatly appreciated.
Comments
>battery and am trying to figure out how to use the sleep command so I
>can conserve battery life. Is there any way of getting the stamp to
>wake up if a button is pushed during it's sleep time??? Any
>information will be greatly appreciated.
To get it to wake up immediately, you can couple the button into the
reset circuit of the Stamp. Are you using a BS2?
10k
;---/\/\--- +5 volts Vdd
push |
____ |
;-o o--oo-||
reset pin 22 on the BS2
| | 0.01uf
Vss |
`
P15 input on the stamp
' executes at reset
top:
if in15=0 then wakefrombutton
Of course the reset clears all the variables and that may or may not
be acceptable for what you are trying to do. The alternative is to
use NAP for a shorter period (say .5 second) so that the stamp will
wake up often enough to poll the button.
For some potentially useful information on the sleep bug and brownout,
check this URL:
http://www.emesystems.com/BS2power.htm
-- regards,
Tracy Allen
electronically monitored ecosystems
mailto:tracy@e...
http://www.emesystems.com