# State Machine Oscillators

by Kenneth A. Kuhn March 22, 2009

Introduction State machine oscillators are based on charging and discharging a capacitor to specific voltages using one or more voltage comparators and usually an RS flip-flop. These are non-linear oscillators so s-plane methods are not applicable.

Simple comparator oscillator The circuit shown in Figure 1 is as about as simple an oscillator that can be built. Being simple it is lacking some features such as temperature stability and load independence but if those are not important then this oscillator can be useful. The circuit is a Schmitt trigger (positive feedback path to provide hysteresis) with an RC time constant in the negative feedback path. The capacitor charges and discharges nearly symmetrically between the upper and lower Schmitt thresholds. The frequency of oscillation is the reciprocal of the total charge and discharge times. The output of the comparator is close to a square wave. Rp is a pull-up resistor generally around 4.7K or less and is required for most comparators since outputs are usually open-collector. The pair of Rb resistors creates a voltage equal to half the power supply with a source resistance of Rb/2. The hysteresis band (Schmitt threshold voltages) is determined by this value and Rf. The frequency of oscillation is determined by the hysteresis band and R and C. An equation for the frequency is of the form F = k / RC.

Figure 1: Simple Comparator Oscillator

1

This circuit has the advantage that the threshold voltages. Figure 2: Advanced Comparator Oscillator 2 . are applied to the circuit rather than being derived as a function of other circuit parameters. this circuit is capable of very good stability and a variety of versions are used. The lower NAND gate is now low and discharges the capacitor towards zero. VU for Vupper and VL for Vlower. As shown the output will be a square wave with a common charge/discharge path. With some refinements. If the charge/discharge paths are a function of the output state then rectangular waveforms or pulse waveforms can be produced. VL. When the lower threshold. is reached the upper comparator switches low which changes the state of the RS flip-flop so that the output is now high. the lower NAND gate is high and the capacitor charges upwards. This makes the circuit much more predictable in its operation. F = k / RC. is reached the lower comparator switches low which changes the state of the RS flip-flop so that the output is high again and the process repeats. When the output is low. The output frequency is given by the equation. VU. and R and C. The output frequency is a function of VU and VL (which often are symmetrical about half the supply voltage for the logic gates (5 volts typical). When the upper threshold.State Machine Oscillators Advanced comparator oscillator The circuit shown in Figure 2 uses two comparators for more precise switching points than can be achieved in the previous simpler circuit.

The FM pin is normally either left open or connected to a bypass capacitor to ground for better overall stability can be used to dynamically change the switching thresholds for frequency modulation effects. The outputs of the comparators go to an RS flip-flop. Its block diagram is shown in Figure 3. This makes many timing functions independent of the actual power supply voltage. Figure 3: LM555 Block Diagram 3 . Observe that it has two comparators with fixed upper and lower thresholds equal to 2/3 and 1/3 of VCC respectively. The discharge pin is used to discharge the timing capacitor.State Machine Oscillators LM555 Timer The LM555 timer is a general purpose version of the advanced comparator oscillator in monolithic chip form that can implement a variety of timing and oscillator functions using an external capacitor and one or more resistors. A reset pin which is normally connected to VCC can force the output low if brought to ground potential. Negative going output of the comparators causes the RS flip-flop to change state.

1 With pin 5 open as shown the oscillation frequency may be phase modulated by any noise on VCC.44 F = ------------------------(R1 + 2*R2) * C Eq. The frequency of oscillation can be derived as: 1. Figure 4: LM555 Oscillator Circuit 4 . When the voltage on the capacitor falls to the lower threshold (1/3 VCC) the output switches to high and the process repeats. When the voltage on the capacitor reaches the upper threshold (2/3 VCC) the output switches to low and the discharge pin switches to ground thus discharging the capacitor through R2. the discharge pin (pin 7) is open and the capacitor charges towards VCC through R1 plus R2. When the output (pin 3) is low. Operation is as follows.State Machine Oscillators An LM555 oscillator circuit is shown in Figure 4. Adding the appropriate size capacitor to ground significantly reduces that effect.

Thus dV/dt = I/C. VL. or falls to the lower threshold. An equation for frequency is of the form F = k * I / C where k is a function of the voltage difference between VU and VL. The unity gain op-amp buffers the voltage across the capacitor and drives the output. The pair of comparators works as in previous circuits to switch the RS flip-flop when the capacitor voltage rises to the upper threshold. The electronic switch consisting of four diodes routes either the upper current source or the lower current source to the capacitor causing the voltage to rise or fall linearly with time based on the equation dV = I* dt / C. If the charge/discharge paths are a function of the output state then asymmetrical ramp (also known as saw tooth waves) waveforms can be produced.State Machine Oscillators Triangle wave generator This oscillator is a version of the advanced comparator oscillator that uses a switched constant current source to achieve a linear voltage ramp on the capacitor. VU. Figure 5: Triangle Wave Generator 5 . It is capable of making very precise voltage ramps. The switch driver is simply a low-impedance buffer driven by the logic from the RS flip-flop and may include some level translation depending on the particular circuit. As shown the output will be a triangle wave with a common charge/discharge path.

Refer to Figure 1 and assume that the output voltage switches between 0 and 5 volts and that the switching voltage thresholds are 3.State Machine Oscillators Homework: (not to be handed in) 1. 6 . 2. Refer to Figure 4 and derive Equation 1. Refer to Figure 5 and derive the equation for the frequency of oscillation for a given difference between VU and VL and knowing I and C. 3. Derive the equation for the frequency of oscillation. 4. You should obtain the same answer.5 volts.5 and 1. Repeat for Figure 2.

Sign up to vote on this title