Low Power Mode....
willthiswork89
Posts: 359
im wanting the stamp to go into low power mode until the switch is turned on... i tried stop but you have to reset the program if you use that... how can i make it go into low power mode until the statement becomes true?
Comments
Both the PBASIC Reference Manual and the PBASIC Help file hold the answer to your question. Have you perused either of them yet?
You will need to put your program in a loop which checks the switch status, and if it's not ON, then use one of the power saving commands to wait a short or long period of time. Each of the commands permits you to set the duration of the waiting period.
One of the commands begins with the letter "N" and the other begins with the letter "S".
Regards,
Bruce Bates
Post Edited (Bruce Bates) : 7/30/2006 8:09:30 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Did you look at the "N" commands yet?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
heres the code im using
' {$STAMP BS2}
' {$PBASIC 2.5}
powersw VAR Bit
DO
powersw = IN15
IF(powersw = 1) THEN
DO
NAP 3
powersw = IN15
DEBUG HOME, "Powered Down"
LOOP UNTIL(powersw = 0)
ENDIF
DEBUG CLS
DO
powersw = IN15
DEBUG HOME, "Powered UP!"
LOOP UNTIL(powersw = 1)
LOOP
i was planning on making the thing so i didnt have to remove the battery and i could put the cars case back on. I was wondering if there is a way to make a template for the editor or save my prefrences from when it starts up it already knows i am using BS2 and .2.5 unless noted otherwise.. and can you change that background color of the editor its self? not just the highlight part of it?
Post Edited (willthiswork89) : 7/30/2006 8:48:37 AM GMT
Only YOU can answer that question of savings. The longer you NAP or SLEEP, the more power you will conserve. It's as simple as that.
Here are the two figures of interest to you for the BS-2 Stamp:
·Mode·· Current
··
Active··· 3 mA
Sleep··· 50 uA
Regards,
Bruce Bates
Yes, there is·significant power savings in SLEEP or NAP mode.
As to your other question. amperes have no time component in and of themselves. Thus, the figures I offered are instantaneous current.
A unit of measure which includes amperes and time is the ampere-hour or amp-hour for short. That would be written as (say) 50 mAH. Battery capacity is often quoted in terms of mAH or AH.
By way of example, if you say - I have a battery which will deliver 2000 mAH, how long will it power a 50 mA load? The answer to that question is:
2000 mAH / 50 mA = 40.0 Hours or 2400 minutes
Perhaps a better way to see it is via the infamous "line equation", thusly:
2000· mA*H·········40 H
=···
·· 50· mA··············1
where the mA units cancel one another out and you're left with hours.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Depending on the type of "switch" configuration you have going to the STAMP, there is a hardware solution that
might work for you consuming less than 3 nA (nano Amps!). I used this circuit for a doorbell in my daughter's
playhouse which lasted more than 6 months on a nine-volt battery ( <-- most of that was due to the shelf life of
the rechargeable battery itself)
Note: This circuit will work as a touch switch (i.e. the doorbell application) , but a regular contact closure switch
will work just fine.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 7/30/2006 8:31:32 PM GMT
Depending on the type of switch configuration you have in your circuit, that being a regular contact closure switch, yes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.