My goal is to put the UNO to sleep, and then wake on one of two conditions: a timer (10ms) or a pin change.
It appears INT0 and TIMER0_COMPA are the needed interrupts. But implementing that from datasheet "scratch" feels out of reach at my skill level.
Tips, reading, example code, etc... before I start coding will be greatly appreciated.
Thanks,
Dan
San Jose
Nick Gammon has a good tutorial on power management and sleep/wake. I doubt you want to leave Timer 0 running as the tutorial says it will wake the processor every millisecond.
He has an example of using the watch dog timer and an external interrupt for wake.
Thanks for the comment. Nick's page is well done. I found in it a sketch for the ATtiny85 that is doing close to what my project requires (BTW I am modeling this on the UNO, but the finished project will be ported to Konde based ATtiny412). I agree with your comment about not wanting to wake every millisecond, however during normal use of the device it needs to wake every 10ms (or on pin change), and then increase the sleep duration according to a few bracketed periods of inactivity. i.e. an auto off, so if the user has not touched it in three hours, it sleeps with no WDT/RTC - so as to reduce power consumption and make the pin change the only means of waking the device.
Thanks,
Dan