Abstract:
A comparator comprises a switching means for supplying two different threshold voltages to the comparator upon a first and a second control signal, respectively. The second control signal is enabled by a rising or a falling edge of the comparator output that is coupled to a control means providing the second control signal. The time interval that a varying input signal requires to change its amplitude crossing and in between the two threshold voltages can thus be detected by two subsequent rising or falling edges of the comparator output without the adverse influence of the comparator&#39;s meta-stability.

Description:
BACKGROUND OF THE INVENTION  
         [0001]    1. Field of the Invention  
           [0002]    The present invention relates to an electronic comparator device, more specifically to a window comparator, used to determine a time interval in which an input signal varies between a first threshold voltage and a second threshold voltage. Moreover, the present invention relates to a window comparator for determining an inherent time constant (RC constant) of an analog integrated circuit, such as an analog electronic filter circuit.  
           [0003]    2. Background of the Invention  
           [0004]    In many electronic applications an input signal having an amplitude that varies in time needs to be compared with a predefined threshold voltage, wherein an electronic device provides an output signal to indicate whether the input signal is higher or lower than the threshold voltage. Typically, a common operational amplifier without negative feedback, or especially designed amplifiers, so-called analog comparators, are used to detect the point in time when a varying input signal exceeds the predefined threshold value.  
           [0005]    Any conventional analog comparator (hereinafter simply referred to as comparator), however, exhibits offset and timing errors, when no additional offset calibration, pre-charging and/or sampling architecture is provided. The offset error of the comparator is primarily caused by a static input offset voltage and a variable offset voltage that depends on the applied input voltage and the threshold voltage supplied to the comparator. The timing error of the comparator, i.e., the delay between the point in time when the input signal actually crosses the threshold voltage and the point in time when a change of the comparator&#39;s output finally indicates the crossover of the input signal and the threshold voltage, is caused by time delays of the electronic circuit, for example, by the rise and fall times of the output node(s) of the comparator, and a so-called meta-stability or hysteresis of the comparator that occurs for a small difference of the input signal and the threshold voltage. The range/time of the meta-stability also depends on the direction in which the input signal crosses the threshold voltage.  
           [0006]    Comparators are frequently used in applications where an analog input signal is compared with a linearly varying threshold voltage to determine a time interval from a defined start value of the threshold voltage to the point in time when the threshold voltage equals the input signal. The time interval, for example determined by means of a counter that is triggered by the comparator output, may then be used as a digital measure for the analog signal, for instance in form of the counter value. Such a single slope measurement, however, will entrain a large conversion error due to the timing and offset errors described above. Accordingly, additional circuitry for obtaining precise results in a single slope measurement using a comparator is required, thereby contributing to circuit complexity and increasing of manufacturing cost.  
           [0007]    An increased circuit complexity is even more disadvantageous when the comparator is a part of an analog integrated circuit that is additionally provided with the comparator circuitry for compensating for parameter variations of the analog integrated circuit. For example, in analog filter circuits the capacitances and the resistances may vary up to 50% due to tolerances in the manufacturing process and/or temperature variations during operation. To precisely adjust the current filter response to the desired design value, the actual RC time constant has to be determined by means of, for example, an on-chip comparator circuitry comparing a rising voltage with two threshold voltages (this type of comparator circuit is also referred to as a window comparator), so as to readjust the filter circuit to the required design value.  
           [0008]    In view of the above problems, a need exists for an improved comparator circuit capable of performing a single slope measurement with high precision.  
         SUMMARY OF THE INVENTION  
         [0009]    According to one embodiment, a comparator circuit for time-critical applications in which an amplitude of an input signal crosses a first threshold voltage and a second threshold voltage, comprises comparator means having a first input terminal receiving the input signal, a second input terminal and an output terminal. The comparator circuit further comprises switching means having a first switch input receiving the first threshold voltage, a second switch input receiving the second threshold voltage, a switch output connected to the second input terminal of the comparator means, and a switch control input, wherein the switching means connects the first switch input with the switch output upon receipt of a first control signal at the switch control input, and connects the second switch input with the switch output upon receipt of a second control signal at the switch control input. Moreover, the comparator circuit comprises control means having a reset input receiving a reset signal, a trigger input connected to the output terminal of the comparator means and a control output connected to the switch control input, wherein the control means supplies the first control signal to the switch control input upon receipt of the reset signal, and wherein the control means supplies the second control signal to the switch control input upon receipt of one of a rising edge and a falling edge of a signal at the trigger input that is provided by the output terminal of the comparator means.  
           [0010]    According to a further embodiment method of determining a time interval in which an input signal changes its amplitude between a first threshold voltage and a second threshold voltage is provided. The method comprises supplying the input signal to a first input of a comparator, and supplying the first threshold voltage to a second input of the comparator, wherein the comparator changes its output state when the input signal crosses the first threshold voltage. The method also includes supplying, upon the changing of the output state of the comparator, the second threshold voltage to the second input of the comparator such that one of subsequent rising edges and falling edges of the comparator output represent said time interval.  
           [0011]    Also contemplated is a comparator circuit having switchable threshold voltages to provide a window function of the comparator. The switch is controlled by a control means, such as a flip-flop, that is inserted as a “digital feedback” means between the comparator output and the switch control input. The control means is triggered by the output of the comparator when the input signal crosses the first threshold voltage to couple the second threshold voltage to the comparator. The comparator, correspondingly reset, can detect the point in time when the input voltage crosses the second threshold voltage with substantially the same rise or fall time. The second detection, i.e., the crossing of the second threshold voltage, sets the output of the comparator with substantially the same delay caused by the meta-stability of the comparator as in the previous detection of crossing the first threshold voltage. Since the delay for setting the comparator output is approximately the same for the first and second detection, the time interval is determined by two subsequent falling and rising edges, respectively, depending on the type of comparator used.  
           [0012]    The comparator circuit in accordance with one embodiment may be particularly useful when determining a time interval required to charge a capacitor with a constant current in order to estimate the capacitance of the capacitor.  
           [0013]    Moreover, the comparator circuit according to this embodiment may advantageously be employed in combination with a circuit having an inherent RC time constant to determine the RC time constant, which may be caused by tolerances during the fabrication and/or by variations of the environmental conditions during operation of the device, such as temperature, pressure, and/or humidity. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0014]    Further advantages, objects and embodiments objects of the present invention will become more apparent with the appended claims and the following detailed description when taken with reference to the accompanying drawings in which:  
         [0015]    [0015]FIG. 1 a  is a schematic illustrating one embodiment of a circuit;  
         [0016]    [0016]FIG. 1 b  is a timing chart depicting an output signal of a comparator means shown in FIG. 1 a;    
         [0017]    [0017]FIG. 2 is a circuit diagram illustrating an embodiment for measuring an RC time constant; and  
         [0018]    [0018]FIG. 3 is a circuit diagram of a portion of a constant current source used in the embodiment of FIG. 2. 
     
    
     DETAILED DESCRIPTION  
       [0019]    While the present invention is described with reference to the embodiments as illustrated in the following detailed description as well as in the drawings, it should be understood that the following detailed description as well as the drawings are not intended to limit the present invention to the particular embodiments disclosed, but rather the described embodiments merely exemplify various aspects of the present invention.  
         [0020]    [0020]FIG. 1 a  shows one embodiment of a circuit  100 . In FIG. 1 a,  a comparator circuit  100  comprises a comparator means  101 , hereinafter simply referred to as comparator, which may be any conventional comparator known in the art. The comparator  101  has an output terminal  102 , a first input terminal  103  and a second input terminal  104 . A switching means  108  having a first switch input  109 , a second switch input  110 , a switch output  111  and a switch control input  112  is connected, with its switch output  111 , to the second input terminal  104 . A control means  115 , such as a flip-flop, having a trigger input  105 , a reset input  106  and a control output  107  is operatively inserted between the output terminal  102  and the switch control input  112 , wherein the trigger input  105  is connected to the output terminal  102  and the control output  107  is connected to the switch control input  112 .  
         [0021]    In operation, the reset input  106  receives, from an external source (not shown), a reset signal, for example a pulse signal, that enables a first control signal, for example a digital low-level signal, to cause the switching means  108  to connect the first switch input  109  with the switch output  111 . A first threshold voltage V T1  applied to the first switch input  109  is then supplied to the second input terminal  104  of the comparator  101  in response to the first control signal. The first input terminal of the comparator  101  receives an input signal that may have a rising signal portion with a substantially constant slope. When the rising edge of the input signal crosses the first threshold voltage V T1  the output terminal  102  of the comparator  101  will change its output state, for example, from low level to high level, with a time delay that depends on inherent comparator characteristics, such as the meta-stability of the comparator  101 . The meta-stability is primarily determined by the input voltage overdrive and the memory effect or charge and discharge time caused by a preceding saturation of the input stage amplifier of the comparator  101 .  
         [0022]    In FIG. 1 b,  the event when the rising input signal actually crosses the first threshold voltage V T1  is indicated by the point in time t 1 , whereas the point in time of the change of the output terminal  102  is indicated by t 2 . Consequently, the difference of t 1  and t 2  amounts to the inherent delay, i.e., the meta-stability, of the comparator  101 .  
         [0023]    Again referring to FIG. 1 a,  the rising edge of the comparator&#39;s output signal is supplied to the trigger input  105  and causes the control means  115  to emit a second control signal. In the present embodiment the control means  115  is a flip-flop that is set in response to the rising edge of the comparator output signal. The control output  107  then delivers the second control signal, for example a digital high-level signal, to the switch control input  112  to cause the switching means  108  to supply a second threshold voltage, which is applied to the second switch input  110  and which is higher than the first threshold voltage, to the second input terminal  104  of the comparator  101 . Since the input signal is now lower than the second threshold voltage; the output terminal  102  of the comparator  101  returns to its initial state, in the present embodiment a low-level state.  
         [0024]    In FIG. 1 b,  the output voltage drop of the comparator  101  to the initial low-level state is indicated by t 3 , wherein a difference of t 2  and t 3  represents the entire amount of the signal delay caused by the control means  115 , the switching means  108  and the comparator  101 . When the input signal reaches the value of the second threshold voltage VT 2 , indicated by t 4 , the comparator  101  will again change its output state at a point in time indicated by t 5  with a time delay caused by the inherent characteristics of the comparator  101  as previously discussed. Since the slope of the input signal between t 1  and t 2  is selected to be substantially constant, the delays t 2 -t 1  and t 5 -t 4  due to the inherent characteristics of the comparator, such as the meta-stability, are substantially equal. As a result, the time interval Δt=t 4 −t 1  is given by the time interval between the two subsequent rising edges at the output terminal  102  of the comparator  101 , wherein the adverse influence of the meta-stability of the comparator  101  is eliminated.  
         [0025]    As a result, the comparator circuit  100  according to the embodiment, explained with reference to FIGS. 1 a  and  1   b,  allows a single slope measurement with high precision using a minimal number of conventional electronic devices. The detection of the two threshold voltages with the same comparator and the absence of a swap of the threshold input with the signal input eliminates the impact of a DC offset voltage which is introduced by a device mismatch or an input mismatch. Moreover, the comparator circuit, although described with discrete devices, may in a further embodiment be incorporated into an integrated circuit, allowing integration of the comparator circuit with a minimum of chip area and circuit complexity so that the comparator circuit can readily be combined with other circuitries that may require the determination of, for example, inherent capacitances, RC time constants, and the like. Furthermore, in a further embodiment the comparator output signal may be inverted so that a falling edge is used for determining the time interval. Similarly, a falling input signal rather than a rising input signal may be used in combination with a first threshold voltage V T1  being higher than the second threshold voltage V T2  to obtain the same advantage. Likewise, the first and second control signals, hereinbefore described as a low-level signal and a high-level signal, respectively, may be any signals appropriate for actuating the switching means.  
         [0026]    Moreover, in one embodiment, instead of a flip-flop as the control means, any combination of analog devices and/or digital gates, which may be referred to as a state machine, can be used as long as a falling or a rising edge of the comparator&#39;s output signal causes the provision of the second control signal.  
         [0027]    With reference to FIGS. 2 and 3 a further embodiment is described in which a comparator circuit as explained above is employed to determine an RC time constant for a capacitor C T  and a resistor R T  of interest.  
         [0028]    In FIG. 2, an RC time constant measurement circuit  200  comprises a comparator circuit  100 , as described with reference to FIG. 1 a.  For simplicity all components of the comparator circuit  100  are denoted by the same reference numerals as in FIG. 1 a  and an explanation thereof is omitted. The RC time constant measurement circuit  200  further comprises a constant current source  201  that provides a current of amount I T  at a first output  202  and at a second output  203 . A first electrode of the capacitor C T  is connected to the first output  202 , and a second electrode is connected to a reference potential, such as ground potential. The first electrode of the capacitor C T  is also connected to the first input terminal  103 . The resistor R T  has a first terminal that is connected to the second output  203  of the constant current source  201  and to the second switch input  110 . A second terminal of the resistor R T  is connected to the first switch input  109  and to a first terminal of a resistor R X  a second terminal of which is connected to the reference potential. Moreover, a second switching means  204  having a reset input connected to the reset input  106  of the control means  115  is operatively coupled to the capacitor C T  so as to short the first and second electrodes of the capacitor C T  and to break the short upon receipt of the reset signal.  
         [0029]    In operation, application of the reset signal to the second switching means  204  and the control means  115  disconnects the first and the second electrodes of the capacitor C T  from each other and causes the control means  115  to output the first control signal to the switching means  108 . The constant current I T  leads to a voltage drop V R  across the resistor R T  and, thus, provides the first and second threshold voltages V T1  and V T2  according to the relationship: V R =V T2 −V T1 . The constant current I T  charges the capacitor C T  and the voltage across the capacitor is linearly increasing. A time interval t RC  required for charging the capacitor C T  to the voltage V R  is then dependent on the capacitance C T  (for convenience, the capacitor and its capacitance are denoted by the same reference sign) and the constant current I T  according to the equation: 
         t RC =C T V R /I T .  
         [0030]    Substituting the constant current I T  by V R /R T  yields for t RC : t RC =R T C T .  
         [0031]    Hence, the RC time constant of the capacitor C T  and the resistor R T  can be determined by detecting the points in time when the voltage V T  crosses the first threshold voltage V T1  and the second threshold voltage V T2 . The procedure for determining the time interval by means of the comparator circuit  100  may be the same as that described with reference to FIGS. 1 a  and  1   b.    
         [0032]    With reference to FIG. 3 the arrangement and the operation of the constant current source  201  is described in more detail.  
         [0033]    [0033]FIG. 3 is a circuit diagram illustrating a portion of the constant current source  201 . A non-inverting input of an operational amplifier  301  having an output coupled to the gate of a transistor T, in this example a p-channel transistor, is connected to one terminal of a reference voltage source  302 . The other terminal of the reference voltage source  302  is connected to the positive supply voltage Vcc. One terminal of a resistor R I  is connected to Vcc, and the other terminal of the resistor R I  is connected to the drain of transistor T. The inverting input of the operational amplifier  301  is connected to the drain of transistor T to form a feedback loop, while the source of transistor is connected to the resistor R T  (not shown in FIG. 3) to provide the current I T .  
         [0034]    In operation, the reference voltage source  302  may be adjusted to half of the supply voltage Vcc, however, any other value is also appropriate as long as the circuit can work properly. The connection of the source of transistor T with the inverting input of the operational amplifier  301  controls the output and, thus, the transistor T so as to adjust the voltage at the transistor&#39;s voltage to be equal to the reference voltage, i.e., Vcc/2 in the present example. Accordingly, the current I T  is defined by the resistor R I  and the reference voltage Vcc/2. To limit the voltage swing at the source of transistor T, which is necessary to drive the current I T  through the resistors R T  and R X  of the RC time constant measurement circuit  200 , to Vcc/2, the resistor R I  at least has to be equal to the sum of R T  and R X .  
         [0035]    In the present embodiment R X  and R I  are selected to be substantially equal to 2/7 R T  and substantially equal to 9/7 R T , respectively. Thus, the maximum voltage at the second input  104  of the comparator  101 , i.e., the source of the transistor T, is equal to Vcc/2 and any possible overdrive of the input amplifier of the comparator  101  may be avoided, thereby reducing a variation of the meta-stability of the comparator, as previously described. Moreover, the constant current source  201  may comprise a second portion that is substantially identical to that shown in FIG. 3 to provide the current I T  to the capacitor C T , or any other conventional constant current source, or a current mirror may additionally be provided.  
         [0036]    Furthermore, it should be noted that the resistance value 2/7 R T  for R X  is merely an example and other values may be selected. Since the resistor R T  to be measured is often produced by combining one or more resistor elements the characteristics of which are determined by, for example, process technology, in one particular embodiment R X  is selected such that the magnitude thereof can conveniently be attained by combining a relatively small number of resistor elements to reduce circuit complexity.  
         [0037]    In many applications the RC time constant is a critical parameter for an electronic circuit, such as an integrated analog filter circuit, and it may therefore be advantageous to perform an initial RC time constant measurement for adjusting the RC time constant to the specified design value and/or periodically repeat the single slope measurement by means of the RC time constant measurement circuit  200  incorporated into the electronic circuit to monitor possible variations of the RC time constant due to changes of operating conditions, such as temperature, humidity and/or air pressure. An initial measurement of the RC time constant is particularly important in analog integrated circuits, such as filter circuits, having internal capacitors and resistors, since the values of the capacitor and/or the resistor elements may vary in a wide range owing to variations in the fabrication process. When the RC time constant measurement circuit  200  is integrated into the analog circuit, the capacitor C T  and the resistor R T  are manufactured under substantially the same process conditions and represent the corresponding capacitors and resistors of the analog circuit. Alternatively, the RC time constant measurement circuit  200  can include a switch portion that couples a capacitor element and/or a resistor element of the analog circuit to be measured to the comparator circuit whenever an RC time measurement is required so that no “additional” C T  and R T  are required. Moreover, the RC time constant measurement circuit  200  can be powered down during non-measurement intervals to reduce power consumption of the entire circuit.  
         [0038]    Further modifications and alternative embodiments of various aspects of the invention will be apparent to those skilled in the art in view of this description. Accordingly, this description is to be construed as illustrative only and is for the purpose of teaching those skilled in the art the general manner of carrying out the present invention.