ADC M4 iMX7 outputs/reads wrong values?

Hello,

I’m running the ADC example provided in: git://git.toradex.com/freertos-toradex.git.
everything seem to work correctly except the output value of ADC.
The value does not correspond to the external source voltage connected to ADC0 input ( x14: 1 on colibri board) at all.
The value changes gradually sometimes when I change the input voltage on ADC0 eventhough I disabled the average output feature in the channel initialization struct:

    adc_logic_ch_init_config_t adcChannelConfig = {
        .inputChannel = BOARD_ADC_INPUT_CHANNEL,
        .coutinuousEnable = true,
        .convertRate = 5,
        .averageEnable = false
    };

When I connect the ADC0 to the GND of the board, the value changes gradually and stabilize on 0.80 v (instead of 0.0 v). The raw output value of “ADC_GetConvertResult” is also the same behaviour.
I can’t find out what is the problem. (btw: Cortex-A on u-boot)

Best regards,
Majd

hi @majd.m

The value does not correspond to the external source voltage connected to ADC0 input ( x14: 1 on colibri board) at all.

Is this happening only on ADC0 input or also on the other inputs?
Did you measure the voltage in Linux and checked which value did you get?

When I connect the ADC0 to the GND of the board, the value changes gradually and stabilize on 0.80 v (instead of 0.0 v).

Which GND Pin did you connect ADC0 to?

Best regards,
Jaski