Sleep/Nap Low power consumption


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171

    Default Sleep/Nap Low power consumption

    I'm trying to build an rf remote unit, which has an LED indicator, i want it to go to sleep after a while to save battery power and wake about every 0.5 sec to check for keypress then go back to sleep. I tried with sleep 1 - but apparently that means 2.3 seconds - even then it doesn't seem like it's right. I also tried with NAP - but not sure how to use NAP on a 16F676. I tried NAP 5 but then read that PBP ignores the 5 for a 16 core chip.

    I've found that the nap will work for one WDT cycle - but not too sure on how to set the WDT postscaler for longer - can anyone give me an example please

    Here's wot i got so far to do with the sleep routine:

    Start:

    if timesw = 1 then settime 'jump to setime if triggered
    if gosw = 1 then go
    if stopsw = 1 then trnsstop
    sleep 1
    timer = timer + 1
    if timer < 20 then disply
    portc = 0
    timer = 20

    goto start

    disply:

    display = (1 << timeset)
    PORTC = display

    goto start
    Last edited by George; - 15th March 2007 at 01:35.

  2. #2
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    It's annoying because I can't search for the NAP command on this forum due to NAP being a three letter word and it wont let u search any less than four letters

    Is this correct for setting up the WDT for NAP to be as long as poss on my 16F676?

    OPTION_REG = %11011111
    Last edited by George; - 15th March 2007 at 19:11.

  3. #3
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile How to search for three letter words

    Hi George,

    Try searching for:
    nap*

    or

    A better Search tool for the Forum
    By Darrel Taylor
    http://www.picbasic.co.uk/forum/show...ht=search+site

    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  4. #4
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    Cool thanks - it works - got my nap thing sorted I just got confused because in the PBP manual it says PBP ignores the period after NAP but it doesn't appear to ignore it at all - I find I'm having to wake up and look for the button press 5 times a second else button presses are often missed

  5. #5
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    it says PBP ignores the period after NAP but it doesn't appear to ignore it at all
    The 16F676 is a 14 Bit core device NOT a 16 bit core device ... only the 16 bit devices ignore the period
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. 12F629 Strange interupt behavior
    By BGreen in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th May 2007, 15:35
  4. low power consumption
    By taos in forum General
    Replies: 0
    Last Post: - 26th February 2006, 08:33
  5. 4-line LCD Help - using PortA instead of B
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 31st March 2005, 03:14

Members who have read this thread : 0

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