1. I have a microcontroller with 10 bit adc. Adc ref voltage is 5Vdc.
So its resolution would be: 5V/1023.
Now in my system I have three segment display & max reading upto 99.9V. So that means I have to measure voltage with 0.1V resolution.

2. Can I measure the system upto 99.9Vdc with 0.1V accuracy using 10bit adc?

Thank you ericgibbs
I was trying to clarify that if the Vdd is not stable due to circumstances, the measured voltage might not be accurate.
for example in the circuit I am making, 5V is used to drive LED in PWM and driving buzzers and the sort might cause the Vdd to fluctuate. If Vdd fluctuates so would the Vref (if Vref is Vdd).
I gave this a lots of thought and my thinking was to make the Vdd rock solid and exactly 5.00V.
I admit I have yet to confirm this.

Making a 5V reference off a 5V supply is quite a complex problem. Making a lower voltage reference is quite simple, which is why you will find many 4.096 or 2.048 volt reference ICs that are inexpensive and quite accurate.

Don't forget the quantization error. An easy way to illustrate this is say you had something that had a range of 0 to 100 and +- 1 count At 1 "bit" you have +- 1 count. so it's a 50% error. At 100, you have +-1 count and it''s closer to a 1% error. The low end gets skewed.

3. This LM7805 also drives 6 segments. 3 for each voltage reading. Each segment is on sequentially for 30us & off for 150us. So it forms a total time base of 900us ofr 6 segments.

4. Algo for sampling each channel:
A)Take 100samples. Each sample in 250us.
B) Add them & average them out & store the result
C) Then 25 such sample reading are taken as obtained from (B)
D) Now arrange these 25 samples in ascending order. Reject lowest 5 & highest 5. Then again take average of 15 remaining.
E) Get voltage reading by formula: voltage=(result * 5)/1023.0f
F) Apply divider: voltage * 20

1. Will use resistor as 5% only in this project.
2. But reduced the range 0V-35V. Now will use the divider ratio: 78K:2K. This makes system upto 40V, 5V keeping upper margin.
3. Algo will be used as in last post.
4. One time calibration will be done: two point calibration. Calibration will be done at two voltage levels: 5V & 30V to remove any offset & gain errors.
5. Made the board will see results

4. Algo for sampling each channel:
A)Take 100samples. Each sample in 250us.
B) Add them & average them out & store the result
C) Then 25 such sample reading are taken as obtained from (B)
D) Now arrange these 25 samples in ascending order. Reject lowest 5 & highest 5. Then again take average of 15 remaining.
E) Get voltage reading by formula: voltage=(result * 5)/1023.0f
F) Apply divider: voltage * 20

Click to expand...

A. Each sample need not be stored, just sum into one variable. Averaging here rather than later earns you nothing but extra work. if you gather 128 samples your averaging is easier.
B.
C. 16 or 32 remaining samples is simpler to compute.
D. One need not sort to find the highest and lowest values.
E. since your decimal point is well known you can compute the voltage x 10 and avoid floating point math altogether.

Nothing necessary to do here, just some tweaks and efficiency improvements.