Abstract:
A stable voltage that is independent of supply voltage is applied to a pair of current sources. A first current source generates a first current that passes through a first resistor, setting a compare-input voltage. A source-input voltage is applied to the first current source to vary the first current and the compare-input voltage. A second current source generates a stable current that passes through a second resistor, setting a reference voltage. The compare-input voltage and the reference voltage are applied to inputs of a comparator that generates an output voltage that indicates when the source-input voltage causes the compare-input voltage to rise past the reference voltage. The first and second currents track each other over temperature and process variations and are independent of supply voltage. A more accurate comparison of the source-input voltage is thus made.

Description:
RELATED APPLICATION 
   This application is a divisional of U.S. Ser. No. 10/605,534, filed Oct. 6, 2003, now U.S. Pat. No. 6,940,318. 

   FIELD OF THE INVENTION 
   This invention relates to comparator circuits, and more particularly to voltage-to-current converters. 
   BACKGROUND OF THE INVENTION 
   Semiconductor chips such as complementary metal-oxide-semiconductor (CMOS) integrated circuits (IC&#39;s) sometimes perform voltage-sensing. An input voltage from some source is sensed to generate an output voltage. A voltage comparator is often used to sense the input voltage. The voltage comparator compares the input voltage to a reference voltage and generates the output voltage in a high state when the input voltage is higher than the reference voltage, and generates the output voltage in a low state when the when the input voltage is less than the reference voltage. 
     FIG. 1  shows a typical voltage-sensing circuit with a source follower and an operational amplifier. Input source  10  is an internal or external voltage source that generates voltage Vp which is applied to the gate of n-channel transistor  14 . Input voltage Vin is generated from voltage Vp using a voltage source follower that includes n-channel transistor  14  and resistor  12  in series. 
   N-channel transistor  14  and resistor  12  in series form a source follower between the positive voltage supply Vdd and ground. Operational amplifier or comparator  16  is configured as a non-inverting comparator. Reference voltage Vref is a reference voltage connected to the negative input of comparator  16 . Input voltage Vin is connected to the positive (non-inverting) input (+) of comparator  16 . 
   When voltage source  10  is changing from low to high, Vin follows Vp from low to high. As Vin rises to a voltage potential greater than Vref, the output Vo of comparator  16  switches from a low voltage to a high voltage. When Vin drops below the reference voltage Vref, the output Vo of comparator  16  switches from a high voltage to a low voltage. 
   In the circuit of  FIG. 1 , Vin always follows Vp as the input voltage source changes. N-channel transistor  14  acts as a source-follower that level-shifts Vp to generate input voltage Vin. Voltage Vp from input source  10  activates n-channel transistor  14 , level-shifting Vin by a the gate-to-source voltage Vgs of at least a threshold Vt to be at a lower voltage than Vp. 
   The actual threshold voltage value of Vt varies due to changes in operating conditions such as voltage-supply, temperature, and fabrication process. As the voltage shift across n-channel transistor  14  changes with conditions, the cross-over point of Vin and Vref also changes with operating conditions. As a result, the point at which Vp is detected and output Vo switches can vary and is not accurate. 
     FIG. 2  shows a comparator with a resistor voltage divider. Resistors  24 ,  22  are in series between voltage Vp and ground, and generate input voltage Vin at their midpoint. When input source  20  causes voltage Vp to change from low to high, Vin follows Vp from low to high. As Vin rises to a potential greater than Vref, the output Vo of comparator  26  switches from a low voltage to a high voltage. When Vin drops below the Vref voltage value, the output Vo of comparator  26  switches from a high voltage to a low voltage. 
   The resistor voltage divider of resistors  24 ,  22  act as a voltage level shifter. Resistor voltage dividers are not affected as significantly as transistors by different operating conditions such as changes in temperature, fabrication process, and varying levels of supply voltage Vdd. The circuit of  FIG. 2  has an input voltage Vin that more accurately follows changes in Vp. However, such voltage dividers consume power. The current available from input source  20  may be too weak to power a voltage divider so this circuit is not a good solution for some applications. 
   Comparator output Vo switches polarities when Vin rises or falls past the Vref voltage value. However, this method of sensing input voltages is not accurate due to variables that affect the comparator circuitry, such as process, temperature, supply voltage, and operating frequency. Accuracy may be worse when the input voltage is double or triple the device power supply Vdd. In this case the reference voltage Vref and input voltage Vin do not track each other as accurately, causing output signal Vo to switch polarities at different voltage cross-points. 
   What is desired is a more accurate voltage sensor. A circuit that more accurately compares an input voltage to a reference voltage is desired. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
       FIG. 1  shows a typical voltage-sensing circuit with a source follower and an operational amplifier. 
       FIG. 2  shows a comparator with a resistor voltage divider. 
       FIG. 3  is a comparator circuit with matched current for an input and a reference. 
       FIG. 4  shows two branches of current-mirrored currents to a comparator. 
       FIG. 5  is a circuit that uses a substrate connection to sense the input voltage. 
       FIG. 6  is a graph of Vin and Vref for the circuit of  FIG. 4 . 
       FIG. 7  is a graph of Vin and Vref for the circuit of  FIG. 5 . 
   

   DETAILED DESCRIPTION 
   The present invention relates to an improvement in voltage sensors. The following description is presented to enable one of ordinary skill in the art to make and use the invention as provided in the context of a particular application and its requirements. Various modifications to the preferred embodiment will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed. 
   The inventor has realized that a better method of detecting changes to input voltages is to detect changing input currents that are independent of the supply voltage. Currents for the input and the reference can track each other as changes due to temperature, process, or supply voltage occur. Thus changes from temperature, process, and supply tend to cancel out in the two currents. 
     FIG. 3  is a comparator circuit with matched current for an input and a reference. Voltage generator  36  can be a band-gap reference voltage or a pad that receives a stable voltage. Voltage generator  36  outputs a relatively constant voltage Vbg to supply power to current sources  31 ,  34 . The currents flowing through current sources  31 ,  34  are thus independent of the circuit power supply voltage Vdd. 
   Each branch acts as a voltage-to-current (V2C) converter. Input voltage Vp is converted to a first current through current source  31  and resistor  32 . This first current sets Vin. The stable voltage Vbg, or another stable voltage such as ground, is converted to a second current flowing through current source  34  and resistor  35 . This second current sets Vref. Both the first and second currents are independent of supply voltage Vdd, since current sources  31 ,  34  are connected to voltage Vbg. 
   Current flows from current sources  31 ,  34  through resistors  32 ,  35  to ground. Input voltage Vin to the non-inverting (+) input of comparator  33  is generated between current source  31  and resistor  32 , while reference voltage Vref to the inverting (−) input of comparator  33  is generated between current source  34  and resistor  35 . Vref is a fixed voltage because the current flowing through resistor  35  from current source  34  remains relatively constant. 
   Input voltage Vp from input source  30  controls current source  31 . When Vp changes from a low voltage to a high voltage, the current generated by current source  31  increases from a low value to a higher value. The current flowing through resistor  32  induces a voltage potential Vin on the positive input of comparator  33 . Input voltage Vin follows Vp, changing from low to high and from high to low but at a voltage value lower than Vp. When Vin increases to a voltage greater than Vref, the output Vo of comparator  33  switches from a low voltage to a high voltage. When Vin decreases to a voltage less than Vref, the output Vo of comparator  33  switches from a high voltage to a low voltage. 
   There are two equal current branches that are constant current sources. Current source  31  and resistor  32  form one branch while current source  34  and resistor  35  form the other branch. Each branch is designed with the same circuit scheme and same type of components. The voltage parameters of these two branches track each other as temperature and fabrication process change. As circuit conditions vary due to temperature or process, the voltage-sensitive parameters on each input to comparator  33  drift up or down together in the same direction. Using constant current sources allows this circuit to sense input voltage Vp more accurately. Two implementations of the constant current sources and the voltage sensing circuitry are illustrated in more detail in  FIG. 4  and  FIG. 5 . 
     FIG. 4  shows two branches of current-mirrored currents to a comparator. One branch of the constant current source includes p-channel transistors  49 ,  44  and n-channel transistor  50 . P-channel transistor  44  has its gate connected to the gate and drain of p-channel transistor  49  to mirror the current through transistors  49 ,  50 . The drain of p-channel transistor  44  outputs reference voltage Vref and supplies current to resistor  45  to generate Vref. 
   The other branch of the constant current source includes p-channel transistors  47 ,  41  and n-channel transistor  48 , which supply current to resistor  42  to generate input voltage Vin. Current through p-channel transistor  47  is mirrored to p-channel transistor  41 . 
   These two branches have the same functions as described in  FIG. 3 . Constant voltage generator  46  supplies voltage Vbg to the source and N-well of p-channel transistors  47 ,  41 ,  49 ,  44 . The gate of n-channel transistor  50  in the reference branch is also connected to constant voltage Vbg. 
   The two current-source pairs (p-channel transistors  47 ,  41  and  49 ,  44 ) in  FIG. 4  operate in a similar manner. Input voltage Vp from input source  40  is applied to the gate of n-channel transistor  48 , increasing or decreasing its current drive or transconductance as the gate voltage Vp changes. The input current source pair of p-channel transistors  47 ,  41  remain at a higher impedance as long as n-channel transistor  48  is off or conducting a low current. 
   When Vp rises from a low to a higher voltage, n-channel transistor  48  turns on more strongly and more current begins to flow through p-channel transistor  47  and this increased current is mirrored to p-channel transistor  41  since they share gate-to-source voltages. As Vp rises, p-channel transistor  41  outputs a larger current that flows through resistor  42  and generates a higher Vin. Thus the voltage value of Vin follows changes to input voltage Vp but at a lower value than Vp. When Vin rises above the value of Vref, the output Vo of comparator  43  switches from a low voltage (or ground) to a higher voltage. The current source pair of p-channel transistors  49 ,  44  generates a continuous output current that flows through resistor  45  to create a constant Vref. 
   The source of power, band-gap voltage Vbg, for these elements is independent of the power supply voltage Vdd. Since Vbg is constant, reference currents from p-channel transistors  47 ,  41 ,  49 , and  44  are also constant. Each of these current sources are made of the same type of components and circuit scheme so they will operate in exactly the same way under difference operating conditions. Resistors  42 ,  45  are made of the same type of material so temperature changes of the resistors do not affect the relative value of Vin and Vref. When variances in temperature or fabrication process cause circuit parameters to drift, the output from these circuits drifts up or down together. The result is that Vin and Vref always track one another regardless of temperature or process variations. 
     FIG. 5  is a circuit that uses a substrate connection to sense the input voltage. This version of the circuit scheme described in  FIG. 3  takes advantage of the body effect (Substrate Bias Effect) of a MOSFET. In this example the current source branches of the circuit are connected to different inputs of comparator  63 . The reference current source has p-channel transistor  64  that supplies current that flows through resistor  65  to produces the constant reference voltage Vref at the drain of p-channel transistor  64 . Reference voltage Vref is connected to the non-inverting (positive) input of comparator  63 . A second current source has p-channel transistor  61  that supplies current flowing through resistor  62  to generate input voltage Vin. Vin is connected to the inverting (negative) input of comparator  63 . 
   Input voltage Vp is generated from input source  60  and is connected to the bulk node or N-well substrate contact of p-channel transistor  61 . Due to the body effect characteristic the circuit in  FIG. 5  operates inversely to the circuit described in  FIG. 4 . When input voltage Vp changes from low to high, the threshold voltage of p-channel transistor  61  increases (becomes more negative). This causes the current flow through p-channel transistor  61  and resistor  62  to decrease, which lowers the voltage level of Vin. When Vin becomes lower than the value of Vref, the output Vo of comparator  63  switches from a low voltage to a high voltage. 
   When input voltage Vp changes from high to low, the threshold of p-channel transistor  61  decreases (absolute value becomes smaller) and the current flow through p-channel transistor  61  and resistor  62  increases. When this occurs, Vin increases to a value greater than Vref and the output Vo of comparator  63  switches back to a low voltage. 
   The reference current source has p-channel transistor  64  with its gate connected to ground and its source and N-well substrate connected to constant voltage Vbg. Because voltage generator  66  is independent of the supply voltage Vdd, the current through the p-channel current sources is constant. Vref and Vin track one another in the same direction even if there are changes in circuit parameters due to variances in operating temperature or fabrication process. Since resistors  62 ,  65  use the same type of material, the ratio of these two resistors remains the same regardless of temperature or fabrication process changes. These factors permit the values of Vin and Vref to consistently drift proportionally in the same direction so that the value of Vp is sensed accurately. The value of Vbg is about 2.5 v, or 0.5 v below the minimum Vdd=3 v, in one example. 
     FIG. 6  is a graph of Vin and Vref for the circuit of  FIG. 4 . The x-axis shows voltage Vp while the y-axis shows voltages of Vref and Vin as Vp is swept from ground to 7 volts. 
   At room temperature and with a typical process, reference voltage Vref 2  is set at about 0.64 volt, as shown by horizontal line  72 . When Vp is swept from 0 to 7 v, input voltage Vin 2  (curve  78 ) follows Vp and rises from 0 to about 0.72 v. The cross-over point of line  72  and curve  78  is at Vp=5 v. Once Vin 2  crosses over this point, comparator  43  switches and drives output signal Vo high. 
   At low temperature such as at negative 40 degrees C. and best process conditions, both reference voltage Vref 1  (line  70 , about 0.91 v) and input voltage Vin 1  (curve  76 ) drift upward. The cross-over point is at Vp=5.2 v, which is just 4% higher than the typical value (intersection of line  72  and curve  78 ). At high temperature (85 degree C.) and worst process conditions, both reference voltage Vref 3  (line  74 , about 0.48 v) and input voltage Vin 3  (curve  80 ) are drifting down, keeping the cross-over point of line  74  and curve  80  at Vp=4.9 v which is only 2% lower than its typical value. Thus the range of cross-over points is from 4.9 to 5.2 volts (within +/−4%) as temperature and process are varied. 
     FIG. 7  is a graph of Vin and Vref for the circuit of  FIG. 5 . The x-axis shows voltage Vp while the y-axis shows voltages of Vref and Vin as Vp is swept from ground to 10 volts. 
   At room temperature and with a typical process, reference voltage Vref 2  is set at about 0.92 volt, as shown by horizontal line  84 . When Vp is swept from 0 to 110 v, input voltage Vin 2  (curve  90 ) decreases from 2.2 volts to about 0.5 v. The cross-over point of line  84  and curve  90  is at Vp=8 v. Once Vin 2  crosses over this point, comparator  63  switches and drives output signal Vo high. 
   At low temperature such as at negative 40 degrees C. and best process conditions, both reference voltage Vref 1  (line  82 , about 1.46 v) and input voltage Vin 1  (curve  92 ) drift upward. The cross-over point is at Vp=8.6 v, which is 7.5% higher than the typical value (intersection of line  84  and curve  90 ). At high temperature (85 degree C.) and worst process conditions, both reference voltage Vref 3  (line  86 , about 0.6 v) and input voltage Vin 3  (curve  88 ) are drifting down, keeping the cross-over point of line  86  and curve  88  at Vp=7.6 v which is only 5% lower than its typical value. Thus the range of cross-over points is from 7.6 to 8.6 volts (within +/−8%) as temperature and process are varied. 
   ALTERNATE EMBODIMENTS 
   Several other embodiments are contemplated by the inventor. For example the two branches can use the same size devices or could use different sizes to adjust the cross-over voltage points. Transistors may have several legs or may have unusual geometries such as doughnut rings. Resistors may be made from N-well, polysilicon, or other resistive material. A variety of circuits may be used to generate the stable voltage Vbg, such as a band-gap reference circuit. The resistors could be implemented as transistors with gates connected to a fixed bias voltage or connected as a diode (gate and drain tied together). The substrate or bulk node could be an N-well or a P-well with a n-type substrate or region such as an oxide-isolated n-type tub. The comparator may be powered by the VDD supply voltage. The voltage generator, such as a band-gap voltage generator, or voltage generator  66  of  FIG. 5 , may generate a stable voltage on the stable node that is independent of the supply voltage to the comparator. 
   The abstract of the disclosure is provided to comply with the rules requiring an abstract, which will allow a searcher to quickly ascertain the subject matter of the technical disclosure of any patent issued from this disclosure. It is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims. 37 C.F.R. § 1.72(b). Any advantages and benefits described may not apply to all embodiments of the invention. When the word “means” is recited in a claim element, Applicant intends for the claim element to fall under 35 USC § 112, paragraph 6. Often a label of one or more words precedes the word “means”. The word or words preceding the word “means” is a label intended to ease referencing of claims elements and is not intended to convey a structural limitation. Such means-plus-function claims are intended to cover not only the structures described herein for performing the function and their structural equivalents, but also equivalent structures. For example, although a nail and a screw have different structures, they are equivalent structures since they both perform the function of fastening. Claims that do not use the word “means” are not intended to fall under 35 USC § 112, paragraph 6. Signals are typically electronic signals, but may be optical signals such as can be carried over a fiber optic line. 
   The foregoing description of the embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto.