View Full Version : Sleep
  
tazntex
- 17th November 2008, 15:46
Over the weekend I looked over the 16 key serial keypad example at Bruce's website.  I was wondering how would I go about adding a SLEEP or NAP command to his code if no button is pressed I could conserve power.  And also how would I make it wake up  when a button is pressed?  After searching the forums I've seen the @sleep, sleep for X period but have not found a good suggestion for using SLEEP.  Here is Bruce's link to the keypad code:
 http://www.rentron.com/serkey16.htm
  
Thanks
mackrackit
- 18th November 2008, 15:12
Being the the example is using PORTB...
http://www.picbasic.co.uk/forum/showpost.php?p=60877&postcount=3
tazntex
- 19th November 2008, 14:37
I saw that post earlier, not having much if any knowledge on Assembly, I wasn't quite sure what was going on.  I tried it out, added a while;wend  with an led flashing when it arrived at that point and then after added @sleep @no. I believe that the NOP clears the GIE bit according to the '628 datasheet but noticed that the example on this forum showed it added twice.  Anyhow I powered the '628 with a 78L05 regulator with a 9V battery without using the @SLEEP and I am drawing 12mA measuring from battery into the regulator.  With the @SLEEP command I am still drawing 12mA so believing that the regulator is the cause. The Quiescent Current on the 78L05 is 3 min. 5mA max and on the LP2950CZ-5.0 it is 75uA. I have ordered a  LP2950CZ-5.0 regulator.  Perhaps this will cure my project's hunger for batteries. 
Thanks for your help, '73
 
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.