I'm trying to make a small clock but want to ditch the need for a separate RTC chip with battery backup. What I would like to do, instead, is keep track of the time completely on the ATMega using the watchdog timer to generate a roughly 1Hz signal to count the seconds with. Not super accurate, but good enough for what I need.
The key though is that I would like to still have a battery backup. So, what I need it to do is detect that it no longer has 5V power (probably from USB) and switch into low power mode (running off a 3V CR2032 or similar) only waking when the watchdog timer ticks in order to increment the seconds. I'm guessing also dynamically decrease the clock speed (switch to internal or something) to save power.
I'm a bit stumped... How would I actually do the hardware for this? I vaguely remember something about "diode ORing" the backup battery... no idea what that means. And bonus points for the software side of things.
No comments:
Post a Comment