Jay.slovak said:
But now when I think about it, it should be like this:
Code:
2.5V = 11 1111 1111b
1.248V = 01 1111 1111b
=
0.00244 = 00 0000 0001b
0 = 00 0000 0000b
ADres*Uref/2^10=Voltage
Example:
511*2.5/1023=1.248V
I got it.
When you said 2.5V = 11 1111 1111b, this is a condition you want to achieve. In order to get his condition, you need to use a slightly higher reference voltage.
So using a reference of 2.5x1024/1023 = 2.5024V.. would be good.
But if you use a 2.5000V reference, I am afraid 11 1111 1111b would be 2.49756V and not 2.50000V. Of course, in real life, who cares.