The ADuCM350's error correction (i.e. no factory calibration) seems to have a problem. It gives very inconsistent results
when calibrating the TIA channel's gain correction. Specifically, I'm running amperometric.c and applying a 0.6V step across a 4 Mohm load (RCAL and RTIA are also both 4 Mohms).
I've narrowed the problem down to the call to adi_AFE_TiaChanCal() ... and specifically to these last few lines of that function (attached). If you set a breakpoint and step through the lines of code shown, you get a very different answer every time for the value of channel_gain, which is what gets written to the TIA gain calibration register: ADI_AFE_CAL_REG_ADC_GAIN_TIA.
Have you seen this problem before? Do you know what the problem is?