# EPOT Applications: Gain Adjustment in Op-Amp Circuits

## General

## Non-Inverting Configurations

*Figure 1a. Circuit 1.*

*Figure 1b. Gain of circuit 1 with Re = 50k and Ri = 10k.*

*Figure 2a. Circuit 2.*

*Figure 2b. G(N) for circuit 2.*

## Inverting Configurations

*Figure 3a. Circuit 3.*

*Figure 3b. G(N) for circuit 3 with Re = 50k and Ri = 10k.*

*Figure 4a. Circuit 4.*

*Figure 4b. G(N) for circuit 2 with a 256 tap EPOT.*

## Linearizing Circuit 4's Gain with Resistors

*Figure 5a. Circuit 5.*

*Figure 5b. G(N) for circuit 5 with Ri = 50k and Rf = 100k (yellow). G(N) for circuit 4 is also shown (blue) for illustration.*

## A Design Example using Software Compensation to Linearize Gain

- No current through the wiper.
- A linear gain adjustment curve with better than 3% error. This is better than 1 LSB for a 32 tap EPOT.
- Eliminate any dependence on absolute resistance Re.

**Pick a maximum and minimum gain.**For this example a minimum of 2 and a maximum of 10 was chosen. Empirical testing shows that this method works pretty well for gains of up to about 20.

**Find the actual possible maximum gain.**The actual maximum gain is the gain that will be a solution to the equation G(n) = n/(256 - n) n = 0, 1, 2...

**Get the slope m.**The slope m could also be called the step size, as it will correlate to the gain steps between values of n. The recommended method is to use the average gain change over the last 5 values of n in the range of interest. In other words,

_{max}) - G(n

_{max}-5)]/5 The decision to use the last 5 values is somewhat arbitrary and the designer is encouraged to experiment with other values. For this example, m = [G(233) - G(228)]/5 = 0.398.

**Find the actual possible minimum gain and the number of steps.**In order to be certain that the minimum gain is a possible solution to the line being created, the equation for y = mx+b can be solved. Since a discrete system is being used, simply find the number of steps between the max gain and the expected min gain (chosen in step 1), where

_{max}) - G

_{min}]/m. For this example, max steps = [10.13 - 2]/0.398 = 20.4. Once again, only a discrete number of steps is available, so round up the result to increase the maximum number of steps to 21. Therefore, the actual minimum gain is going to be 21 steps of 0.398 each less than the maximum gain or

_{max}) - (max steps) × m = 10.13 - (21 × 0.398) = 1.772.

**Get the intercept b.**The value for b or the y intercept is simply the min gain.

*Figure 6. Gain curve for software compensated example.*

*Figure 7. Deviation from ideal as a percentage.*