天天看點

Audio Gain Control Using Digital Potentiometers

Abstract: Digital potentiometers (pots) offer advantages for audio volume (gain) control applications and can replace bulky mechanical pots, especially in handheld portable devices such as MP3 players, PDAs, cell phones, mobile Internet devices, or stereo

AM/FM radios. This document describes the types of digital pots available for audio control such as logarithmic taper pots (log pots). It examines several common designs using log taper pots and audio amplifiers, evaluates their advantages and disadvantages,

and recommends circuit designs.

A similar version of this article appeared in the January 7, 2002 issue of EE Times magazine.

It is now common for portable multimedia equipment to include some sort of stereo audio playback circuitry, perhaps for MP3 or mobile Internet applications. Many specialized ICs are available for these circuits and many use a mechanical potentiometer (pot).

This application note will demonstrate that widely available low-power components can be just as effective. The article demonstrates how to achieve a stereo volume control without a mechanical pot.

Historically, audio volume controls used a special kind of potentiometer with a log (or sometimes audio) taper or law (Figure 1). This approach derives from the roughly logarithmic response of the ear to changes in sound pressure levels.

Figure 1. Logarithmic response of the potentiometer to changes in sound pressure levels.

In general, the midpoint of the rotation usually gives around 20dB attenuation of the audio signal, with attenuation rapidly increasing from the midpoint counter-clock wise (CCW). There is finer control over the "louder" settings from the midpoint clock wise

(CW).

While this approach works well in practice, there are still several reasons not to use a mechanical pot in a small portable device. The space constraints and reliability issues of a mechanical pot are just two immediate issues. Today a common volume-control

interface for modern devices uses up/down buttons in conjunction with some form of host processor. This design provides an inexpensive, useable solution without a bulky mechanical pot.

Stereo (or ganged) rotary pots also have a mechanical tracking issue; mechanical tolerances mean that L-R tracking suffers as the volume is adjusted. Also, the desired

off' position? Perhaps you should consider a digital pot?

Over the past years digital pots have become available and their performance has evolved (Figure 2). These digital devices use resistive ladders and

control, however, there are issues which must first be addressed.

There is a follow-on issue. While the digital pot steps are usually designed to give equal-value resistive increments, a by-product of the process variation is that the total end-to-end

two channels using separate digital pots.

Some design examples follow. There are both gain-trim designs (where the control is applied over a set attenuation range, but not giving full attenuation), and more traditional full CW/off CCW volume controls. These circuit ideas assume a

The circuit in Figure 3 would seem to give adequate results. Using two MAX5160Ls (assuming that their digital inputs are suitably controlled) around a

state of the MAX5160L gives approximately a unity gain setting.

The drawback to this implementation is the ±25% overall resistance variation of the digital pot. This variation could lead to a wide gain tolerance, especially on the settings at the extremities of resistance, channel-to-channel as well as unit-to-unit. For

example, assuming the 50kΩ resistors are ±1%, then the nominal, maximum +6dB setting could vary between limits of:

Av1 = -(50.5kΩ + 62.5kΩ)/49.5kΩ = -2.283V/V or 7.16dB Av2 = -(49.5kΩ + 37.5kΩ)/50.5kΩ = -1.723V/V or 4.73dB

Figure 3. ±6db stereo gain trim control, 32 gain settings (1 channel shown).

This amount of left-right mismatch is easily audible. This circuit can be made to work better by selecting or trimming the support resistors (or selecting the digital pot!) to suit, but this is not feasible in mass production. A design approach must be found

The circuit in Figure 4 uses the MAX5160L digital pot in a divider chain. The MAX5160L uses 100kΩ and 50kΩ resistors to supply the MAX4252 with some positive feedback in addition to the usual negative feedback . The gain of this circuit can

be shown as:

AV = (1 - KN)/(KP - KN)

Where KN is the negative feedback fraction and KP is the positive feedback fractions. For the example in Figure 4, KN = 100kΩ/(100kΩ + 50kΩ) or 2/3, and KP is variable.

Figure 4. ±6dB stereo gain trim control, 17 gain settings in an improved design.

When the MAX5160L wiper is positioned at the VREF terminal, the gain of the circuit is -0.5V/V, as there is no positive feedback contribution. When the wiper is at midscale, KP = 0.5 and the gain is now -2V/V. Hence, by using those 17

positions between VREF and midscale, the gain can be varied over a ±6dB range. The 15 unused positions have been a trade-off for repeatability, because the gain value does not depend on the digital-pot resistance tolerance, as did the circuit of

Figure 1. The gain tolerance is now only limited by the ±1% 100kΩ/50kΩ resistors and the INL/DNL error of the MAX5160L (±4.6%, max.).

There is an interesting point to note. The limit for stability in this circuit is reached when KP ≥ 2/3, i.e., when the positive feedback fraction meets or exceeds the negative. The host processor controlling the MAX5160L should, therefore, prevent

this situation from occurring.

The circuit in Figure 5 uses digital pots as an obvious alternative to a traditional approach for volume control. All codes are valid, with settings ranging from 0dB to full attenuation.

Table 1 shows the calculated attenuations based on the MAX5160L's 32 steps.

Table 1. Calculated results of Figure 3 circuit

Code Setting

Attenuation

0.00

16

-6.31

1

-0.28

17

-6.90

2

-0.58

18

-7.55

3

-0.88

19

-8.24

4

-1.20

20

-9.00

5

-1.53

21

-9.83

6

-1.87

22

-10.74

7

