I'm trying to understand the readings I am receiving from the analog to digital converter (ADC).
I am using an integrated uIceblue2 microcontroller. The microcontroller in the circuit is a 18F4550. In the manual of the uIceblue2 microcontroller it says the an analog range from 0 to 3.3v +/-0.8V
. It is a 10 bit ADC.
Page 16 of the manual shows the specifications for the analog voltage http://www.saelig.com/supplier/emxys/EMN0210_WE_uIceBlue2_Getting_Started.pdf
EDIT: I realized that I wasn't reading my ADRESH. So when I received 1V, my ADC readings ware 1070 or 1090.
Below are some readings I'm getting from the ADC when I apply a given voltage to the analog input. I am using Docklight to read my results in decimal. I receive to outputs for each result, which I believe coordinate to the ADRESH and the ADRESL. The first group of three digits is the ADRESH and the second group of digits is the ADRESL.
- 0.055V -> 000 020 to 000 031
- 1V -> 001 070 to 001 090
- 2V -> 002 139 to 002 160
- 3.3V -> 003 255
- 3.4V -> 003 255
- 3.5V -> 003 255
My questions are:
Why is there so much variability in the range of the voltage? I thought that 10 bit resolution was quite high and there for the numbers should be constant. For example, I would expect to get a fixed reading of 90 in a row, or a variation of at most 1 in the value, between 89 to 91.
I'm using the following formula to convert the reading back to the voltage, but I don't think it is correct for calculating the voltage from ADC reading.
Is it possible it is already converting to volts?
Should I post my code?
$$Input\,Voltage = Digital\,Reading \times \frac{Voltage\,Range}{Number\,of\,Bits}$$
Could someone please guide me to the correct formula?