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?

Read from:
/sys/devices/ocp.*/44e0d000.tscadc/tiadc/iio:device0/in_voltage*_raw

Python code:
https://github.com/cdsteinkuehler/linuxcnc/blob/MachineKit-ubc/configs/ARM/BeagleBone/BeBoPr-Bridge/ReadTemp.py#L307

I only know this example:
http://beaglebone.cameon.net/home/reading-the-analog-inputs-adc

re,
wh

Brilliant, thank you! That's just what I needed to get me going in
the right direction. I'd been wondering how to read the raw values
directly using Python and hadn't realised that the obvious way to do
it is to use Python's file reading ability, no need for system() calls
or anything nasty like that.

I can bin all the IO libraries now, much happier doing it direct.

Thanks again.