Patent ID: 8451049

Claim:
A power supply switching circuit, comprising: a first terminal to which a first voltage is input, a second terminal to which a second voltage is input, a third terminal to which a third voltage is output, and a fourth terminal from which a fourth voltage is output; a detector including an input terminal connected to the first terminal; a control circuit including an input terminal connected to an output terminal of the detector; a diode OR circuit including a first input terminal connected to the first terminal, a second input terminal connected to the second terminal, and an output terminal connected to the fourth terminal; a first MOS transistor which includes a gate connected to a first output terminal of the control circuit and is provided between the second terminal and the third terminal; a second MOS transistor which includes a gate connected to a second output terminal of the control circuit and is provided between the second terminal and the third terminal; and a third MOS transistor which includes a gate connected to a third output terminal of the control circuit and is provided between the first terminal and the third terminal, wherein, when the detector detects that the first voltage is higher than a detection voltage, the control circuit operates with the fourth voltage output from the diode OR circuit, supplies a voltage which is equal to a source voltage and a back gate voltage of the first MOS transistor to the gate of the first MOS transistor, supplies a voltage which is equal to a source voltage and a back gate voltage of the second MOS transistor to the gate of the second MOS transistor, and supplies a voltage for turning ON the third MOS transistor to the gate of the third MOS transistor, and wherein, when the detector detects that the first voltage is lower than the detection voltage, the control circuit supplies a voltage for turning ON the first MOS transistor to the gate of the first MOS transistor, supplies a voltage for turning ON the second MOS transistor to the gate of the second MOS transistor, and supplies a voltage which is equal to a source voltage and a back gate voltage of the third MOS transistor to the gate of the third MOS transistor.