# ADC inputs - are they *really* 12-bit?

I am reading voltages on AIN0 and AIN1, the voltage on the pins is
almost exactly 0.9 volts, I have measured it quite carefully with a
multimeter and this is the voltage I would expect given the dividers
I'm using.

The raw value from the ADC is 896 (plus or minus a count or two). It
really is reading the voltage as, if I increase or decrease it a
little, the reading goes up and down.

However this means that the ADC actually has a full scale reading of
only around 1800 for 1.8 volts, that's not a 12-bit ADC it's closer to
an 11 bit one.

Is the ADC set up so that the reading actually represents the voltage
(i.e. 1800 is 1.8 volts)?

Anyway I think the specification misrepresents the ADC accuracy.

cl@isbd.net wrote:

I am reading voltages on AIN0 and AIN1, the voltage on the pins is
almost exactly 0.9 volts, I have measured it quite carefully with a
multimeter and this is the voltage I would expect given the dividers
I'm using.

The raw value from the ADC is 896 (plus or minus a count or two). It
really is reading the voltage as, if I increase or decrease it a
little, the reading goes up and down.

However this means that the ADC actually has a full scale reading of
only around 1800 for 1.8 volts, that's not a 12-bit ADC it's closer to
an 11 bit one.

Is the ADC set up so that the reading actually represents the voltage
(i.e. 1800 is 1.8 volts)?

Anyway I think the specification misrepresents the ADC accuracy.

OK, I found out what was misleading me. The ADC values that I'm
seeing are the BBB's "non raw" ones which are scaled to be (as I
guessed) the voltage in mV.

However I can find very little guidance on how to read the actual raw
values, especially from Python. I want to scale the values myself and
using the already scaled 0-1800 values would mean I'm losing a bit of
accuracy.

Can anyone point me at some Python (or even C if you like) code to
read the real, raw, values?

I only know this example: