Achievement unlocked teaching myself things every ece freshman knows, part 938472 and a half: I grok
Thevenin's theorem well enough to prove the
R2R ladder works for digitaltoanalog conversion.
Reasoning about resistor networks as random walks actually helps quite a bit. Recall that the voltage in a resistor network (with some known voltage sources at the leaf nodes) at point P is equal to the expectation of taking a random walk (with the probability of taking a step across a resistance R being proportional to 1/R) and taking the known voltage of the first voltage source you hit.
So I can reason that
R1 R0
V1 vvvvOvvvv ...

V2 vvvv+
R2
is equivalent to
R3 R0
V3 vvvvOvvvv ...
for V3 = (V1R2 + V2R1) / (R1 + R2) and R3 = R1 R2 / (R1 + R2) from considering what happens at point O in the random walk: having a probability of (1/R1)/((1/R1) + (1/R2) + (1/R0)) of ending the walk with value V1 and a probability of (1/R2)/((1/R1) + (1/R2) + (1/R0)) of ending the walk with value V2 is the same in expectation as replacing both those posibilities with a single one whose probability is their sum, and whose terminal value is the weighted average of their values, which comes out to being V3 with probability (1/R3) / ((1/R3) + (1/R0)).
that said, if I ever want to do a project with analog output, I'd probably just buy an
Adafruit MCP4725 instead.
Oh, and I can
play around with it interactively in
this circuit simulator. Nice.