nrf52833 and external SPI ADC (ADS124S08)

We are using an external SPI based ADC (TI ADS124s08) with the nrF52833 and NCS. I see there was a driver written for the ADC API for the ADS114s0x which is very similar. I can't seem to find an example on how to setup DTS to use this driver and take ADC readings. Is there any example on how to setup and use the ADS114s0x ?

Thank you in advance.

Parents
  • Hello,

    There do not seem to be any samples or boards utilizing this devicetree binding. I searched through the SDK with the keyword 'ti,ads114s08' to find any boards using this 'compatible', but I only found DT overlays that are used for testing.

    Please try the Analog-to-Digital Converter (ADC) sample using an overlay that looks something like this:

    / {
    	zephyr,user {
    		/* adjust channel number according to pinmux in board.dts */
    		io-channels = <&ads114s08 0>;
    	};
    };
    
    &spi1 {
        compatible = "nordic,nrf-spim";
        ads114s08: ads114s08@0 {
            reg = <0>;
            compatible = "ti,ads114s08";
            #io-channel-cells = <1>;
            drdy-gpios = <&gpio0 3 0>;
            spi-max-frequency = <8000000>;
            ads114s08_gpio: ads114s0x_gpio {
                compatible = "ti,ads114s0x-gpio";
                gpio-controller;
                ngpios = <4>;
                #gpio-cells = <2>;
            };
        };
    };
    
    /* Optional: disable built-in SAADC*/
    &adc {
        status = "disabled";
    };
    

    And add 'CONFIG_ADC_INIT_PRIORITY=80' in the prj.conf to ensure the SPI is initialized before the ADC.

    Best regards,

    Vidar

Reply
  • Hello,

    There do not seem to be any samples or boards utilizing this devicetree binding. I searched through the SDK with the keyword 'ti,ads114s08' to find any boards using this 'compatible', but I only found DT overlays that are used for testing.

    Please try the Analog-to-Digital Converter (ADC) sample using an overlay that looks something like this:

    / {
    	zephyr,user {
    		/* adjust channel number according to pinmux in board.dts */
    		io-channels = <&ads114s08 0>;
    	};
    };
    
    &spi1 {
        compatible = "nordic,nrf-spim";
        ads114s08: ads114s08@0 {
            reg = <0>;
            compatible = "ti,ads114s08";
            #io-channel-cells = <1>;
            drdy-gpios = <&gpio0 3 0>;
            spi-max-frequency = <8000000>;
            ads114s08_gpio: ads114s0x_gpio {
                compatible = "ti,ads114s0x-gpio";
                gpio-controller;
                ngpios = <4>;
                #gpio-cells = <2>;
            };
        };
    };
    
    /* Optional: disable built-in SAADC*/
    &adc {
        status = "disabled";
    };
    

    And add 'CONFIG_ADC_INIT_PRIORITY=80' in the prj.conf to ensure the SPI is initialized before the ADC.

    Best regards,

    Vidar

Children
No Data
Related