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.

LM339 OP-AMP BASED SQUARE WAVE OSCILLATOR CIRCUIT

Other Parts Discussed in Thread: LM339

We had downloaded a pSpice model of LM339 from TI.com ! We then simulated an LM339 based square wave oscillator circuit on TINAPro Version 7 Circuit Simulation Software by DesignSoft Inc.! But the circuit doesn't give stable frequency oscillations for any value of input capacitance!

Moreover I am not able to find out exactly within what range of frequency the output of the circuit varies???????????

LM339.pdf
  • The square wave oscillator circuit should be a simple trouble free circuit.

    Can you upload your TINA oscillator circuit?

     

  • Hey, please find the relaxation oscillator circuit attached !

    The frequency that I have calculated from the formula that we had derived is app. 1MHz for C=10pF and app. 33kHz for C=300pF !

    But when I simulate it on TINA Pro version 7 (a circuit simulation software by DesignSoft Inc.), the frequency for C=10 pF is 500kHz ..............!!

    Don't know what the problem is????

     

    attachment.docx
  • Hello Baban,

    The LM339 has a large signal propagation delay of 0.3uS and a small signal propagation delay of 1.3uS.

    With a calculated cycle time of 1uS plus two propagation delays plus the overshoot on the capacitor charge during the prop delay could easily add to 2uS (500kHz)  

  • Dear Ron,

    Thanks for the answer!

    Could you suggest how I can remedy the problem?

  • And is the formula for frequency at the output that you are using = 1.548 / (RC) ?

    I am using this formula to calculate frequency and find that the difference between the simulated and theoretical values is larger at lower values of capacitance (more error) and smaller at higher values of capacitance (less error) !

  • I did not derive a formula, but I did a simulation with TINA. Your formula is accurate when the cycle time of the oscillator is much less the propagation time of the LM339.

    To solve the dilemma at high frequency, you need to add a factor to your equation for prop delay or choose a faster comparator.

     

  • In practice, you should not use so small frequency determining capacitances as 10 pF in any kind of RC oscillator, stray capacitances would then influence the frequency too much. It is better to decrease the resistor values so that you get the desired frequency with a capacitor of at least some hundred pF.

    The LM339 works very well in oscillator applications up to some kHz, maybe some tens of kHz, but for higher frequencies it would be better to use another part. The open collector output of the LM339 turns off slowly, as hard saturated bipolar transistors always do. Probably, you will get more predictable results using an OP or comparator with a push-pull output stage.

  • Well, you are right !! But the thing is, in the application for which we are making this oscillator it is required that the capacitance should vary between 10pF and 300pF !

    So we can't do anything about the capacitor part except for choosing the kind of shape for which stray capacitances are less!

     

  • Hey, is there a formula by which I can calculate the maximum propagation delay that I can afford my op-amp to have, for the circuit to work according to the mathematical calculations?

  • Yes there is a formula. For a maximum error of 10%, the maximum propagation delay is 10% / (2 * max frequency).

    For 1 MHz that is 10% / (2 * 1MHz) = 50nS.

     

     

  • Now, I hope we get a reply to the following query:

    We have been trying to substitute our op-amp, LM339, in the oscillator circuit with another one because of the problems with its large response time! We thought that it would be better if we study the behaviour of an ideal op-amp in the circuit and tune its varous parameters to get the most accurate output. We would then look for an op-amp with similar specs.

    I substituted the ideal op-amp in the circuit but it shows an infinite peak- to -peak response and only 161kHz of frequency in simulation, for a capacitance of 10pF. Though according to the formula that we have calculated for our circuit, f=1.548/(RC), the frequency at this value of capacitance should be app. 992kHz!
    The response of the ideal op-amp for 300pF is 5kHz though again in theory it is supposed to give app. 40kHz!
    What's going on?

    Also, where are the supply inputs of the ideal op-amp? It's working without it! 

    And could you tell us why the  frequency in simulation is closer to the calculated at higher capacitances and farther at lower capacitances?

  • why should the cyle time be less than the propagation delay?

  • hey, is response time of an op-amp equivalent to propagation delay of the op-amp?

  • Yes, response time and propagation delay are the same thing. It is the time required for an input signal to reach the output.

    Per the formula 1 MHz signal is 1uS cycle time and a 50nS response time would cause a 10% error in timing.