I am using atxmega8e5 in a design and also utilizing its Real-Time Counter to act as a Real-Time Clock.
A lot of RT-Clock ICs can use a SuperCap to have backup power incase the device is unplugged or incase of power outage. Backup time requirement isn't huge: just a min. of 10 hours.
Is it possible to utilize a SuperCap to provide backup power to my MCU? If so, how would one go about it—what is the required circuity to switch from mains power to backup capacitor, and how would one charge it safely? The xmega8e5 does not have a dedicated pin for backup power and also lacks the 'Trickle Charge' capability of many RTCs.
Note: I am not asking about the various sleep modes. I am aware of them and will use them when the chip is using backup power.
If the required circuity costs as much as a RT-Clock IC, then might as well use that?