PDA

View Full Version : Sleep/Nap Low power consumption



George
- 15th March 2007, 00:54
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

George
- 15th March 2007, 18:44
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

Pic_User
- 15th March 2007, 19:40
Hi George,

Try searching for:
nap*

or

A better Search tool for the Forum
By Darrel Taylor
http://www.picbasic.co.uk/forum/showthread.php?t=4751&highlight=search+site

-Adam-

George
- 15th March 2007, 20:59
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

paul borgmeier
- 16th March 2007, 06:19
it says PBP ignores the period after NAP but it doesn't appear to ignore it at allThe 16F676 is a 14 Bit core device NOT a 16 bit core device ... only the 16 bit devices ignore the period