16univin: i2c register for raw ADC reading?

talpha

New member
I have been looking for an new ADC HAT and I've recently bought one of your 16 Analogue/Digital universal inputs HAT. It's another excellent piece of hardware from Sequent Microsystems, thank you very much for making it.

I'm writing my own bit of python3 that reads from the registers with smbus2. Thanks to your clear example code I was happily printing voltage readings within a couple of minutes. Thank you doubly! The factory calibration is pretty accurate too.

The registers (words in 6-37) contain the analogue voltages in millivolts, i.e. the integers clocked out will nominally be in the range 0...10000.
By cautiously sending up to 11V to an input (the spec says max input 12V) the range of readings I've seen is 7 - 10664 mV.

The hardware description says it's a 12bit ADC, so I would expect the raw readings to be 0...4095. Clearly some calculation has already gone on to scale these up to 10k. As the calculation results are only recoverable as integers (not floats), there is some loss of precision due to rounding error.

To have a bit of fun / squeeze out the last drop of precision from this card, is it possible to clock out the raw readings? Is the buffer between the ADC and the onboard processor available to the pi? I'm hoping there is another register range that contains these values already, but looking at the register allocations there isn't an obvious gap of 24 or 36 bytes. I had a play reading from 223 and above but wasn't surprised when all of those read 0.

Or, is this a counterproductive persuit if there is already a significant layer of non-linear calibration since the raw values?

Many thanks
 

alexburcea

Moderator
Staff member
Hi,

Thank you for your kind words.
Unfortunately, there is no access to the ADC raw values, even it was the card inputs are specified 0-10V , A max input 12V means it will not be damaged if you apply 12V but it will not be able to measure it properly. If you look at the schematics you can determine that the ADC will be overflow at about 11V, which is why you can not measure more. We do not limit the output value in software, we apply the transfer function, including calibration, and output the value.

Alex.
 

talpha

New member
Hey Alex,

Thanks for confirming. I will enjoy the readings in their easy-to-use post-convertion beauty!

(I should have said above, my test results of the linearity ending a little over 10V are as expected. It is good that it performs through the bounds of nominal range.)
 
Top