For a project based on AT32UC3A3256 we now want to move from bus power to mains power. I wonder what is the best way to enumerate and configure the parts.
The project is an audio USB DAC (www.qnktc.com/ab_11). The mains powered components are DSPs, DAC chips, analog filters and amplifiers. When both VBUS and mains are off, the unit is obviously off. And when both are on, everything inside should be on.
But how should I act when only VBUS is on and when only mains are on? Both VBUS and mains produce a 5V supply from which I can run the 3.3V LDO which powers the MCU. The MCU is also aware of VBUS through pin 1.
I have considered running the MCU from VBUS, running it from mains, or let VBUS act as an enable signal to gate mains power to the MCU.
Which is the proper way to do things for what now probably becomes a USB self powered device?
With VBUS enabling mains power to the MCU, the MCU will die when mains power fails, yet the MCU will still see VBUS on pin 1. Is this OK?