-2.22

23

-11.77

8

-2.59

24

-12.93

9

-2.98

25

-14.26

10

-3.38

26

-15.85

11

-3.81

27

-17.79

12

-4.25

28

-20.28

13

-4.72

29

-23.81

14

-5.22

30

-29.83

15

-5.74

31

Full attenuation

Figure 5. Traditional volume control design (1 channel shown) has drawbacks.

Notice how the attenuation figures are spread. There is less than 6dB total variation over the first 15 codes and less than 1dB over the first four. This is not particularly useful. Interestingly, even when choosing a part with a far larger number of taps,

you still only get 6dB variation over half of the codes.

To address this problem one approach selects a subset of the codes available to achieve a reasonably constant dB/step figure. For example, using only those codes highlighted in Table 1 gives roughly 3dB/step up to code 29, allowing 11 settings. This can work

well if the digital pot chosen has many tap positions (256 or higher). However, parts with that flexibility are generally more expensive. Given that the majority of the tap positions will not be used (unless, perhaps, when interpolating between volume settings),

it would seem more efficient to try and utilize more of the existing taps with a different topology.

Resistively loading the wiper of a linear pot to "bend" the characteristic is an old trick. The load resistor is usually about 1/20th the value of the linear pot resistance. There are two disadvantages of applying this method with a linear' digital pot: the

Figure 6 shows the idea.

Figure 6. This configuration with a resistive load creates an equivalent fixed-resistor for clarity.

The circuit of Figure 7 yields a traditional volume-control characteristic, much like that of Figure 5. However, this design uses a little positive feedback to even out the step sizes to roughly 1.6dB/step over most of its useable range.

An immediate disadvantage of this design is that the negative feedback fraction (KN) has to be 0.5 or higher for this approach to yield usable results (although 0.25 would be the limit of stability). In simple terms, we have already thrown away around

half the available codes just so the circuit can operate. However, the remaining 17 codes are all used (no gaps as in the Figure 6 example), as indicated in

Table 2 below. The third column lists the delta in step sizes, showing how consistent they are over the majority of the attenuation range.

Figure 8 shows the linearising effect, with gain in dB on the Y-axis plotted against tap number on the X-axis. This data compares favorably with the circuit of Figure 6, where the highlighted values gave roughly 3dB steps and only 11 settings.

Figure 7. This near-constant dB/step topology (1 channel shown) is an improved design.

One side effect of this topology with the values shown is that there will be a 6dB

Table 2. Calculated results of Figure 7 circuit

Gain

(Delta)

<(Delta)/td>

6.88

-5.60

1.61

5.19

1.68

-7.32

1.71

3.60

1.59

-9.17

1.86

2.06

1.54

-11.25

2.07

0.56

1.50

-13.65

2.40

-0.93

-16.59

2.94

-2.44

1.51

-20.53

3.94

-3.99

1.55

-26.95

6.42

32

Fully off

Figure 8. Stereo, cascaded traditional volume control, more = better?

The circuit of Figure 9 uses a total of four MAX5160L digital pots to produce a high-resolution, stereo volume control. The number of possible valid codes per channel is greatly increased, giving 32 x 32 or 1024 attenuation codes. Again, the

end-to-end resistance tolerance does not have any first-order effect because of the buffering between the two digital pot stages. L-R tracking is only limited by the tap-to-tap matching accuracy. The wiper resistance has little loading effect, as each wiper

sees a high-impedance op amp input.

Figure 9. This design uses MAX1560L digital pots to produce high-resolution stereo volume control.

Of the 1024 codes, some give duplicate attenuation values. For example, the first pot is at -6dB and the second is fully up, thus giving -6dB overall. This is the same as first pot fully up and the second at -6dB., Moreover, if either pot is set to full attenuation,

any setting on the other pot is irrelevant, all of which leaves something like 348 unique attenuation settings from 0 to -60dB (actually -59.66dB).

To map the codes to an attenuation figure, some sort of simulation or spreadsheet approach would seem appropriate.

Figure 10 shows the spread of attenuation obtained, including duplicate values.

Figure 10. Spread of attenuation obtained from the design of Figure 9.

Figure 10 demonstrates that most of the codes give attenuation values between 0 and -40dB. The delta, or dB step size between each attenuation value, can be plotted in a manner similar to that in Table 2 (Figure 11). This gives a visual indication

of the granularity of the steps.

Figure 11. Plot shows the delta in dB of the step size between each attenuation value for the codes generated by the Figure 9 circuit.

The granularity of the steps appears very evenly distributed with differences in most of the steps well under 0.5dB, only reaching 1dB at -41.6dB, and with the penultimate 6dB step between -53.6 and -59.6. Repeated codes appear on the graph as zero delta figures.

This yields the kind of control range and granularity required in the most exacting audio level controls.

There are, however, limitations to this approach too. Obviously, this circuit has a reasonable control overhead, perhaps using lookup tables to retrieve values and using some kind of ranging algorithm to obtain smooth volume transitions. Unlike the circuit

in Figure 4, however, there is no conditional stability situation so any combination of codes is fine. More seriously, variations in the tap-to-tap resistor matching between the first and second digital pots could mean that monotonicity is NOT guaranteed.

In theory, while the cascaded circuit of Figure 9 seems to give impressive results on initial investigation, the practical implementation of the circuit can be problematic.

The circuits of Figures 5 and 6 probably give the best compromise between price, complexity and performance for most situations. Controlled using a 3-wire interface, Maxim also offers the

繼續閱讀