Rail-to-rail input and output (RRIO) op amps, both FET and BJT, have been around for a long time, but the possibilities they provide for versatile waveshape generation with simple circuits can still surprise. Figure 1 is an example, outputting a variety of precision waveshapes while using just one dual RRIO op amp as the only active device.

Figure 1. |
Buffered triangles, sawtooth waves, and square waves from two op amps. |

Here’s how it works.

Amplifier A2 integrates the difference between A1’s rail-to-rail output and waveshape control R2 to produce triangle output T_{OUT}. The time constant of the integration is set by R1C1 which combines with R2 to produce positive and negative ramp rates of:

and

As shown in Figure 2, a symmetrical triangular waveshape results if V_{R2} = V_{DD}/2, a positive ramp sawtooth if V_{R2} < V_{DD}/2, and a negative sawtooth if V_{R2} > V_{SS}/2.

Figure 2. |
T_{OUT} waveshape versus R2 where a symmetrical triangular waveshape, a positive ramp sawtooth,and a negative ramp sawtooth can be realized. |

As will be noted later, square wave P_{OUT}’s duty factor is also controlled by R2.

The T_{OUT} waveshape is symmetrical around V_{DD}/2 and its peak-to-peak amplitude is set by R3 over a range extending from 0 (fully CCW) to V_{DD} (fully CW) as shown in Figure 3.

Figure 3. |
T_{OUT} amplitude versus R3 where the T_{OUT} waveshape’s peak-to-peak amplitude is set by R3 overa range from 0 to V _{DD}. |

A1 acts as a comparator triggered by the difference between T_{OUT} (as scaled by R3’s setting) and the V_{DD}/2 reference voltage provided by R5/R6. Positive feedback looped through R4 makes A1 periodically flip-flop and reverse the direction of the T_{OUT} triangle ramp. The ratio of R4 to R3 determines the peak excursions of T_{OUT} required to make A2 switch states and thereby sets T_{OUT}’s V_{P-P} amplitude.

A1’s rectangular 0 V to V_{DD} signal is provided as the P_{OUT} output, with a duty factor that goes from 0% to 100% as R2 is varied from 0 to V_{DD} (fully CW).

Oscillation frequency is affected by all three pots, but T_{OUT} waveshape, amplitude, and P_{OUT} duty factor are all mutually independent. Therefore, the quickest and easiest method of setting the various parameters (the method that results in the least “tail-chasing”), is to set R2 and R3 first to obtain the desired waveshape and amplitude, then adjust R1 to the desired frequency.

Depending somewhat on the choice of V_{DD}, total current draw is ~2 mA exclusive of output loading. The maximum oscillation frequency using the TLV2372 is ca:10 kHz but faster amplifiers are available if more speed is needed, as are op amps capable of handling more voltage. And of course, a bipolar supply would accommodate bipolar outputs. Chef’s choice!