Apalis IMX6 ADC not consistent

Hi

i am trying to read the ADC value from the board but the value seems to fluctuate quite a lot.
I tried using the multimeter to probe the pin for the ADC input, from the multimeter the value is very consistent.
Below is the values i get from the ADC. The multimeter shows a consistent 2.872V.

alt text

As you can see the lowest value read is 2329 and the highest read is 4045.
With the calculation the difference is

2329 X 0.805mV = 1.874 V

4045 X 0.805mV = 3.256 V

Hi @jy.teh

Could you provide the version of the Software of your module?

There was an issue regarding ADC which is solved now. Please read also this.

Best regards,
Jaski

I build my own kernel with some changes.

The linux image is Apalis-iMX6_Qt5-X11-Image 2.8b6 20190913
The Kernel Version is 4.9.166

Thanks for your Input. Did the patch in the post above help?

Best regards,
Jaski

Hi Jaski

Sorry for the late reply.
I- tried using the kernel that you suggested but the adc value is still not consistent.
alt text

The kernel that i am using is 4.9.166-00045-g820c9b6. It is build using the branch
alt text

Attached is the dmesg logs from my system.
link text

hi @jy.teh

As I can see now, the values are changing very less. You will always see some variation depending on the resolution of ADC which is 12 bit in our case. When you calculate the value in Volts then you will see that the variation is really minimal.

Best regards,
Jaski

Hi Jaski

The result in the previous comment is measuring 0V. When i connect the device that I want to measure the ADC values the results varies a lot.

Refer to the screenshot below.

alt text

The red box is when i turn the device connected to the ADC pin the adc reading value in the green box varies from 4053 to 2899.

HI @jy.teh

Could you measure the voltage at the same moment with an external device, when you turn on the device and check if the values given by ADC are similar. For me this looks as a system problem, as in general the values are correct.

Best regards,
Jaski

Hi Jaski

You are right!

I used an oscilloscope and found that the voltage line is fluctuating.
I will investigate why the voltage line is fluctuating.

Thanks for your Input. We will wait for your results.

Best regards,
Jaski