ADC not working with nr52dk nrf52832

Hi,

am having issues trying to show in the nrf connect sdk terminal the ADC program . Already made the device tree overlay for my board but still its not working. my question its is it possible to see the results on the terminal or not ? cause am not sure if have some issues this bard with the analog signals and stuff like that its mention in the adc sample page.

Regards

Rito III

  • Hi Rito,

    For us to help you with this in the best possible way, please list the following information:

    • SDK Version
    • Development Kit Version
    • Which sample do you use?
    • Do you use custom hardware or code?

    Do you have any logs of the problem?

    Have you used other nRF Connect SDK code before?

    Regards,
    Sigurd Hellesvik

    • SDK Version 2.5.1
    • Development Kit Version  Nrf52DK  3.0.0 with nrf52832 inside
    • Which sample do you use?   
    channel@0 {
            reg = <0>;
            zephyr,gain = "ADC_GAIN_1_6";
            zephyr,reference = "ADC_REF_INTERNAL";
            zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
            zephyr,input-positive = <NRF_SAADC_AIN1>; /* P0.03 */
            zephyr,resolution = <12>;
        };

        channel@1 {
            reg = <1>;
            zephyr,gain = "ADC_GAIN_1_6";
            zephyr,reference = "ADC_REF_INTERNAL";
            zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
            zephyr,input-positive = <NRF_SAADC_VDD>;
            zephyr,resolution = <14>;
            zephyr,oversampling = <8>;
        };

        channel@4 {
            reg = <4>;
            zephyr,gain = "ADC_GAIN_1_5";
            zephyr,reference = "ADC_REF_VDD_1_4";
            zephyr,vref-mv = <750>;
            zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
            zephyr,input-positive = <NRF_SAADC_AIN2>; /* P0.04 lo cambie porque se empalmaba con comm */
            //zephyr,input-positive = <NRF_SAADC_AIN6>; /* P0.30 */
            zephyr,input-negative = <NRF_SAADC_AIN4>; /* P0.28 lo cambie porque se empalmaba con comm*/
            //zephyr,input-negative = <NRF_SAADC_AIN7>; /* P0.31 */
            zephyr,resolution = <12>;
        };
    };

    • Do you use custom hardware or code? well am using the ADC example and just added the overlay to make it work with the nrf52dk as below:

     / {
        zephyr,user {
            //io-channels = <&adc 0>, <&adc 1>, <&adc 7>;
            io-channels = <&adc 0>, <&adc 1>, <&adc 4>;
        };
    };

    &adc {
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
            reg = <0>;
            zephyr,gain = "ADC_GAIN_1_6";
            zephyr,reference = "ADC_REF_INTERNAL";
            zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
            zephyr,input-positive = <NRF_SAADC_AIN1>; /* P0.03 */
            zephyr,resolution = <12>;
        };

        channel@1 {
            reg = <1>;
            zephyr,gain = "ADC_GAIN_1_6";
            zephyr,reference = "ADC_REF_INTERNAL";
            zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
            zephyr,input-positive = <NRF_SAADC_VDD>;
            zephyr,resolution = <14>;
            zephyr,oversampling = <8>;
        };

        channel@4 {
            reg = <4>;
            zephyr,gain = "ADC_GAIN_1_5";
            zephyr,reference = "ADC_REF_VDD_1_4";
            zephyr,vref-mv = <750>;
            zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
            zephyr,input-positive = <NRF_SAADC_AIN2>; /* P0.04 lo cambie porque se empalmaba con comm */
            //zephyr,input-positive = <NRF_SAADC_AIN6>; /* P0.30 */
            zephyr,input-negative = <NRF_SAADC_AIN4>; /* P0.28 lo cambie porque se empalmaba con comm*/
            //zephyr,input-negative = <NRF_SAADC_AIN7>; /* P0.31 */
            zephyr,resolution = <12>;
        };
    };

    &arduino_adc {
        io-channel-map = <0 &adc 1>, <1 &adc 2>, <2 &adc 4>, <3 &adc 5>, <4 &adc 6>, <5 &adc 7>;
    };

    Do you have any logs of the problem?

    the issue its that its not showing in the com6

    Have you used other nRF Connect SDK code before? nope, am quite new in sdk enviroment

  • Aztec_Coder said:
    Have you used other nRF Connect SDK code before? nope, am quite new in sdk enviroment

    In this case, I recommend the Nordic Developer Academy as an excellent place to start learning the nRF Connect SDK.

    When you have been able to run at least one example from that, you can return to the ADC example and see if that works then.

    When you are done with the Fundamentals Course the Intermediary Course even has a lesson for ADC which may be useful to you

Related