Design Ideas: September 12, 1996
The circuit in
Figure
1 can amplify a signal either in an inverting or a noninverting mode. When
switch S1 is on and S2 is off, the circuit behaves as a
regular inverting amplifier. When S2 is on and S1 is
off, the circuit feeds the signal to the noninverting input of the op amp; thus,
the circuit behaves as a noninverting amplifier. If S1 and S2
are monolithic analog switches, you can control this circuit using a digital
signal.
You can implement the same idea using a potentiometer
instead of switches (
Figure
2). Setting the wiper at the high end of the potentiometer selects
inverting-mode operation; setting the potentiometer to the other end selects the
noninverting mode. IC1's linear digital potentiometer digitally
controls not only the polarity, but also the gain of the amplifier. Because many
digital potentiometers come in dual configurations, you can use the second
potentiometer for the gain adjustment.
Set the wiper value of the potentiometer by writing to the three-wire interface comprising RST, CLK, and DQ. A wiper value of 00000000 sets the wiper to the low end of the potentiometer, making this a noninverting circuit. (Gain=1.) A wiper value of 11111111 sets the wiper to the high end of the potentiometer, placing the circuit in an inverting mode. (Gain=1.) Wiper settings between these values result in a change in gain that you can sweep from +1 to 1.
When the potentiometer first powers up, the wiper automatically sets to the midpoint of the potentiometer. Thus, equal signals are present at the op-amp inputs, which results in no signal from the op amp output. This feature, in effect, creates a power-on mute function.
You can also use logarithmic potentiometers in this circuit configuration. However, due to their logarithmic taper, these potentiometers do not realize a smooth transition from inverting to noninverting gains. Some gain control is possible, but the gain is not symmetric between the two operating modes.
With bipolar, ±5V supplies, the logic levels on the three-wire interface must swing from 5 to +5V. Thus, level translation may be necessary for interfacing to unipolar digital logic. You can also power the circuit with a single supply by tying the VB pin of IC1 to ground and by biasing the op amp with R1 tied to 1/2VCC. That is, for a VCC of 5V, R1 would go to 2.5V. (DI #1920)