L4978 voltage regulator feedback resistor values
The chip will be happy when the feedback voltage on pin 8 is 3.3 V. So for a 3.3 V output set the upper resistor, R3, to zero. Any other voltage can be obtained by simple voltage divider using R3 and R4.

The sample circuit uses a constant 4.7k for R4 and at 3.3 V there will be 0.7 mA flowing through it. For 6 V you will want the output 2.7 V higher than 3.3 V and since we know the current we can calculate R3.

R4's value will be mid-range. Too low and it will waste current. Too high and it may be loaded by pin 8 or susceptible to noise.



We can work out the formula. The relationship between \$ V_F \$, the feedback voltage on pin 8, and \$ V_O \$, the output voltage is given by

$$ \frac {V_F}{V_O} = \frac {R4}{R3+R4} $$

Rearranging we get

$$ V_O R4 = V_F(R3+R4) $$

$$ (V_O - V_F) R4 = V_F R3 $$

$$ R3 = \frac {(V_O - V_F) R4}{V_F} $$

Sample test for 12 V out:

$$ R3 = \frac {(12 - 3.3) 4k7}{3.3} = \frac {40k9}{3.3} = 12k4 $$

The datasheet recommends the nearest E12 value of 12 kΩ so our maths looks right.

We could work out the error with this rounding from

$$ V_O = \frac {R3 + R4}{R4}V_F = \frac {12k + 4k7}{4k7} 3.3 = 11.7 \, \mathrm V$$

You can keep on going with this by examining the conditions with max and min combinations of resistor tolerance and \$ V_F \$ for the chip but most of us would be happy enough with 11.7 V.