When one is active the other one is not and it's disconnected from the load. I know that this would be straightforward with a manual switch but I need this application to be automatic, maybe using a MOSFET as a switch controlled by a uC but it's not clear to me how I can achieve that. I wouldn't use a relay since I have constraints on cost and size of the footprint. Thanks. Claudio
First of all: add a capacitor in parallel to your load. Every switching operation will inevitably lead to some short disruption, and a sufficiently sized capacitor will allow your device to continue working through the switchover.
Then, as M D said, you could just have a microcontroller on the load side of things that monitors both power sources and initiates switching when necessary. How that switching is done, and what "necessary" means in this context, is up to you to define.
Furthermore, this is often solved by using dedicated circuitry, since it's a very common problem and needs a fast and reliable solution in many cases.
So, companies like Linear Technologies have ICs that do that – the LTC4412 has an especially nice datasheet with examples of how to use it to control a MOSFET to do your switching.
Use a load or analog switch (pending power level) to handle the switch component, and select power supplies with a low-power shutdown (enable pin) to turn them off when unused. Pending component selection and your application , you might be able to accomplish this with a single GPO from the MCU.