GoodMorning to all,
I'm developing on K20 with KDS 2.0.0 and KSDK 1.1.0
I do many test...I try the 12 and 16 bit mode , with and without continuous mode, with and without internal averaging (for disabling I need to use the HAL because PEx config and PEx high-level have not routine for disable it)
I use the Dithering with about 200mV of amplitude (that is about 50 count on 12 bit).
I use a custom HW for acquire one value of resistence.
I have a problem: I found some problem of not linarity and a "step" of about 7 count on 12 bit (cross the 1024 bit = 2^10 maybe is the crossing of new bit) that is very clarity enabling dithering!
other this problem I found a very not stable acquired value on 12 bit,.
I Calibrate my HW each time (both the ADC internal calibrating and our external HW for translate count to ohm)
And another big problem is that we have not a similar error in all point of the count range but a very strange and variable error!
We use all double for math calc during averaging
On 16 bit with dithering we have a different behaviour: all work right and we have a very stable value and small error.
There are know problem with K20 internal ADC?
there is something that I can do?
This graph shows the variable error of count and ohm between the count / ohm acquired by ADC and the count / ohm extimated with interpolation
I do not have a constant error so a new calibration can't resolve it
error ( in ohm) using 12 bit (blue) and 16 bit (red).
I do many many many of this graph in different acquisition of 16 bit and different acquisition of 12 bit with different confguration-.
the result is the same: 12 bit is very very very big AND not constant!
You can see the RED error (16 bit) that is a clarity NOT-LINEARITY-ERRO and is above zero before "4" (that are 800ohm, the first calibration point) and belove zero until "11" (that are 1500 ohm, the second calibration point) after that return positive.
the 12 bit error is very big and haven't a typical distribuition.
(the value of 12 bit are an average of acquire)
different try of 12 bit configuration: the error remain the same with the same strange shape of error
this graph shows 600 puntual count that are averaged in a 600msec period for calculate a correct value to use.
As you can see the dither moves the count acquired: averaging tham I can have a more precise value.
but... as you can see...there is a step crossing 1024 bit
another graph of dithering with step
the same graph but crossin another count value: there is no step!
One of the PEx configuration ( i try many combination of them)
Edit: modify link to photo