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
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