I have been building a DIY Watch project for a while now and now have a brand new prototype to work with
HW details available here : http://www.banson.fr/wiki/doku.php?id=rawlx
This cute LED PCB-based watch is now waiting for its power saving SW to be able to run genuinely on a 3.7V 2450 cell battery.
I'm now struggling with the global SW architecture of the ATMEGA code to be able to run it as long as possible. I've been digging for a while inside the documentation and the tutorials for sleep/idle modes and i'm looking now for advices on the solution chosen.Here is how I see it now :
By default unit sleeps. Time is stored internally inside a variable which is set at initial startup.
- TIMER1 is the only peripheral activated when sleeping, it counts endlessly.
- When TIMER1 overflow occurs, an ISR is trigged, ATMEGA wakes to update the Time variable according to the elapsed 65536 TIMER1 ticks, and system is put back to sleep, TIMER1 continuing its duty.
- When button is pressed, another ISR is triggered, waking up the ATMEGA. Time variable is updated according to TIMER1 accumulator cournter, and displayed using the leds for a bried amount of time.
Is this approach reasonable? Can I use the Arduino low power library, or do you advise to do it by hand by tweaking ATMEGA registers? I'm still more at ease with Arduino IDE so as far as possible, I'd like to stick to the Arduino world as much as i can.
I'm still not completely sure I can put the whole chip to sleep except the TIMER1 counter, and if everything can be waken up the way I want to do it.
Thanks in advance for your feedback/suggestions,
note : I have chosen not to use a RTC for visual aspect reasons, and I'm ready to use low frequency crystal as ATMEGA clock to reduce power consumtion as well. I have a few 32khz and 2Mhz crystals to mess around with.