AN-579
a
APPLICATION NOTE
One Technology Way • P.O. Box 9106 • Norwood, MA 02062-9106 • Tel: 781/329-4700 • Fax: 781/326-8703 • www.analog.com
Versatile Programmable Amplifiers Using
Digital Potentiometers with Nonvolatile Memory
by Alan Li
In concept, an op amp and a mechanical potentiometer
can easily be combined to form an adjustable-gain
amplifier, useful in many applications where electronic
adjustments are needed. However, this combination is
often unfeasible because of the potentiometer's limited
resolution, poor temperature coefficient, high resistance
drift over time, and the difficulties of remote adjustment.
Now, the AD523x family of digital potentiometers with
nonvolatile memory* can replace their mechanical
counterparts and make these circuits practical (Figure 1).
U1
AD5231
–2.7V < V
DIGITAL
INPUTS
V
I
I
+2.7V
–2.7V
< +2.7V
CS
CLK
SDI
VDD
VSS
AB
W
GND
C
C
V+
A1
OP1177
V–
V
O
Figure 1. Programmable Amplifier/Attenuator
BASIC PROGRAMMABLE AMPLIFIER
In the circuit of Figure 1, the gain (negative) is simply the
ratio of the two terminal resistances, and the output
voltage is:
R
WB
V
V–
=
O
V–
=
O
×
R
WA
D
N
2–D
I
V
×
I
(1)
(2)
Where:
R
= nominal end-to-end terminal resistance
AB
R
= terminal resistance, W to B,
WB
R
=
R
WB
AB
¥ D/2
N
R
= terminal resistance, W to A,
WA
RRRR D
=- =¥-
WA AB WB AB
D
= Base-10 equivalent of the binary word
N
= number of bits
()
N
12
The gain expression implies a balanced quasi-logarithmic
characteristic. This inverting configuration is useful
because it makes available a wide range of gains, from
very small to very large, with unity near half-scale.
Because the resistors are fabricated on a single
monolithic chip, resistance ratios are inherently
matched, and the circuit can yield a temperature
coefficient as low as 35 ppm/∞C if using the AD5235.
This circuit is a basic building block that suits many
applications, especially where small signals are present
and where high gain is required. The maximum gain is
limited by the supply voltage. Although the signal is
inverted, the grounded + input minimizes the commonmode input errors.
Since the potentiometer W terminal parasitic capacitance C
noninverting node, it introduces a zero for the 1/
(not shown) is connected to the op amp
W
term
O
that can lead to 0ⴗ phase margin at the crossover
frequency. The output may ring or oscillate if the input is
a rectangular pulse or step function. Similarly, it is also
likely to ring when switching between two gain values;
this is equivalent to a step change at the input.
As a result, a compensation capacitor C
as shown, to cancel the effect caused by C
compensation occurs when R
⫻ CW = RWB ⫻ CC. This is
WA
may be added,
C
. Optimum
W
not an option because of the variation of the resistors.
As a result, C
C
is the range of pFs.
C
should be found empirically. In general,
C
Similarly, there is a B terminal capacitance connected to
the output (not shown). Fortunately, the effect at this
node is less significant and the compensation can be
avoided in most cases.
*The terms “nonvolatile memory” and “E2MEM” are used
interchangeably.
REV. 0
© 2003 Analog Devices, Inc.
AN-579
BIPOLAR PROGRAMMABLE-GAIN AMPLIFIER WITH LINEAR
STEP ADJUSTMENT
In the basic circuit of Figure 1, the output is always inverted
with respect to the input, regardless of whether the circuit
is providing gain or attenuation. The change in gain as
the potentiometer is incremented is nonlinear. While
this is useful in some cases, other applications may call
for bipolar gain and/or a simple linear relationship. For
example, motors need to rotate freely in both forward
and reverse directions, thermal electric coolers heat or
cool lasers depending upon the direction of current
flow, and LCD panels require bipolar voltages for the
contrast and brightness controls. In the most general
case, to create a bipolar drive with arbitrary end points
and linear step adjustment, a dual digital potentiometer,
such as the AD5232, can be applied as shown in Figure 2.
The output, V
voltages between +
, can now be programmed linearly to amplify
O
V
and –K ¥
I
V
, where K is the ratio of
I
the two terminal resistances of U1 (Equation 1). A2 provides buffered amplification for V
, minimizing the
W2
influence of the wiper resistance.
i
OP2177
A2
1/2
V
O
R2
C
C
R1
U2
1/2
U1
1/2
W2
A2
B2
A1
B1
W1
A1
OP2177
1/2
V
B
–KⴛV
AD5232
V
I
AD5232
Figure 2. Bipolar Programmable-Gain
Amplifier with Linear Step Adjustment
The transfer function in Figure 2 is:
V
O
1
=+
V
I
2
R
R
D
2
×+
N
1
1
2
1
()
In the simpler (and much more usual) case, where
K–K
K
(3)
= 1,
a single digital pot, such as the AD5231, is used in
location U2, and U1 is replaced by a matched pair of
resistors to apply
V
and –
I
V
at the end terminals of the
I
digital pot. The relationship will be
V
=+
O
Table I shows the result of adjusting
ured: as a unity-gain follower (
of 2 (
R
1 = R2), and with a gain of 10 (R2 = 9 ¥ R1). The
R
2
×
R
1
D
2
–V
1
N
2
×1
I
D
, with A2 config-
R
1 = ⬁, R2 = 0), with a gain
(4)
result is a bipolar amplifier with linearly programmable
gain and 256-step resolution.
Table I. Circuit Gain vs. D
D (Step) R1 = ⴥ, R2 = 0 R1 = R2 R2 = 9 ⴛ R1
0–1 –2–10
64 –0.5 –1 –5
128 0 0 0
192 +0.5 +1 +5
255 +0.992 +1.984 +9.92
As implied in Figure 2, R1 and R2 can be replaced by
a digital potentiometer—if tight temperature coefficient
matching and very high gains are desired. If discrete
resistors are used, resistor matching is imperative.
The wiper resistance of the digital potentiometer is the
on-resistance of the internal solid-state switches, typically
50 W to 100 W. This is relatively small when compared with
the nominal resistance RAB, but the wiper resistance
ap
proximately doubles over the operating temperature
range and can become the major source of error when
the device is programmed to operate at low values.
The wiper terminal of the potentiometer should always
be connected to a high-impedance node, such as the
input terminal of an op amp, as shown in the above
circuits. The OP1177 family, the fourth generation of the
industry-standard OP07, was chosen for its low offset
and low bias-current characteristics. This minimizes the
effects of wiper resistance on the voltage divider ratio at
the tap point.
If the input voltage is high enough such that the voltage
across RAB exceeds 5 V at any given setting, discrete
re
sistors should be added in series with the potentiom-
eters to comply with the voltage limitation. See Figure 3.
1/2
V
I
U2
1/2
AD5232
R5
R
R3
R
U1
1/2
AD5232
W2
W1
R6
B2
R
R4
B1
R
A1
1/2
OP2177
A2
A1
–KⴛV
i
OP2177
A2
V
O
C
R2
C
R1
Figure 3. PGA Handles High Input Voltage
By configuring the AD523x nonvolatile memory digital
potentiometers with the op amps shown in this article,
the user can easily design a versatile amplifier with high
resolution programmability, bipolar controllability, and
linear/log step adjustment capability.
–2–
REV. 0