ADC Error with NRF52832

I have used ADC Channel 6 (P0.30) for voltage measurement using NRF52832. Previously It was working well. Now it is returning an error.


00> [00:00:00.398,345] <err> adc_nrfx_saadc: Selected ADC reference is not valid


This is where I have configured my adc parameters in the overlay file.

/ {
    zephyr,user {
        io-channels = <&adc 6>;
    };
};

&adc {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@6 {
reg = <6>;
zephyr,gain = "ADC_GAIN_1_6";
zephyr,reference = "ADC_REF_VDD_1";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,input-positive = <NRF_SAADC_AIN6>; /* P0.02 for nRF52xx, P0.04 for nRF5340 */
zephyr,resolution = <12>;
};
};

  • Hi Thishon,

    At a glance, there is nothing wrong with the configuration you posted here. You said it worked and then stopped at some point. Can you check what change is made then? If you have version control, then you should be able to trace back the history.

    Hieu