Electronic – Switching input voltage, with two 3,3V inputs

3.3vpower supplyswitches

I'm designing a circuit that can get its power from either a battery or a usb. The regulating of the battery and usb voltages is already done, and is regulated down to 3,3V.
If both supplies is connected at once, I don't want them both to supply. If both are connected, I only want the USB to power the circuit. If only the USB is connected, only the USB should power the circuit, and if only the battery is connected that should supply the circuit. How can I do this with ex. the use of MOSFETS or diodes? Thanks in advance.

schematic

simulate this circuit – Schematic created using CircuitLab

EDIT:

schematic

simulate this circuit

Best Answer

The LTC4236 works below 3.3 volts so maybe consider this as an idea: -

enter image description here

There are two supply options on the left and the chip decides which one is to supply the load and it uses MOSFETs as a power OR gate. This type of circuit avoids the diode voltage drop in one or both power lines. The LTC4412 is more suited to supply voltages that are unregulated or different and will require a post regulator to convert to 3.3 volts.

I'm not recommending it verbatim but just suggesting that there are devices that can do this job and, if you are confident you can mastermind a version of this in discrete components.