Hello everyone.
Quite new to programming but I think I've detected an error in this interesting thread.
http://forum.allaboutcircuits.com/showthread.php?t=80018
instead of ((ADC*2)+1) *500 +1024 /2048
Quite new to programming but I think I've detected an error in this interesting thread.
http://forum.allaboutcircuits.com/showthread.php?t=80018
Isn't it (((ADC*2)+1) *500 +1024 )/2048Understanding ratios and ratio math!
Putting it all together.
To get a reading of 0.00v to 5.00v from the PIC ADC can be done using the correct data scaling of all samples, and properly compensated integer rounding on all samples, by the following integer math;
((ADC*2)+1) *500 +1024 /2048
Using *x of *500 means we are converting 1024 ADC units to 500 output units (which represent 0-500 ie 0.00v to 5.00v).
instead of ((ADC*2)+1) *500 +1024 /2048