Electronic – SAR ADC has non-linearity around the middle of the range

adcnon-linearsignal integritystm32

I'm using a SAR ADC in STM32L433 chip and it exhibits a strange nonlinearity around the middle of the range which I can't explain.

It's a 12bit ADC with 64x oversampling and 2 bit shift which effectively makes it 16bit.
The nonlinearity is around 32768 (2^15) which is in the middle of the 16bit range.
It's almost looks like clamping to the 32768 except that a couple of seconds later it'll cross the line nicely.
It seems like approaching the 32768 line from any side is a problem.

What could cause this?
ADC SAR Problem
ADC SAR Problem
The red line is the 32768 line for reference.
The green line is the signal. 100Hz sample rate, the measured signal is around 1Hz.

Edit: ADC specifications
enter image description here

Edit2: I did an experiment with driving the input with a ramp.(might not be linear to begin with but it was continuous)
Here is how the looks like when the fit-ed line is subtracted.
The big jump is only at the 32k. Why this is the case it still puzzles me. For now the workaround solution is to avoid this range and I'm setting up the AGC to drive the signal above it.

enter image description here

Best Answer

This was due to a too high input impedance and/or to short sample time. It did not have time to fill the sample capacitor fully.

Related Topic