Here's a more detailed explanation of how you would normally use a DAC to control a voltage regulator. You mentioned you were interested.
The generic schematic that applies to any adjustable voltage regulator is below.
![schematic](https://cdn.statically.io/img/i.sstatic.net/LAXyR.png)
simulate this circuit – Schematic created using CircuitLab
Basically, the voltage regulator is a servo loop that tries to maintain \$V_{ref}\$ to match whatever its internal reference voltage is. That is, the VREG will raise its output voltage so that the "ref" node in the middle of the \$R_f + R_g + R_{dac}\$ divider = internal voltage reference. (Warning: some regulators are "upside down". More on this later.)
In this circuit, we are using the DAC to source or sink current into or out of the ref node.
You should also realize that this is an excellent application of a KCL equation, Kirchhoff's Current Law. All you need to know is:
- \$V_{ref} = 1 V\$ -- or whatever your VREG's internal reference is
- All currents into "ref" sum up to 0
- Ideally, current into "ADJ" pin of the VREG = 0
So, let's try a simple example. Let internal \$V_{ref}= 1V\$, \$R_g = 2k\Omega\$, \$R_f = 3k\Omega\$, \$R_{dac} = 4k\Omega\$
Let's say our DAC is putting out 0 Volts:
\$I_{Rg} = V_{ref} / R_g = 1V / 2k\Omega = 0.5 mA\$
\$I_{Rdac} = \frac{Vref - Vdac}{R_{dac}} = \frac{1V - 0V}{4k\Omega} = 0.25 mA\$ -- our DAC is pushing current into the ref node
\$I_{Rf} = sum of the two = I_{Rg} + I_{Rdac} = 0.75 mA\$
So \$V_{out} = V_{ref} + I_{Rf} R_f = 1V + 0.75mA \cdot 3k\Omega\$, or \$\mathbf{V_{out} = 3.25 V}\$
And let's try when our DAC is putting out 2 Volts:
\$I_{Rg} = \tfrac{V_{ref}}{R_g} = \tfrac{1 V}{2 k\Omega} = 0.5 mA\$
\$I_{Rdac} = \frac{V_{ref} - V_{dac}}{R_{dac}} = \frac{1V - 2V}{4k\Omega} = -0.25 mA\$ -- now the DAC is "pulling" current out of the "ref" node
\$I_{Rf} = \text{sum of the two} = I_{Rg} + I_{Rdac} = 0.25 mA\$
So \$V_{out} = V_{ref} + I_{Rf} R_f = 1V + 0.25mA \cdot 3k\Omega\$, or \$\mathbf{V_{out} = 1.75 V}\$
With that example, you can make a spreadsheet to do the calculations for you. There are several things to keep in mind:
Ideal current into "ADJ" pin is 0, but reality is different. Check the datasheet and either account for this, or set the currents at ref high enough so I(adj) is insignificant. Note that ADJ bias current often shifts with temperature so it's good to do the latter.
Most regulators regulate their ADJ pin relative to GND, but some regulators are "upside down" so read the datasheet. For example, the LM317 maintains 1.25V between Vout and Vadj. Simply adjust the formulas for this; the DAC control works the same way.
You can get math results that show Vout < 0, or Vout > Vin. Obviously, this cannot happen. The math only works when the regulator is within its regulation range.
Anyway, I hope this helps give you and other folks a good understanding on a simple way to control a regulator using a DAC.
I see way too many engineers try to use a digital pot to control the feedback. Using a DAC is a much better way to do it: higher resolution, often cheaper, less parasitic issues, etc. Hope that helps! -Vince