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
Bookmarks