Sleep


Closed Thread
Results 1 to 3 of 3

Thread: Sleep

  1. #1

    Default Sleep

    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

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Being the the example is using PORTB...
    http://www.picbasic.co.uk/forum/show...77&postcount=3
    Dave
    Always wear safety glasses while programming.

  3. #3

    Default

    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
    Last edited by tazntex; - 19th November 2008 at 13:50.

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  3. 16F628A current high during sleep
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2006, 10:21
  4. Wierd sleep issue
    By orca in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th March 2006, 22:06
  5. SLEEP Command and Interupts 16F648A
    By ghoot in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 28th May 2004, 18:35

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts