Square waves are important waveforms that are sometimes taken for granted, but they are important in digital systems as clocks and analog systems as excitation sources. Analog systems often use square waves without a typical crystal oscillator, so they need an alternative method to source a waveform into a circuit. Oscillator circuits built from amplifiers, transistors, and charging/discharging RC circuits offer one simple way to create an oscillating waveform, which can then be tailored to your specific frequency of interest in your system.
One of the simplest analog waveform generator circuits is the Schmitt trigger oscillator. This oscillator uses either a dedicated Schmitt trigger circuit, or an op-amp with feedback applied to provide gain. The best part of a Schmitt trigger circuit is its configurability, where the frequency of the output signal is very easy to control with passive components. There is also a certain condition where the output has 50% duty cycle and thus it could be used as a clock.
How to Design a Schmitt Trigger Oscillator
A circuit diagram for a Schmitt trigger oscillator is shown below. In this diagram, the feedback resistor and the capacitor on the input combine to determine the repetition frequency of the output square wave, which is based on their time constant. The repetition frequency is proportional to the inverse time constant, but the actual value depends on some other factors.
The input/output waveforms are also shown; the input waveform is not being fed by an external generator. The input waveform is created through charging and discharging of the RC circuit formed by the feedback resistor (R) and the input capacitor (C). The feedback resistance is generally chosen to be very high with low (0 Ohms) resistance on the input feedline, so the circuit has high voltage gain. Therefore, it does not take much input voltage to excite the circuit and cause it to begin oscillating between two larger rail voltages.
Input and Output Waveforms
The resulting switching process in this oscillator circuit depends on the threshold voltages in the Schmitt trigger. The conversion between the exponential rising/falling waveform and a square wave is shown in the diagram below.
The conversion process is based on the same type of railing action that occurs in the typical usage of a Schmitt trigger or a high-gain op-amp.
- When the capacitor initially charges, its voltage rises above the low threshold (VTH-) and eventually reaches the high threshold (VTH+)
- During Step #1, the oscillator output is at VHI.
- Once the capacitor’s voltage reaches the high threshold (VTH+), the output switches states very quickly and saturates to VLO.
- Very quickly after switching output states, the capacitor begins to discharge, and its voltage drops to the low threshold (VTH-).
- Repeat (go to Step #1).
The output is continuously switching between its high and low rail voltages, so the output voltage levels can be controlled entirely with those connections. What’s left now is to determine the output frequency in terms of the threshold voltages in the circuit.
Just like a standard Schmitt trigger circuit, there is a hysteresis window that will affect when the output switches between its high and low rail voltages. This is why the repetition frequency is not strictly the inverse of the RC time constant, and it is only proportional to this value. In addition, it is possible for the resulting square wave train to have a duty cycle that is not 50%. To see how this works, we can use the following formulas.
In the following derivation, we assume that VLO = 0 V; other values can be used by a linear transformation of VHI → VHI - VLO. The amount of time where the output signal is high depends on the value of VHI and the threshold voltages:
The amount of time the output signal is low depends only on the threshold voltages:
The sum of these two values is equal to the period of the output signal, and the inverse of the period is the repetition frequency.
In general, for practical situations and standard logic levels, the duty cycle is not always 50%, so the output could not always be used as a perfect clock pulse. However, it is possible to derive a condition on the threshold voltages where the output is exactly 50% duty cycle. To do this, set the high and low times above equal to each other, remove the RC value and the natural logarithm operation, and do some algebra.
You will arrive at the following condition on the threshold voltages that gives exactly 50% duty cycle on the output signal:
50% duty cycle condition for a Schmitt trigger oscillator.
If you want to use the output square wave signal as a clock, then you will need to aim for this design condition to ensure consistency on the rising and falling clock edges.
When you’re ready to create and simulate your oscillator circuits, use the comprehensive set of simulation tools in PSpice from Cadence. PSpice users can access a powerful SPICE simulator as well as specialty design capabilities like model creation, graphing and analysis tools, and much more.