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