eblc1388 said:If one solves the equations, one would end up with a much easier method to calculate those resistor values.
Let's say:
Vmax=+12V (from +/-12V),
Vpic=5V,
Rin=10K (we have full control over this value and can choose one to suit the signal source),
Rvcc=?,
Rgnd=?
So we have just two unknown resistors to calculate.
Rvcc = Vpic * Rin / Vmax = 5 * 10K / 12 = 4.167K
Rgnd = Vpic * Rin /( Vmax - Vpic ) = 5 * 10K / ( 12 - 5 ) = 7.143K
That is certainly easier way to calculate it.
One way of looking at it is that when the input is at +12V, the output should be at 5V, so there is no voltage across Rvcc and its value is irrelevant, so Rgnd can be calculated on its own.
Then when the input is at -12V, the output should be at 0V so the value of Rgnd is irrelevant and Rvcc can be calculated on its own
I hadn't thought of that earlier.