Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of output stage power selection circuit, when two-way power supply Zhong You mono-road Power supply, selects the power supply having a road power supply output of input as circuit, when two-way all has power supply, and not output voltage.
For solving the problems of the technologies described above, the invention provides technical scheme as follows:
During for having the first supply voltage and a second source voltage two-way Power supply at circuit, automatically select one of them as the power supply of circuit;
Comprise: reference circuit, the first comparator and the second comparator, and control commutation circuit;
Described reference circuit inputs the first supply voltage and second source voltage, and selects wherein higher magnitude of voltage as reference voltage,
Described first comparator input terminal connects the reference voltage of the first supply voltage and the generation of described reference circuit, exports the first comparative voltage; Second comparator input terminal connects the reference voltage of second source voltage and the generation of described reference circuit, exports the second comparative voltage;
Described first comparator comprises: the second NMOS tube, the 3rd PMOS, the second resistance and the first inverter; Described 3rd PMOS source electrode is connected with the first supply voltage with substrate, grid and drain electrode short circuit be connected to drain electrode and first inverter input of the second NMOS tube, the grid of the second NMOS tube is connected with reference voltage, grid is connected with the anode of the second resistance, the negative terminal of the second resistance is connected to ground, and the first inverter exports the first comparison signal; Described second comparator comprises: the 3rd NMOS tube, the 4th PMOS, the 3rd resistance and the second inverter; Described 4th PMOS source electrode is connected with second source voltage with substrate, grid and drain electrode short circuit be connected to drain electrode and second inverter input of the 3rd NMOS tube, the grid of the 3rd NMOS tube is connected with reference voltage, grid is connected with the anode of the 3rd resistance, the negative terminal of the 3rd resistance is connected to ground, and the second inverter exports the second comparison signal;
Two inputs of described control commutation circuit are connected with the output of the first comparator and the second comparator, select supply voltage higher in the first supply voltage and second source voltage to export according to the Output rusults of two comparators.
Concrete, described reference voltage comprises the first PMOS, the second PMOS, the first NMOS tube and the first resistance; The grid end of described first PMOS and the second PMOS, drain terminal are with substrate short circuit and be connected the anode of the first resistance, first PMOS source connects the first supply voltage, second PMOS source connects second source voltage, first resistance negative terminal is connected with the first NMOS tube drain terminal and grid end and output reference voltage, the source of the first NMOS tube and Substrate ground.
Concrete, described control commutation circuit by first or door, second or door, NOR gate, the 5th PMOS, the 6th PMOS form;
Two inputs of described NOR gate are connected with the output of the first comparator and the second comparator respectively, first or door have an input to be connected separately with the output of the first comparator and the second comparator respectively with second or door, another input all connects the output of NOR gate, the grid of described 5th PMOS, the 6th PMOS connects first or door and second or the output of door respectively, source class connects the first supply voltage and second source voltage respectively, leaks level and all connects power output end.
Embodiments of the invention have following beneficial effect:
In such scheme, reference circuit described first supply voltage of input and second source voltage, produce reference voltage; Comparison circuit compares described first supply voltage and second source voltage respectively with described reference voltage, produce comparison signal; Control commutation circuit and input described comparison signal, a voltage higher in described first supply voltage and second source voltage is exported, produces and select voltage.
Therefore, output stage power selection circuit of the present invention, when two-way power supply Zhong You mono-road Power supply, can select the power supply having a road power supply output of input as circuit, when two-way all has power supply, and not output voltage.
Embodiment
For embodiments of the invention will be solved technical problem, technical scheme and advantage clearly, be described in detail below in conjunction with the accompanying drawings and the specific embodiments.
As shown in Figure 1, this is the electrical schematic diagram of output stage power selection circuit of the present invention.One of the object of the invention is among the first supply voltage V1 and second source voltage V2 outputs to power output end VOUT.If the first supply voltage V1 has input voltage, second source voltage V2 does not have input voltage, then VOUT=V1; Otherwise, if the first supply voltage V1 does not have input voltage, second source voltage V2 has input voltage, then VOUT=V2; If the first supply voltage V1 and second source voltage V2 has input voltage, then do not export.
Output stage power selection circuit of the present invention by reference circuit, the first comparator and the second comparator, and controls commutation circuit composition;
Described reference circuit inputs the first supply voltage and second source voltage, and selects wherein higher magnitude of voltage as reference voltage.
In Fig. 1, reference circuit comprises: the first PMOS P1, the second PMOS P2, the first NMOS tube N1 and the first resistance R1.The grid end of P1 with P2 pipe, drain terminal are with substrate short circuit and be connected the anode of R1, and P1 source connects the first supply voltage V1, and P2 source connects second source voltage V2, and R1 negative terminal is connected also output reference voltage with N1 drain terminal and grid end, the source of N1 and Substrate ground.
Below describe the operation principle of reference circuit: P1 pipe grid end and drain terminal short circuit, be equivalent to a diode, its anode connects the first supply voltage V1, and negative terminal node is VIN; The output voltage that VIN holds is as the supply power voltage of follow-up two comparator circuits, and same, P2 pipe grid end and drain terminal short circuit, be also equivalent to a diode, and its anode connects second source voltage V2, and negative terminal is connected with VIN node.The voltage of VIN can select higher in V1 and V2 one as its voltage: when V1 have input voltage, V2 there is no an input voltage time, P1 conducting, P2 cut-off, VIN is connected to the voltage of V1; When V1 there is no input voltage, V2 have an input voltage time, P1 cut-off, P2 conducting, VIN is connected to the voltage of V2; When V1 and V2 has input voltage, if V1>V2, then P1 conducting, P2 cut-off, if V1<V2, then P1 cut-off, P2 conducting, therefore, VIN can be connected to a higher voltage of voltage in V1 and V2, and VIN is in the present invention as the power supply of reference circuit and all inverters, OR-NOT circuit.It is produce electric leakage in order to prevent between V1 and V2 that the substrate of P1 and P2 receives VIN end.
First comparator comprises: the second NMOS tube N2, the 3rd PMOS P3, the second resistance R2 and the first inverter INV1.Second comparator comprises: the 3rd NMOS tube N3, the 4th PMOS P4, the 3rd resistance R3 and the second inverter INV2.
The operation principle of the first comparator and the second comparator is below described.
First comparator is the value of benchmark voltage and V1, in comparator: the source of P3 and substrate connect V1, source and drain terminal and connect the drain terminal of N2 and the input of INV1, and the grid termination reference voltage of N2, source connect the anode of R2, R2 negativing ending grounding.The output of INV1 exports the first comparative voltage COMP1_V1.When there being V1 power supply to input, P3 source is pulled to high voltage, COMP1_V1 output low level; When V1 does not have power supply to input, P3 ends, and P3 source is pulled to ground by N2 and R2, and COMP1_V1 exports high level.
Second comparator is the value of benchmark voltage and V2, in comparator: the source of P4 and substrate connect V2, source and drain terminal and connect the drain terminal of N3 and the input of INV2, and the grid termination reference voltage of N3, source connect the anode of R3, R3 negativing ending grounding.The output of INV2 exports the first comparative voltage COMP2_V2.When there being V2 power supply to input, P4 source is pulled to high voltage, COMP2_V2 output low level; When V2 does not have power supply to input, P4 ends, and P4 source is pulled to ground by N3 and R3, and COMP2_V2 exports high level.
The operating current of reference circuit and comparator and the resistance of R1 ~ R3 are inversely proportional to, and consider that low-power consumption is applied, and can increase the resistance of R1 ~ R3 to mega-ohms.
Described control commutation circuit by first or door OR1, second or door OR2, NOR gate NOR, the 5th PMOS P5, the 6th PMOS P6 form; Two inputs of described NOR gate are connected with the output of the first comparator and the second comparator respectively, first or door have an input to be connected separately with the output of the first comparator and the second comparator respectively with second or door, another input all connects the output of NOR gate, the grid of described 5th PMOS, the 6th PMOS connects first or door and second or the output of door respectively, source class connects the first supply voltage and second source voltage respectively, leaks level and all connects power output end.
Such as the first supply voltage V1 has electricity, and second source voltage V2 does not power, the first comparator output low level, second comparator export high level, then first or door export high level, the 5th PMOS open, the 6th PMOS close.First supply voltage V1 does not power, and the situation that second source voltage V2 powers is similar, and when two power supplys have electricity, NOR gate exports.When two-way power supply Zhong You mono-road Power supply, the power supply having a road power supply output of input as circuit can be selected, when two-way all has power supply, NOR two inputs are low-voltage, export high level, make two or an output be high level, not output voltage.
In sum, output stage power selection circuit of the present invention, it is input as two supply voltages, export and select voltage can export the voltage having power supply to input in two input supply voltages, if two input supply voltages all in when having power supply to input, export and select voltage to close, avoid circuit communication to damage power supply, cause circuit working abnormal.Meanwhile, the present invention can also make the quiescent current of whole circuit less by the resistance arranging wherein resistance, reduces circuit power consumption, and it is wide that visible the present invention has input voltage range, and area is little, and structure is simple, advantage low in energy consumption.
Above-described embodiment only illustrates technical conceive of the present invention and feature, its objective is and is person skilled in the art can be understood content of the present invention and implement according to this, can not limit the scope of the invention with this.All equivalences done according to Spirit Essence of the present invention change or modify, and all should be encompassed within protection category of the present invention.