Do one or more of the sleep modes still allow the use of a loop and the delay function? Not sure if this is possible but I would like to put the atmega328 in a low power mode and wake it up using a loop counter with a delay function and then use the watchdog timer to wake it up. I got the chip in power down mode fine but I need to wake it up automatically...the watchdog timer apparently only goes to 8 seconds max and I need a much longer time interval. I got the current down to 300 micro amps in power down mode using a bit shift for SMCR on a breadboard circuit and I can live with a high current if necessary. Thanks for any help.
This is the best explanation about power : http://www.gammon.com.au/power
The narcoleptic library uses the WatchDog timer. https://code.google.com/archive/p/narcoleptic/ The WatchDog timer is not very accurate. I have changed the code in one of my projects to allow a unsigned long as parameter.
I need a much longer time interval.
Too bad. What you could do is figure out how many times (in 8 second chunks) that you need to wake up before you need to do something beside go back to sleep.
Paul...I thought about that but wondered if there was another way.
Koepel...is there a practical max delay in millisecs for the narcoleptic.delay function?
With the narcoleptic library, the WatchDog wakes up every 8 seconds, but that uses very little power. The time (variable 'millisconds') is decremented until zero. With unsigned long it can be up to 50 days. The variables keep their value, but the use of millis() can only be done outside the sleeping part.