Tool/software:
Hi keith,
My customer has executed your suggested changes, applying the 24→32 sign-extension approach you recommended produced an improvement in their results.
Below is a comparison table showing the TINA simulated voltages, the previously decoded voltages (when the 24-bit ADC result was misinterpreted)
The new voltages (with proper two’s-complement sign extension). It includes deviations (calculated − TINA) so you can see the change.
st= ADS1231_ReadRawData(&pins,&adcdata_out,500,1000); |
||||||||
Sl.No |
Resistor network |
TINA (µV) |
Prev counts (type) |
Prev volts (µV) |
Prev deviation (µV) |
New counts (type) |
New volts (µV) |
New deviation (µV) |
1 |
820k / 10 Ω / 200k |
88.2 |
50,634 (uint32_t) |
77.773824 |
−10.426176 |
53,702 (int32_t) |
82.486272 |
−5.713728 |
2 |
820k / 6.8 Ω / 200k |
60 |
30,840 (uint32_t) |
47.37024 |
−12.629760 |
34,183 (int32_t) |
52.505088 |
−7.494912 |
3 |
820k / 1 Ω / 200k |
8.8 |
4,294,965,869 (uint32_t) |
6,597,067.57 |
6,597,058.77 |
1,365 (int32_t) |
2.09664 |
−6.703360 |
4 |
820k / 18 Ω / 200k |
158.82 |
98,376 (uint32_t) |
151.105536 |
−7.714464 |
100,870 (int32_t) |
154.93632 |
|
The least significant bit (LSB) has more full conversions of fully settled input and has weight of (0.5*3.3)/128/(2^23 - 1) = 1.536nV: For Vref = 3.3V
Short analysis:
They still see small residual deviations on the order of a few µV.
Could you please share your view on whether these are most likely tied to the ADS1231’s offset (~10 µV), resistor tolerances, or wiring/grounding influences?
Or
Do you believe these would normally be resolved once a proper system-level offset and gain calibration is performed?
And also could u please review their full code, read/conversion flow and advise/provide reference routines for the following?
- Read / conversion routine
- Best-practice ADS1231 read routine.
- Safe method for 24→32 sign-extension
- Confirmation of the canonical approach and any corner cases to watch for.
- Tare handling
- Recommended method to capture/store tare counts (averaging method, persistence if needed, atomic update to avoid races).
- Factory calibration (offset & gain/span)
Please Suggested production calibration flow to correct offset (~10 µV) and gain error (one-point or two-point), recommended number of averages, resistor tolerance recommendations, and kindly share the example code for all above and applying calibration constants in firmware.