# Adjusting buck regulator with DAC

I have a buck regulator (say the TPS82085) which I would like to use to regulate a 5V supply to various values ranging from 1.2V to 3.3V. It seems that a DAC is a good way to do it (I initially thought of using a resistor network since I only need to adjust it in 300mV steps but then realized I was just building a large, crappy and expensive 3-bit DAC). This is the feedback circuit I envision: simulate this circuit – Schematic created using CircuitLab

My goal is to make it so that if I set the DAC to 0V, then I would have a 3.3V output, and if I set the DAC to 3.3V (its maximum value as it will be supplied by a 3.3V rail) then I would have a 1.2V output. The point is to make sure the downstream voltage cannot exceed 3.3V (or go below 1.2V) should the DAC be misconfigured by software. Also it gives my DAC maximum resolution.

From what I know, regulators with a feedback pin try to adjust Vout until the voltage at the feedback pin is equal to some reference voltage inside the device. For this regulator, the reference voltage is 0.8V.

By applying Kirchhoff's laws to the circuit, the voltage at the FB pin can be found to be given by

$$V_{FB} = \frac{R_2 R_3 V_\mathrm{out} + R_1 R_3 V_\mathrm{DAC}}{R_2 R_3 + R_1 R_2 + R_1 R_3}$$

So if the regulator works to force that to 0.8V, the steady-state operation of the regulator obeys

$$V_\mathrm{out} = 0.8V \left [ 1 + \frac{R_1}{R_3} + \frac{R_1}{R_2} \right ] - \frac{R_1}{R_2} V_\mathrm{DAC}$$

If I add the constraints that Vdac = 0V implies Vout = 3.3V and Vdac = 3.3V implies Vout = 1.2V then one can solve the resulting system of equations to find that the solutions are of the form

$$R_2 = 1.571429 \cdot R_1$$ $$R_3 = 0.401826 \cdot R_1$$

So for instance R1 = 100K, R2 = ~157K, R3 = ~40K would achieve the intended effect, as would any multiple of those values.

My question therefore is, is this a standard way to use a DAC to adjust regulator output voltage, and are those the calculations I should be making to find correct resistor values? Or are there additional factors that I should be taking into account? (other than resistor tolerances and Vref min/max values of course)

Maybe it's a good idea to account for the DAC output becoming high-impedance somehow? (Vout = 2.8V in this eventuality)

• why not use a multiplying DAC instead of R3? May 7, 2020 at 14:23
• Your approach is fine. There are digitally adressable PWM ICs where you can set the output voltage via SPI/I2C command, but your solution will give you more flexability in sourcing. May 7, 2020 at 14:50
• You may find a digital potentiometer useful. This seems to me like it's exactly what they're designed for. May 7, 2020 at 15:08
• @Hearth This is the same fundamental technique used in margining for power supplies; quite common. analog.com/en/technical-articles/… Digital pots are not particularly accurate and have a pretty wide variation over temperature. May 7, 2020 at 15:42
• Here is a calculator which performs the above calculations for you: fischl.de/dcdccontrol
– DSVF
May 7, 2020 at 17:16

You could try a voltage DAC. Problem is, you care about Vref if you’re working in voltage. This poses two problems:

• DAC Vout compliance range has to go below Vref
• because Vref is close to ground, this puts a bias on the max/min adjustment range.

These two problems get in the way of making that ‘idiot-proof’ range you’re seeking.

A better way is needed.

The adjustment calculation is most easily done using the sum-of-currents method to figure out the DAC-to-output relationship. This kind of points the way out of the dilemma: use current, not voltage, to set your regulator.

That said, Maxim makes a line of current source/sink DACs that are ideal for this purpose. I’m not shilling for them, but I thus far haven’t found an easier, better way to do this. Being based on current makes the adjustment simple, and they can margin up or down with practically any regulator’s Vref.

Now, how to make the adjustment ‘idiot-proof’. You set the default voltage to be mid-way between 1.2 and 3.3 (that is, 2.25V), then use the Maxim DAC current setting resistor to define the max/min current. This defines a hard margining limit above and below your set point, regardless of your Vref voltage.

If you only have a voltage DAC (or you have one available and want to use it), here's an alternative. This approach takes advantage of the fact that the low-side of the voltage divider is at Vref (0.8V), and so the two resistors (10K and 11K) in series will have a known current, and therefore the voltage at the upper 11k is also known. The 11K lifts Vref up to about 3.3V/2,or 1.68V for the adjustment point.

That is:

• I (10K) = Vref/10K (- input is at virtual 0.8V due to feedback)
• I (11K) = Vref/10K (Kirchhoff's Current Law)
• Therefore... V (adj) = Vref/10K * (10K + 11K) = 1.68V

The DAC swing, being centered on 3.3V/2, will therefore change the output symmetrically since it sinks or sources to a load that's also about 3.3V/2.

With an 11K series resistor on the voltage DAC, we get:

• DAC 3.3V gives 1.202V
• DAC 0V gives about 3.332V
• DAC high-Z gives 2.25V

Try it here.

How to find that DAC series resistance? Solve for the current you need to source/sink to/from the adjustment node for the required span. Hint: the sum of the DAC adjustment current and 7.1K feedback current is simply Vref/10K.

• Thanks, so using the DS4424 for example, to set the center point to 2.25V I'd find that I need Rtop / Rbot = 1.8125 (with I(Rtop) + I(DAC) = I(Rbot)), and then I can choose Rtop = 18.125K for example, giving a full-scale current of around 58uA, so Rfs = 133.6K and it then adjusts the current in +/- 58uA to vary Vout? I didn't quite follow what the bias problem was with a voltage DAC though, can you clarify? May 8, 2020 at 4:08
• I assume yes for the DS4424 calc (I didn't do it myself.) The voltage DAC problem, as you show in your drawing, means you have to sink and source to a Thévenin voltage of Vref, that is, 0.8V. With only a series resistor and a voltage DAC that swings between GND and 3.3V, that means adjusting 'up' (DAC Vout < 0.8V) will need a really small resistor, but this won't limit the 'down' (DAC > 0.8V) like you want. Basically, you will only get to us DAC 0 ~ 2* VREF to make the adjustment. Using the circuit I propose you get to use the whole DAC range with the bounds almost exactly where you want them. May 8, 2020 at 4:15
• I made this equivalent circuit for the DS4424: tinyurl.com/yaemqaht (shortened URL, full URL is too big), that looks right? Thanks for the explanation, I think I'll try the DS4424 or maybe a cheaper single-output part if I can find one, I'm not married to the voltage DAC by any means. May 8, 2020 at 4:30
• The DS4422 is a 2-output part, it's a bit cheaper and is the same footprint. And, good job on getting into Falstad - it's an incredibly easy and useful tool. May 8, 2020 at 4:34
• I just had one last question about this, I can't leave OUT1 (the second output) floating just in case it's somehow configured to source/sink current... but since it's already internally limited I should be good to just tie it directly to ground, right? May 8, 2020 at 7:42

How about if you constructed the feedback voltage divider with a digital resistor network: http://www.resistorguide.com/digital-potentiometer/

It's a bit of a "caveman" solution, but what the heck...