Tool/software: Code Composer Studio
On my custom board I use SD24 to acquire a differential signal on A0.0+ and A0.0- inputs. The A1.0+ and A1.0- inputs are both tied to GND. VCC = 3.3V.
I use a nominal 1.25V external reference voltage to feed the input signal and the VREF input of SD24 (ratiometric acquisition). The measured reference voltage is 1.266V.
SD24 is initialized as follows:
SD24CTL = 0; // External ref SD24CCTL0 = SD24DF | SD24IE; // 2-compl. data format, continuous conv, enable interrupt SD24INCTL0 = SD24GAIN_8; // input A0, Gain=8, Interrupt on 4th sample
When I start conversions with
SD24CCTL0 |= SD24SC; // Set bit to start conversion
I count 8 conversion interrupt; in each conversion interrupt I accumulate the (short int)SD24MEM0 value to make an average conversion value at the end of the 8th interrupt, when I stop conversions with
SD24CCTL0 &= ~SD24SC; // clear bit to stop conversion
I know from the MSP430I2021 datasheet the SD24 gain tolerance (±1%) and the SD24 max offset error (2÷4 mV) in the external reference case with SD24OSRx=256. I suppose a 2.5mV offset error with gain 8. The 2.5mV offset error would give (2.5mV * 8 * 32767)/1.266V = 534 ADC offset value added to every (short int)SD24MEM0 conversion result. Indeed, with a given input signal on A0 input I see conversion values differ from the expected ones by 500-650 ADC counts.
Now, in order to compensate that SD24 offset error I tried to acquire the GND signal tied to A1 input channel with the same A0 input channel configuration. The (short int)SD24MEM1 conversion result should be (more or less) the SD24 offset error to be subtracted from the (short int)SD24MEM0 conversion results of the A0 input signal.
But in this way I get 39 as measured SD24 offset error. Also, I get 82 as conversion result with A0 signal at 0V (without compensation).
Could you please explain the reason why? Where am I wrong?