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.

LM2904: Trouble Using Part As Comparator

Part Number: LM2904
Other Parts Discussed in Thread: LM2903, LM2901

Hi all,

I am using LM2904 to mimic the behavior of, the seemingly very similar, LM2903 in bench testing for a new design.  Essentially, 2904 is acting as a comparator.  This is only a temporary, makeshift solution until my LM2903 chips arrive.  Unfortunately, I have noticed an issue while testing 290 and I cannot determine its cause.

I am taking one of two outputs of an amplifier, biased at 1/2 the supply voltage of about 5 V, and comparing that to a reference voltage.  I would then like LM2904 to compare the speaker output voltage with the reference voltage, saturate, and potentially drive an LED.  The idea here is that depending on which input is greater the LED will turn on or off.

My problem is that under idle conditions, LM2904 provides a surprising output because, although input 2IN+ is greater than 2IN-, 2Out is going low.  My expectation is that, given the idle conditions, the output should be high.

Could someone could shed some light as to what may be happening, whether or not this is probably being caused by the chip, and whether or not I may have the same issue using LM2903?

For reference, I have included the idle voltage points of the pins of interest and a schematic of that part of my design.  Thank you in advance.

Pin 4: 0 V
Pin 5: 2.453 V
Pin 6: 2.297 V
Pin 7: 0.738 V
Pin 8: 4.854 V

  • Daniel,

    Looking at the DC levels, I would expect pin 7 to be high (about 3.3V)
    Try looking at the inputs (and output) with an oscilloscope to see if pin 5 is alway greater than pin 6.
    LM2904 can be used as a comparator but, it is much slower than LM2903.
  • Ron,

    Thanks for the help. The answer to your question is "no." Pin 5 is not always greater than pin 6. I can push pin 6 past pin 5 and pin 5 will not try to follow and stay ahead.

    I have tried using LM2903, as I now have the part I intend to use, and I am having the same idle state issue. Pin 5 is a good 150 mV greater than pin 6, yet the comparator is going the wrong way.

    I have considered hysteresis, overdrive voltage, and common mode input voltage range. I have also tried switching chips, location on the breadboard, and my dummy load. None of these seems to have solved the issue.

    Please let me know if you have any other suggestions to make.

    Daniel
  • Hi Daniel,

    What type of LED are you using? Blue? Green? White?? Good-ole' Red? High Brightness?

    The LED drive current is around 1mA (assuming a LED voltage of ~2V) with a 2.8k resistor. The higher energy LED's (White,Blue, Yellow) may not even be conducting yet - so there is no "pull-up" action to make it go high (The LM2904 also has an output "feature" that may cause a similar issue).

    Can you show us the full schematic - particularly any input dividers. Any large value resistors (>500k) may be influenced by the parallel loading of your DMM/Scope (creating a difference in the actual and measured values).

    (Sorry, Ron - it's a comparator now! :^)
  • Hi Paul,

    The type of LED I am using is a SLR-322MG from ROHM Semiconductor (www.rohm.com/.../SLR-322DC).  I am using it because it is the closest thing to LTST-C171GKT (www.digikey.com/.../386792) from Lite-On that I could get my hands on.  LTST-C171GKT is the part I was planning on using in my final design because it is used in a very similar TI design that I physically tested in lab and that testing showed the LEDs and the comparator (LM2901) to work as expected.  As you probably already know, LM2901 seems to be essentially almost a copy of 2903, just as a quad versus a dual part.

    To summarize, I am using the SLR because it is similar to the LTST, which I am/was very confident would be what I needed.  From what you are saying though, I may need to reconsider the LED and/or its resistor.

    Here is a more overhead look at the schematic.  Inputs are biased at 2.5 V and the output is stored in a register bit inside a chip.  The load is in parallel with this circuit and is about 4 to 8 ohms.

    Thanks for the help.

    Daniel

  • Hi Daniel,

    You can test to see if the LEDs are suitable by shorting the output to GND. If they do not light, or are very dim, then they are being starved.

    Also - because you are using the output to feed a logic input, you should have a parallel pull-up resistor to ensure that a "high" is really high - otherwise a "low" will float above ground since the LED, being a diode at heart, cannot fully pull-up when below it's operating voltage.

    So try shorting the output to GND and make sure the LED lights. That will verify if the operating current is enough. This will not hurt the 2903 since it is an open collector output.

    4.8V-2.1V=2.7V, 2.7V/10mA = 270ohms! I would try 470ohms for the LED resistor.

    Then try adding a second 5-10kK pull-up resistor from the output to the SPKVDD to make sure the logic input gets a valid high.

    Also note that the valid input range of the comparator is 0 to 3.3V. With the LM2903, as long as one input is still within valid range, the output will be correct.
  • Paul,

    Regarding the LEDs, they are viable with the currently selected resistors. However, a lower resistance does significantly improve their brightness and makes them easier to read. I have decided to go with resistors closer to 800 ohms, due to current concerns.

    As far as adding the pull-up, this did not seem to have any real effect on my circuit's performance. The previous problem is present as before, where the output voltage level does not correspond to the input levels.

    Finally, thanks to resistive biasing, at least one of the two inputs of the comparator will always be at around 2.5 V. So there should not be an issue with the input voltage range, but thanks for pointing that out.

    Any other ideas as to what could be causing this strange behavior?

    Thanks,
    Daniel Miller
  • Ron and Paul,

    I wanted to let you know that I finally resolved the issue last week. The problem was not caused by the LM2903 device, the LEDs, or any of the circuitry shown in the schematic. The problem was that, since I am using a class-D audio amplifier, the outputs of the amplifier are not actually biased in their normal state but are switching, even if no audio is playing. This is an issue because the circuit shown in the schematic I provided above works on the assumption that the amplifier outputs are biased at about mid-supply.

    Because the amplifier is at about 50% duty cycle when no audio is playing, probing the outputs for DC voltage leads to a mid-supply reading, just as I initially expected. However, after going back and using an oscilloscope, as recommended by Ron, to measure the outputs, I realized what the issue was and why the LM2903 chip was not "properly" comparing DC voltages: there was no DC signal there to begin with!

    The solution to this issue was to mute the amplifier, thereby ending the switching and allowing for a biasing voltage at the outputs. After some further tuning, my circuit and LM2903 work as expected. While I did take up Ron's initial advice to take certain measurements, I did so using a DMM instead of an oscilloscope. Had I followed his instructions more carefully, I would have discovered my careless mistake earlier.

    Thanks again for all the help. I appreciate it very much.