InvaderZim
Senior Member
Hi all, quick one about ADC math:
When using the 5V power supply, I'd thought a readadc10 value could be converted to voltage by the equation:
volts = 5*value/1023
where 'value' is the ADC reading, a number from 0-1023.
Therefore, the highest value read would be 5*1023/1023 = 5.000V, assuming a perfect 5V supply. Each 'count' is equal to 5/1023 = 4.89mV.
*Is this correct to this point?*
Using FVRsetup, you can change the reference to 1.024V, which makes the equation 1.024*value/1023, and therefore the highest reading is 1.024V. Each count is 1.024/1023 = (a little over 1mV).
If these equations are correct, why is it a 1.024V reference and not a 1.023V reference? It seems the math would be easier if it were simply 1mV per count. Perhaps it is too small a difference to matter; or perhaps I just have the math wrong.
Thanks!
When using the 5V power supply, I'd thought a readadc10 value could be converted to voltage by the equation:
volts = 5*value/1023
where 'value' is the ADC reading, a number from 0-1023.
Therefore, the highest value read would be 5*1023/1023 = 5.000V, assuming a perfect 5V supply. Each 'count' is equal to 5/1023 = 4.89mV.
*Is this correct to this point?*
Using FVRsetup, you can change the reference to 1.024V, which makes the equation 1.024*value/1023, and therefore the highest reading is 1.024V. Each count is 1.024/1023 = (a little over 1mV).
If these equations are correct, why is it a 1.024V reference and not a 1.023V reference? It seems the math would be easier if it were simply 1mV per count. Perhaps it is too small a difference to matter; or perhaps I just have the math wrong.
Thanks!