Hello people, arduino sleep modes have been widely debated here, so I hope I will not be too repetative. Here it goes:
Since I need to lower the power consumtion of my 328P arduino @16Mhz 5V I looked into the available sleep modes. The idle mode + watchdog seemed like the right choice because many sources (many times this forum) poited out that all the timers and periferial units work in this mode. The savigs might be moderate..but I was willing to sacrifice minimum power for robustness and simplicity as I relly heavily on measuring time with millis and the Time.h library. I painfuly experienced that idle mode + millis() is not a good combination as millis() (and probably the time.h fuctions) use timer0 which issues an overflow interrupt much before the watchdog starts to bark. Disable the interupt - millis() don't work!
Can you please give me some general programming guidelines in these situations. A real time clock is out of the question since I don't want to complicate the hardware at this stage.
One is to use the watchdog timer which is said to be innacurate. The innacuracy I guess, could be mitigated with callibrating the clock once in a while... I can live with 1%
Is it possible to construct a time keeping procedure like millis() with timer1 or timer2? Or are those two timers the same as timer0 concerning interrupts and waking up from sleep..