Because eight bit mircocontrollers lack floating point instruction
Part I: The voltage divider.
Because eight bit mircocontrollers lack floating point instructions using floating point can consume a lot of processor cycles.
In this article I will illustrate how to measure up to 100VDC with an analog to digital converter, ADC, with a positive voltage reference of 5V, +Vref, and a negative voltage reference at gnd -Vref.
The input to the the ADC must never exceed the 5V value of +Vref. We can use a simple voltage divider to accomplish this. To...
wouldn't the vpc = 100v/1023, since the max count is 1023 at 100v? Which would be .0975 vs .0976, not a big deal at this range, but might be if you were scaling a 12v input and needed more precesion. I just did a voltmeter project where my reference was 1.024V and I needed to read precesion millivolt readings. the max input of which was 1.010V, and the extra count would have made a big difference.
but why risk blowing up your PIC chip on a voltage surge. External clamping really is needed here, especially if you are interfacing your controller pin to the outside world. The internal clamps are puny and if the energy of the surge is too great, you also risk blowing up anything else connected to the 5V pic supply.
Also, your 1k/19k divider is pretty much the max impedance your ADC wants to see on the input. Most ADCs call for an impedance of 1K or less. Your divider yields an impedance of 952Ω.