PDA

View Full Version : SLEEP and NAP commands



ero
- 1st February 2017, 17:59
I am working on one Battery Operated RF project with NRF24L01+ modules.
I need to arrange as much as low current consumption for both side as TX and RX. I have no problem on TX side because I can put the module in Standby-I mode which pull 26uA and I can put the pic (16F1827) in low Current mode (sleep mode) also and wake up all together by pushing one button. The main problem is on the RX side. If I put the RX in low current mode it does not recive any information. For that reason I need to arrange a time division sleep and wakup system. I was thinking to open Timer interrupt but they are not working in sleep mode. The only way is to use external inputs but this is also impossible.
It seems that there is only solution is to use Wdt or Sleep X or NAP x commands.

I read that the sleep and Nap commans were using the wdt in order to wakeup. I tried some codes but I could not get success. For that reason I want to ask how that commans can be used? what are the conditions to use sleep x or Nap x commands.
Related my question also I need to know how WDT Fuse must be arranged (WDT_ON or WDT_OFF)

I will appreciate if somone reply my questions.

Ero

peterdeco1
- 3rd February 2017, 11:19
I always leave watchdog timer on. I use nap 0 to reduce current drain.

start:
nap 0
if porta.1 = 1 then run
goto start

run:
xxxxxxxxxxxxxxxxxx