Pick R1-R2 for, say, a 9v drop, per the data sheet formula.
(R1 + R2) V = Vref * --------- R2
Then you'd make the impedance of that R1-R2 low enough to drive the TL431 input's bias current without significant error. I(bias) = 4uA. That gives you R1 and R2.
Next you'd pick a series combination of R3-R4 that provides the TL431 with at least 1mA of idle current wherever you want it to work accurately. The LMV431 is better--it'll do this job on
80uA and has just 0.5uA input current (Vref = 1.24v for that part though--don't forget this when calculating R1-R2).R5 isn't critical.
Note that this circuit craps out at low Vin since, ultimately, R3-R4 won't provide the TL431 with enough bias current for the IC to regulate accurately.
You could improve that by dropping less voltage across the TL431, leaving some drop across R3-R4, and removing the offset voltage in software, and/or by using the LMV431 instead of the TL431.
We'd usually just use an op-amp difference amplifier for this job:
R1 R2 Vin >----\\/\\/\\/----O----\\/\\/\\/---. | | | === | |\\ GND '---|+\\ | >---------O--\\/\\/\\/--> Vout .---|-/ | R5 | |/ | (a/d protection) | | +9v >---/\\/\\/\\----O----/\\/\\/\\------' R3 R4
R1=R2=R3=R4, precision resistors.
If you want a floating DVM supply for one of those little LCD DVM modules, just make a little floating supply, like the cap-coupled charge-pump thingie at the bottom of this web page:
Best, James Arthur