Problems with ADC reading

Hi, All.

I test the ADC by measure the voltage in Linux:
cat /sys/bus/iio/iio:device0/in_voltage0_raw

and get the adc voltage by:
adc_voltage= in_voltage0_raw* (1800 / 4095)

When I connect the ADC0(X14 pin1) to the GND of the Apalis evaluation board, the adc_voltage stabilize on 2.20mv instead of 0.0v.

And the value does not correspond to the external source voltage connected to ADC0 input at all.

such as:
external source voltage 0.8v → read adc_voltage 0.67v
external source voltage 1.5v → read adc_voltage1.27v

Is any problem with adc on the Apalis evaluation board v1.1c?

Any idea please tell me.

Thanks!

There are 1k series resistors placed in the ADC lines (not on the touch interface pins) to protect the SoC input. An iMX8 ADC pins (and many others) have an internal protection diodes. Since they have some leakage it’s expected to have a few mV offset of ADC reading. So 2.1mV reading while X14 pin 1 connected to ground is expected. However offsets of your 0.8v and 1.5v measurements look too big. How exactly have you set a voltage?

Hi, @alex.tx Using the DC power supply, I get the exactly voltage by setting specific voltages.

Thanks for the update.