This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: ADC driven continuous read mode cannot be turned on in kernel

Part Number: TDA4VM
Other Parts Discussed in Thread: ADS8684

Hi team,

The SDK version is ti-processor-SDK-Linux-J7-EVM-08_05_00_08-Linux, the ADC being used is ADS8684.

Refer to software-dl.ti.com/.../iio:device0 to see the corresponding file and get the value of the corresponding file for the channel. However, when setting the continuous read mode, it can be set successfully before, and finally it cannot be set successfully at echo 1 > /sys/bus/iio/devices/iio\:device0/buffer/enable, and it will prompt "-sh: echo: write error: Invalid argument".

Could you help check this case? Thanks.

Best Regards,

Cherry

  • However, when setting the continuous read mode, it can be set successfully before, and finally it cannot be set successfully at echo 1 > /sys/bus/iio/devices/iio\:device0/buffer/enable, and it will prompt "-sh: echo: write error: Invalid argument

    Cherry,

    I didn't understand the above. Can you share the sequence of instructions that you are trying? I want to reproduce.

    Best Regards,

    Keerthy

  • Hi Keerthy,

    Thank you for the support.

    Can you share the sequence of instructions that you are trying? I want to reproduce.

    The device for the ADC is added to the device tree (the driver for the ADC is added), and then the device can be found under /sys/bus/iIO/devices/ to execute the following command: 

    
    
    cat /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage1_type
    le:u16/16>>0
    echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage0_en
    echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage2_en
    echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage3_en
    echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage34_en
    echo 100 > /sys/bus/iio/devices/iio\:device0/buffer/length
    The above are all good.
    echo 1 > /sys/bus/iio/devices/iio\:device0/buffer/enable
    This command will report error:-sh: echo: write error: Invalid argument
    Thanks and regards,
    Cherry
  • Cherry,

    Can you share the device tree changes that you have made.w.r.t ADC8684?

    If I understand correctly the adc ia external and not the one inside SoC?

    Regards,

    Keerthy

  • Hi Keerthy,

    Can you share the device tree changes that you have made.w.r.t ADC8684?

    &main_spi1 {
    pinctrl-names = "default";
    pinctrl-0 = <&spi1_pins_default>;
    status="okay";

    adc@0 {
    spi-max-frequency = <24000000>;
    reg = <0>;
    compatible = "ti,ads8684";
    };
    };

    spi1_pins_default: spi1_pins_default {
    pinctrl-single,pins = <
    J721E_IOPAD(0x1dc, PIN_INPUT, 0) /* (Y1) SPI1_CLK */
    J721E_IOPAD(0x1d4, PIN_INPUT, 0) /* (Y3) SPI1_CS0 */
    J721E_IOPAD(0x1e0, PIN_INPUT, 0) /* (Y5) SPI1_D0 */
    J721E_IOPAD(0x1e4, PIN_INPUT, 0) /* (Y2) SPI1_D1 */

    >;
    };

    If I understand correctly the adc ia external and not the one inside SoC?

    The ADC is the ADS8684 and is communicated through SPI1.

    Thanks and regards,

    Cherry

  • Cherry,

    As this is a custom board & ADC is connected via SPI1. I want to check if the probe function succeeds for this ADC?
    How is the ADC conversion started? Does SPI needs to be involved to control the ADC?

    - Keerthy

  • Hi Keerthy,

    I want to check if the probe function succeeds for this ADC?

    The ADC probe was successful and the IIO:device0 has been established.

    The ADS8684 is a 4-channel, SPI-controlled ADC for data acquisition. 

    Thanks and regards,

    Cherry

  • The ADS8684 is a 4-channel, SPI-controlled ADC for data acquisition. 

    So SPI also needs to be enabled to turn it on? Since this is a custom board and custom interface I want to understand more before I can give feedback.

    - Keerthy