This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LMV7239: Non inverting comparator with hysteresis oscillating

Part Number: LMV7239
Other Parts Discussed in Thread: TLV7031

Hello,

I am working on a PCB equipped with an LMV7239M5/NOPB in a non-inverting comparator with hysteresis reference design from the datasheet.

https://www.ti.com/lit/ds/symlink/lmv7239.pdf?ts=1646046329074&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FLMV7239

In SPICE simulation this works fine, but on the PCB the circuit oscillates when the input voltage is between 1.000 and 1.100V instead of having the hysteresis.

The PCB is dual layer, with GND and the 5V trace on the bottom layer and all connecting circuitry including a testpoint on the top layer.

While debugging, I noticed that when the output drops from 5V to 0V, the positive input briefly rises above the externally applied input voltage. This causes the positive input to be higher then negative, and the comparator output goes high again. After an RC decay the voltage on the positive input lowers again below the negative input and the output tries to go low restarting the cycle.

  

I added a 10nF capacitor over R15 to make sure the reference voltage is stable, however this seems not enough. A capacitor between the input pins does have significant effect, a small one (33pF) is enough to stabilise the circuit, but the calculated hysteresis is significanlty affected. From the tests below I concluded that 1nF restores usefull operation to the circuit, altough hysteresis is still lower then it should be.
I would like to understand why this occurs and how to avoid it. What causes the positive input to rise when the output lowers? 

Below some capacitor values I used between + and - inputs, together with a hystereses that is supposed to be 100mV. 
C = 10pF => oscillating, no hysteresis
C = 33pF => barely stable, just 3mV hysteresis.
C = 47pF => stable, 13mV hysteresis
C = 220pF => stable, 63mV hysteresis
C = 1nF => stable, 78mV hysteresis

  • Hello Stef,

    DO NOT place a cap between the input pins. This can cause several problems - particularly with hysteresis. Basically, you are slowing it down and defeating the hysteresis - which can actually cause chatter or "bursting"

    I would increase the 10nF capacitor across R15 to up as high as 1uF (ceramic). There can be bias current transients on the inputs when the output transitions, so the reference needs to be be a low impedance point.

    Please realize that the LMV7239 is a high speed (75ns) comparator and should be treated as a high speed gate. There are large current spikes on the supplies as the output transitions (5V in 2ns!), so supply bypassing and layout is critical. You have done pretty good, but I would put R17 at a right angle to R16 (below R18) to prevent output coupling back into the positive node. I would also try paralleling a 1uF (ceramic) cap across C26 to help with the supply transients.

    I would also sprinkle a few more ground vias around the circuit to stiffen-up the grounds - like around R15 ground.

  • Hi Stef,

    Paul gave great advice to help your issue. There was one typo and the 10nF capacitor across R15 should be replaced with a 1uF capacitor (not R1).

    It is unfortunate that the simulation models don't capture real world performance. One additional option for your is to increase the hysteresis for your design.

    For your 1kOhm resistor on the output, I would also consider increasing it to 10kOhm to slow down the output edge rate.

    Best Regards,

    Joe

    Applications Engineer

    Linear Amplifiers Business Unit | Comparators Product Line (CMPS)

    All information in this correspondence and in any related correspondence is provided “as is” and “with all faults”, and is subject to TI’s Important Notice (http://www.ti.com/corp/docs/legal/important-notice.shtml)

  • Paul, Joe,

    Thanks for the feedback.

    I added 1uF 0603 X7R caps over R15, and R26. However the circuit still oscillates when the "temp sensor" voltage is between 1.040V and 1.065V
    I noticed that the oscillation stops when I measure pin3 with a 12pF oscilloscope probe, however the hysteresis is significantly degraded as you mentioned.

    It seems that I made a poor choice of comparator for this application? It will be used to buffer and read an analog temperature sensor with relatively high output impedance from an external module. So I have a slow signal and use a high speed comparator. The hysteresis must remain 100mV since this translates to a 10 degree centigrade temperature difference. The output should drop to 0V when input is 1.1V and go back to 5V when the input drops below 1.0V.
    Perhaps I should just switch to a much slower comparator, do you have any suggestions which one might be most suitable for temperature measurement applications?

    Thanks,
    Stef

  • Hi Stef,

    I think the problem is that the input of your comparator circuit isn't driven by a fast amplifier which can fully absorb the fast edge of comparator output signal when the output toggles from high to low. Via R18 a fast signal is fed back to the input and the input reacts with it by increasing the voltage at pin 3 instead of decreasing.

    So there are some remedies:

    1. You heavily speed up the driver of temperature sensor signal to be able to absorb the fast edge coming via R18.

    2. Or you feed the temperature sensor signal to the -input of comparator instead to the +input with the fast hysteresis feedback.

    3. Or you take a slower comparator.

    Can you show a schematic which includes the temperatur sensor?

    Kai

  • Hi Kai,

    I do not have a schematic of the temperature sensor circuitry, since it's an output from a module that we bought from a 3th party supplier. 
    From past experimentation I learned that it has a relatively high output impedance, and that buffering is necessary.

    Your argument that the signal source might be the problem did set me on the right track of verifying that part.
    Instead of using the temperature sensor, I am using a R&S HMP2030 lab power supply to test this circuit independently. Apparently the output ripple of this particular PSU is way out of spec, at around 200mV.

    This means that the comparator is not oscillating anymore after adding the 1uF caps on R15 and C26.
    What I perceived as oscillations is actually the comparator behaving normal but triggering on input noise that is larger then the hysteresis of the circuit.

    I added a 1uF cap between at the R17 input to GND. This + increasing the power rail and reference voltage buffer capacitance seems to have fixed the issue. The circuit now behaves as I had intended.

    Modified schematic and PCB: 

    Thanks everyone for the advise on how to improve the stability of the circuit, I will use your suggestions to improve this and future designs!

    Stef

  • Hello Stef,

    Yes. As Kai said, it is assumed that the source impedance is low when using hysteresis. If the source impedance is near or higher than the feedback network, then the network just drags the input up and down since the source cannot "hold down" the input. You may have to scale-up the feedback resistors to raise the impedance (loading) to the module. You could also scale up the R15/R17 dividers to save total supply current.

    If you do not need the speed, and want to save a bit of power, then try the TLV7031, which can drop-in replace the LMC7239. It is also much slower and should not "squeak" as much.