Abstract:
An electronic circuit comprising a comparator which is operated by a first power source voltage and having first and second input terminals, where the first input terminal is supplied with a reference voltage which is dependent on the first power source voltage, a detecting circuit for detecting a deviation of a second power source voltage and for outputting a control signal dependent on the deviation, where the first and second power source voltages undergo mutually independent deviations, and a voltage converting circuit supplied with an input signal for converting a voltage of the input signal depending on the control signal received from the detecting circuit. The voltage converting circuit supplies the input signal to the second input terminal of the comparator which outputs an error signal indicative of an error between the input signal voltage and the reference voltage.

Description:
This application is a continuation of application Ser. No. 08/072,874, filed Jun. 4, 1993 now abandoned, which is a continuation of application Ser. No. 07/844,923, filed Mar. 3, 1994, now abandoned, which is a continuation of application Ser. No. 07/397,834, filed Aug. 24, 1989, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     The present invention generally relates to electronic circuits, and more particularly to an electronic circuit which is especially suited for use with an input buffer circuit of an electronic device which carries out a digital signal processing in an automobile for example. 
     Recently, electronic devices control various parts of an automobile. For example, signals from various sensors are supplied to an electronic device of the automobile such as a control unit wherein a digital signal processing is carried out. In this case, there is a demand for the control unit to accurately read the signals from the various sensors and operating states of other processing circuits. 
     FIG. 1 shows an example of a conventional electronic circuit which is used in an automobile. A processing circuit 17 enters an output signal of a sensor 16. For example, the processing circuit 17 is an air conditioning system which drives a coil L1. An output signal of the processing circuit 17 is applied to a terminal 10 and is supplied to the coil L1 via transistors Q1 and Q2 which form a Darlington pair and a protection resistor R1. A control unit 11 controls a fuel injection quantity and the like of an engine (not shown). The control unit 11 has a terminal 12 which receives a voltage indicative of a driving state of the coil L1. The voltage received from the terminal 12 is supplied to a non-inverting input terminal of a comparator 13, and the control unit 11 carries out a control such as increasing an idling speed of the engine depending on an output signal of the comparator 13. The terminal 12 is supplied with a power source voltage +B from a battery 14 via the coil L1. For example, the power source voltage +B is +12 V. 
     The control unit 11 has the form of a semiconductor integrated circuit package, and is supplied with a power source voltage Vcc from the battery 14 via a regulator 18. For example, the power source voltage Vcc is +5 V. A reference voltage Vref which is obtained by dividing the power source voltage Vcc by a voltage divider made up of resistors R2 and R3 is supplied to an inverting input terminal of the comparator 13. The power source voltage +B from the battery 14 is also supplied to loads such as a light 15. 
     The reference voltage Vref is obtained by dividing the power source voltage Vcc. For this reason, when the power source voltage Vcc deviates, the reference voltage Vref undergoes a corresponding deviation and the deviation of the power source voltage Vcc is compensated thereby. 
     On the other hand, the signal voltage which is supplied to the terminal 12 is dependent on the power source voltage +B but a deviation of the power source voltage +B is unrelated to a deviation of the power source voltage Vcc as long as the deviation of the power source voltage +B is within a deviation range which can be compensated by the regulator 18. As a result, even when no signal change occurs at the terminal 10, there is a problem in that the control unit 11 may carry out an erroneous operation due to the deviation of the power source voltage +B. 
     In addition, the ground of the electronic circuit shown in FIG. 1 is a metal body (not shown) of the automobile and includes some resistance component. For this reason, when a switch SW closes and a large current flows through the load such as the light 15, an emitter potential of the transistor Q2 may rise. This potential rise corresponds to the deviation of the power source voltage +B and causes a problem similar to the above by changing the signal voltage at the terminal 12. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is a general object of the present invention to provide a novel and useful electronic circuit in which the problems described above are eliminated. 
     Another and more specific object of the present invention is to provide an electronic circuit comprising a comparator which is operated by a first power source voltage and having first and second input terminals, where the first input terminal is supplied with a reference voltage which is dependent on the first power source voltage, a detecting circuit for detecting a deviation of a second power source voltage and for outputting a control signal dependent on the deviation, where the first and second power source voltages undergo mutually independent deviations, and a voltage converting circuit supplied with an input signal for converting a voltage of the input signal depending on the control signal received from the detecting circuit. The voltage converting circuit supplies the input signal to the second input terminal of the comparator which outputs an error signal indicative of an error between the input signal voltage and the reference voltage. According to the electronic circuit of the present invention, it is possible to prevent the output error signal of the comparator from undergoing a deviation even when the first and second power source voltages change. Thus, the electronic circuit is especially suited for use in an automobile in which a battery is used to supply the second power source voltage. 
     Other objects and further features of the present invention will be apparent from the following detailed description when read in conjunction with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a circuit diagram showing an example of a conventional electronic circuit which is used in an automobile; 
     FIG. 2 is a system block diagram generally showing an electronic circuit according to the present invention for explaining an operating principle thereof; 
     FIG. 3 is a circuit diagram showing an embodiment of the electronic circuit according to the present invention; 
     FIG. 4 is a diagram for explaining a characteristic of the embodiment shown in FIG. 3; 
     FIGS. 5A and 5B are a top view and a circuit diagram respectively showing a regulator; 
     FIG. 6 shows a characteristic of the regulator shown in FIGS. 5A and 5B; and 
     FIG. 7 is a circuit diagram showing an essential part of a second embodiment of the electronic circuit according to the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 2 generally shows an electronic circuit according to the present invention for explaining an operating principle thereof. In FIG. 2, those parts which are essentially the same as those corresponding parts in FIG. 1 are designated by the same reference numerals. In FIG. 2, the comparator 13 is supplied with the power source voltage Vcc and is operated thereby. An input signal having a voltage which is different from the power source voltage Vcc but is dependent on the power source voltage +B is applied to a terminal 22. The reference voltage Vref which is obtained by dividing the power source voltage Vcc by a voltage divider made up of the resistors R2 and R3 is supplied to the inverting input terminal of the comparator 13. 
     On the other hand, a detecting circuit 21 detects a deviation of the power source voltage +B and supplies to a voltage converting element 20 a current which is dependent on the deviation of the power source voltage +B. The voltage converting element 20 reduces the voltage of the input signal depending on the current received from the detecting circuit 21, and an output voltage of the voltage converting element 20 is supplied to the non-inverting input terminal of the comparator 13. The comparator 13 compares the voltages supplied to the inverting and non-inverting input terminals thereof and outputs a digital signal via a terminal 23. 
     The power source voltage Vcc is used as the operating power source of the comparator 13 and is also used to generate the reference voltage Vref. For this reason, a deviation of the power source voltage Vcc is satisfactorily compensated. On the other hand, the input signal which is dependent on the power source voltage +B is reduced by the detecting circuit 21 and the voltage converting element 20 depending on a deviation of the power source voltage +B. Hence, the deviation of the power source voltage +B is also satisfactorily compensated. 
     Accordingly, the output signal of the comparator 13 is prevented from changing due to the deviations of the power source voltages Vcc and +B, and it is possible to effectively prevent an erroneous operation of the electronic circuit when it is used in an automobile. 
     Next, a description will be given of an embodiment of the electronic circuit according to the present invention, by referring to FIG. 3. In FIG. 3, those parts which are essentially the same as those corresponding parts in FIG. 1 are designated by the same reference numerals, and a description thereof will be omitted. 
     In FIG. 3, a resistor R IN  is connected between a node N1 which connects the resistor R1 and the coil L1 and a terminal 32 of a control unit 31. The resistor R IN  corresponds to the voltage converting element 20 shown in FIG. 2. A terminal 33 of the control unit 31 receives the power source voltage +B via a resistor R4. 
     The reference voltage Vref which is obtained by dividing the power source voltage Vcc by the voltage divider made up of the resistors R2 and R3 is supplied to the inverting input terminal of the comparator 13. The output signal of the comparator 13 is supplied to a circuit (not shown) which is in a next stage of the control unit 31. The power source voltage Vcc is obtained from the regulator 18 which stabilizes the power source voltage +B. 
     A cathode of a Zener diode D Z  is connected to the terminal 33. An anode of the Zener diode D Z  is connected to a base and a collector of a transistor Q3 and a base of a transistor Q4. The transistors Q3 and Q4 have identical emitter areas and emitters of these transistors Q3 and Q4 are grounded to constitute a current mirror circuit. A collector of the transistor Q4 is connected to the terminal 32. A circuit constituted by the resistor R4, the Zener diode D Z  and the transistors Q3 and Q4 corresponds to the detecting circuit 21 shown in FIG. 2. 
     For the sake of convenience, a voltage drop across the Zener diode D Z  is denoted by V P , a base-emitter voltage of the transistor Q3 in the ON state is denoted by V BE , and a stabilized voltage of the power source voltage Vcc is denoted by V D . In this case, V P  +V BE  is selected to a value which is slightly larger than V D . 
     In a state where +B&lt;V P  +V BE , no current flows to the resistor R 4  from a node N2 which has the potential +B and the transistors Q3 and Q4 are OFF. For this reason, no current flows to the resistor R IN  and a threshold value V TH1  of the comparator 13 can be described by the following formula (1). 
     
         V.sub.TH1 =Vcc×R3/(R2+R3)                            (1) 
    
     In a region where +B&lt;V P  +V BE , the regulator 18 cannot maintain the power source voltage Vcc stable and the power source voltage Vcc decreases with a decrease in the power source voltage +B. Hence, an indirect compensation is made with respect to a deviation of the power source voltage +B. 
     Next, in a normal operating state where +B≧V P  +V BE , a current I B  described by the following formula (2) flows through the resistor R4. 
     
         I.sub.B =(+B-V.sub.P -V.sub.BE)R4                          (2) 
    
     In other words, the current I B  changes proportionally to a change in the power source voltage +B. At the same time, a current I C  which is equal to the current I B  flows to the resistor R IN  by the operation of the current mirror circuit which is constituted by the transistors Q3 an Q4, and a potential at the terminal 32 drops by R IN  ×I C . This potential drop at the terminal 32 occurs depending on the deviation of the power source voltage +B. That is, the voltage drop across the resistor R IN  increases when the power source voltage +B rises and decreases when the power source voltage +B falls. Accordingly, a threshold voltage V TH2  of the comparator 13 can be described by the following formula (3) and the deviation of the power source voltage +B is compensated. 
     
         V.sub.TH2 =V.sub.TH1 +R.sub.IN ×I.sub.C              (3) 
    
     FIG. 4 shows a characteristic of the embodiment shown in FIG. 3. In FIG. 4, the X-axis indicates the power source voltage Vcc, the Y-axis indicates the power source voltage +B, and the Z-axis indicates a threshold voltage V TH  of the comparator 13. In a state where +B&lt;V P  +V BE , the threshold voltage V TH1  is located on a plane OABC and is dependent on the power source voltage Vcc. On the other hand, in a state where +B≧V P  +V BE , the threshold voltage V TH2  is located on a plane BCDE and is dependent on the power source voltages Vcc and +B. However, since Vcc is substantially constant in the range where +B≧V P  +V BE , the threshold voltage V TH2  in this state is substantially located on a line BE. 
     In the described embodiment, the Zener diode D Z  is used as a D.C. voltage source. However, it is of course possible to use other diodes which are connected in series and the like. In addition, the voltage shift quantity V P  of the D.C. voltage source is not limited to a positive value and may be selected to zero or a negative value. For example, in a case where the voltage shift quantity V P  is set to zero, no D.C. voltage source is required. 
     For example, a chip MB4001 manufactured by Fujitsu Ltd. of Japan may be used for the comparator 13. Further, a chip MB3752 manufactured by Fujitsu Ltd. of Japan may be used for the regulator 18. 
     FIG. 5A is a top view of the chip MB3752, and FIG. 5B shows a circuit construction of the chip MB3752, both with external elements connected thereto. The chip MB3752 is capable of dividing an internally generated reference voltage by use of externally connected resistors or the like and supplying the divided voltage to an internal operational amplifier. A required voltage is obtained by feeding back an output of the internal operational amplifier via an external resistor or the like and amplifying the output. 
     A reference voltage V R  due to a voltage drop V Z  of a Zener diode (transistor Q e ) and a base-emitter voltage V BE  of a transistor Q d  is generated at a terminal &#34;6&#34;. This reference voltage V R  is divided by external resistors Ra and Rb to obtain a voltage V R&#39; . This voltage V R&#39;  is applied to a terminal &#34;5&#34; and supplied to a non-inverting input terminal of the internal operational amplifier. An output of the internal operational amplifier is supplied to an output transistor Q f . An output of the output transistor Q f  obtained from a terminal &#34;10&#34; is applied to a terminal &#34;4&#34; and supplied to an inverting input terminal of the internal operational amplifier to stabilize the output voltage. An external resistor Rc is used to correct an offset caused by an input bias current of the internal operational amplifier. An external resistor Rd is used to protect the output transistor Q f . 
     In FIGS. 5A and 5B, the feedback signal is all applied to the internal operational amplifier and the gain is 0 dB. An output voltage V O  of the regulator 18 is V O  =V R  ×[Rb/(Ra+Rb)]. 
     FIG. 6 shows a relationship of the power source voltage +B and the output voltage V O  of the regulator 18. The output voltage V O  is determined by the Zener voltage V Z  of the Zener diode (transistor Q e ) and the base-emitter voltage V BE  of the transistor Q d . However, when the power source voltage +B decreases, the reference voltage V R  is clamped at a voltage which is lower than +B by a saturation voltage V CEsat  of a transistor Q a  and a sum of base-emitter voltages V BE  of transistors Q b  and Q C . In other words, the reference voltage V R  decreases proportionally to the power source voltage +B when +B≦V x , where V x  =V BE  (Q d )+V z  (Q e )+V BE  (Q c )+V BE  (Q b )+V CEsat  (Q a ). Accordingly, the output voltage V O  which is obtained by dividing the reference voltage V R  also decreases proportionally to +B when +B≦V x . 
     Next, a description will be given of another embodiment of the electronic circuit according to the present invention, by referring to FIG. 7. In FIG. 7, those parts which are the same as those corresponding parts in FIG. 3 are designated by the same reference numerals, and a description thereof will be omitted. 
     In FIG. 7, a circuit part constituted by transistors Q5 through Q7 and resistors R5 and R6 is used in place of the Zener diode D Z  of the embodiment described before. The base voltage V Q5B  of the transistor Q5 can be described by V Q5B  =(V CC  -V BE )×R6/(R5+R6), where V BE  is the base emitter voltage of the transistor Q5. In this embodiment, it is possible to vary a voltage at which the threshold voltage starts to become dependent on the power source voltage +B by varying a ratio of the resistances of the resistors R5 and R6. This is because the current I B  can be described by the following formula (4), where it is assumed that the base-emitter voltages V BE  of the transistors Q3 through Q7 are the same. That is, since a voltage (+B-V Q6E ) is applied across the terminals of the resistor R4, the current I B  is as follows: I B  =(+B-V Q6E )R4 
     
         I.sub.B =+B[(Vcc-V.sub.BE)×R6/(R5+R6)+V.sub.BE ]/R4  (4) 
    
     Thus, the transistor Q6 is provided to obtain an emitter potential which is approximately the same as the emitter potential of the transistor Q5. Because, however, the collector of the transistor Q6 is connected to the base of the transistor Q7, the current flowing between the emitter and collector of the transistor Q6 is not the same as the current flowing between the emitter and collector of the transistor Q5. That is, the base-emitter voltage V BE  of the transistor Q5 and the base-emitter voltage V BE  of the transistor Q6 are not exactly equal, but the difference between the two base-emitter voltages V BE  is negligible from a practical standpoint. Therefore, the base-emitter voltage V BE  of the transistor Q5 is assumed to be the same as the base-emitter voltage V BE  of the transistor Q6. 
     Further, the present invention is not limited to these embodiments, but various variations and modifications may be made without departing from the scope of the present invention.