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>;
};
};

Parents
  • That error usually points to an invalid reference configuration in the device tree. For the nRF52832, ADC_REF_VDD_1 isn't a valid option — it's typically only available on some newer SoCs like nRF5340. Try switching the reference to ADC_REF_INTERNAL or simply omit the zephyr,reference property to use the default internal reference voltage (0.6V).

    Also, double-check that NRF_SAADC_AIN6 (which maps to P0.30 on nRF52832) is correct and not being used by another peripheral like NFC or GPIO without proper configuration.

    Side note: If you ever need a quick and clean way to convert YouTube videos to MP3 or MP4 for tutorials or debugging logs, y2mate has been super handy for me.

    Good luck debugging!

Reply
  • That error usually points to an invalid reference configuration in the device tree. For the nRF52832, ADC_REF_VDD_1 isn't a valid option — it's typically only available on some newer SoCs like nRF5340. Try switching the reference to ADC_REF_INTERNAL or simply omit the zephyr,reference property to use the default internal reference voltage (0.6V).

    Also, double-check that NRF_SAADC_AIN6 (which maps to P0.30 on nRF52832) is correct and not being used by another peripheral like NFC or GPIO without proper configuration.

    Side note: If you ever need a quick and clean way to convert YouTube videos to MP3 or MP4 for tutorials or debugging logs, y2mate has been super handy for me.

    Good luck debugging!

Children
No Data
Related