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.

TL331: Unexpected behaviour in simulation

Part Number: TL331
Other Parts Discussed in Thread: , LM393A, LM393

Hi, I want to use a TL331-EP to cut off slowly falling flanks. The Design is as follows:

The problem is, as soon as the non-inverting input (signal in) reaches around 3V there's unexpected behaviour.

Green: Output

Blue: Reference voltage

Red: Signal


Yannick Haas

  • Hello Yannick,

    What if you remove/short the diode? Does it work correctly? What is the diode model? Ideal?

    The TL331 input bias current of about 20nA flows OUT of the input pins towards ground. I wonder if there is an effect of the bias current and the diode leakage current.

    What if you add a high-value resistor (10M? 100M?)  from the positive input to GND so that the input does not "float" when the diode is reversed.

    Try also monitoring the current on the input pins.

    What exactly are you trying to measure? Can you send the zipped sim package?

  • Thanks for the quick reply,

    removing the diode didn't help. 

    I tried replacing the TL331 with the LM393A, which works just fine. The only downside is, I just need a single comparator and space on the pcb is limited.

    Since these two comparators are within the same family, they should behave similarly, shouldn't they? 

  • Hi Yannick,

    We have acknowledged your reply and will try to get back to you by the end of business tomorrow (10/13).

    Thank you,


  • Hi Yannick,

    what is the purpose of the diode? Looks a bit strange to me :-)

    What happens when you decrease the pull-up resistance? 120k is a bit high.


  • Yannick

    sounds like it is just a problem with the model.  The architecture for the TL331 and LM393 are the same.

    I am also curious about the diode but as you noted, that is not the problem.  The problem is with the TL331 model.

    We will update the model of the TL331 so it resembles the LM393.

    Thanks for bringing this to our attention.  If you require further assistance, please feel free to reply.  Otherwise, I will be closing this thread.


  • TL331.lib

    Hi Yannick,

    We have attached the .zip file containing the project files for the updated TL331 model. If you are using PSpice For TI, be careful when running the simulation for the project. For some reason PSpice for TI reverts back to the older PSpice Model for the TL331, so you may need to overwrite the lib file in the configuration path for the simulation.

    To check this, right click on the instance of the part in the schematic and view the PSpice Model. The Datasheet value should read: “* Datasheet: SLVS238I” on line 28 of the PSpice Model code.

    If the datasheet number is not the same as above, than you will need to overwrite the lib file that is within the archived project folder with the lib file we have provided separately. 

    Please let me know if you have any questions on this. We are working on getting the official model from updated and refreshed on the web by the end of the week.



  • Hi Yannick,

    Since there haven't been any replies to this thread, I will assume we have answered your questions and the PSpice model works for you. If you have any further questions, please respond to this thread or open another.