Does anyone know what the conversion equation is to convert the value obtained from read_adc() on a 18f4550 chip to volts DC?
Thanks
Ttelmah Guest
Posted: Wed Jul 12, 2006 7:08 am
It depends on your Vref.
(Vref/1024)*ADC_READING
Note that the divider is 1024, though the output of the ADC, is 0-1023. Also that this will need to be done in floating point arithmetic (slow and bulky). Using a scaled integer is much quicker fo most applications.
Best Wishes
krodkey78 Guest
adc on 18f4550
Posted: Wed Jul 12, 2006 10:20 am
I used the equation and it seems to be working but the voltages will not swing into the negative range. I am collecting the analog data from strain guages that are connected to a fiberglass arm. When the arm bend the resistance changes. Bend it one way and the voltage should go positive and bend it the other is should go negative. I am not sure how to read the negative values from adc. It just returns to 0. Below is the code I am using.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum