Hi,
I want to have 2 power sources, one is Isolated DC-DC converter (5v-to-5v, 400mA max) from USB, and the other is a normal 12v DC input (wall adapter for high current of 1A min).... to charge 2 Li-ion batteries (8.4v max).
I want a circuit to activate only one of them at a time while the isolated 5v run by default. So when you plug the 12v source, the circuit disconnects the 5v and activate the 12v one.
The problem is when someone put 2 of them at the same time (especially when the project is off) while the MCU is not yet powered... To cut it short, here is what I came up with:

As you can see, the grounds are shared (can it be not?) and I put diodes for the typical protection... but diodes alone can not operate if the 2 sources are on at the same time... well, maybe I am wrong because if that happens then the drop voltage around the D2 diode will be 5v-12v which will turn it off for sure...
I thought about making Op-Amp comparator but I think it wont work nicely.
I want the 2 sources to be protected from each other so the isolated 5v-to-5v supply is always "isolated", it must be fed to a Boost converter (MIC2288) to make the voltage 9v to charge 2-cell 18650 batteries (200mA max so it will be slow). The other 12v source is for fast charging but not isolated.
looking forward to your comments...
thanks!