Post Go back to editing

AD7616 LINUX DRIVERS with ADS8686S -timeout issue in getting data for adc channel

Category: Software
Product Number: AD7616
Software Version: Linux drivers AD7616

I am using AM625 processor and ADS8686S chip connected to SPI ( AD7616 linux drivers as they both have same register set) . I use the device in Software mode and the device tree configuration is as below,

&main_spi0 {

ti,spi-num-cs = <2>;
status = "okay";

spidev@0 {
compatible = "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <23000000>;
};

adc@1 {
compatible = "adi,ad7616";
reg = <1>;
spi-max-frequency = <1000000>;
spi-cpol;
label = "ad7616";
avcc-supply = <&reg_5v_dummy>; // Reference the 5V dummy regulator
//avcc-supply = <&reg_3v3>; // Reference the 5V dummy regulator
interrupt-parent = <&mcu_gpio0>;
interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; // (A6) DI_1V8_BUSY_AFE_1 SODIMM 61
reset-gpios = <&main_gpio0 3 GPIO_ACTIVE_LOW>; //(E25) OSPI0_D0 GPIO0_3 RESET SODIMM 56
adi,conversion-start-gpios = <&main_gpio0 4 GPIO_ACTIVE_HIGH>; // OSPI0_D1 (G24) OSPI0_D1 GPIO0_4 SODIMM 58

adi,sw-mode;

};

 I see below signals on my MOSI,MISO CLOCK, RESET AND CONVST AND Busy pin. But each time I try to read the values of analog channel it returns timeout error.

Parents Reply Children
  • It works for me, I am able to read data from ADS8686S using Linux drivers the, I am writing this to make it helpful for others. (The SPIDEV is another device not required for our chip. I have 2 devices).

    &main_spi0 {

    ti,spi-num-cs = <2>;
    status = "okay";

    spidev@0 {
    compatible = "rohm,dh2228fv";
    reg = <0>;
    spi-max-frequency = <23000000>;
    };

    adc@1 {
    compatible = "adi,ad7616";
    reg = <1>;
    spi-max-frequency = <1000000>;
    spi-cpol;
    label = "ad7616";
    avcc-supply = <&reg_5v_dummy>; // Reference the 5V dummy regulator
    //avcc-supply = <&reg_3v3>; // Reference the 5V dummy regulator
    interrupt-parent = <&mcu_gpio0>;
    interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; // (A6) DI_1V8_BUSY_AFE_1 SODIMM 61
    reset-gpios = <&main_gpio0 3 GPIO_ACTIVE_LOW>; //(E25) OSPI0_D0 GPIO0_3 RESET SODIMM 56
    adi,conversion-start-gpios = <&main_gpio0 4 GPIO_ACTIVE_HIGH>; // OSPI0_D1 (G24) OSPI0_D1 GPIO0_4 SODIMM 58

    adi,sw-mode;

    };

    Make sure all the pins are defined at pinmux and added in respective group of pin.

    Check all pins of your IC AS BELOW ,

    To make it work in Software mode above pins are important ,

    Make sure HW_RNGSEL all pins are ground and Serial,SER/PAR = HIGH , other pins must be verified as above table.

    Once your board is booted and you must have device added in your /sys/bus/iio/devices/iio:deviceX

    After that cat each channel as below.

    root:/sys/bus/iio/devices/iio:device0> cat in_voltage0_raw
    5789

    multiply this with value you get while doing,
    root:/sys/bus/iio/devices/iio:device0> cat in_voltage0_scale 
    You will get mV.


    Must check the current counsumption is 0.5A while board is active. You can also debug the registers directly as below,

    hange directory to /sys/kernel/debug/iio/ iio:deviceX and check if the direct_reg_access file exists.

    This specifies any shell prompt running on the target

    root@analog:~# cd /sys/kernel/debug/iio/iio\:device1
    root@analog:/sys/kernel/debug/iio/iio:device1# ls direct_reg_access 
    direct_reg_access
    

    Reading

    This specifies any shell prompt running on the target

    root@analog:/sys/kernel/debug/iio/iio:device1# echo 0x7 > direct_reg_access                                                                                                                                 
    root@analog:/sys/kernel/debug/iio/iio:device1# cat direct_reg_access 
    0x40
    

    Writing

    Write ADDRESS VALUE

    This specifies any shell prompt running on the target

    root@analog:/sys/kernel/debug/iio/iio:device1# echo 0x7 0x50  > direct_reg_access                                                                                                                            
    root@analog:/sys/kernel/debug/iio/iio:device1# cat direct_reg_access 
    0x50
     Thanks