AD7193 Differential channel reading zero

Hi Guys,

I have the ad7193 driver which is integrated with raspberry pi and looks as below

The SPI communication works fine and I'm able to fetch data from the given options but when i give an input of 3.3v to AIN3 and connect AIN4 i expect in_voltage3-voltage4_raw(AIN3-AIN4) to give full scale 3.3V for differential channel instead it displays 0 equal to that of the potential of grounded channel AIN4 and this happens for all the differential pair channels except in_voltage1-voltage2_raw(AIN1-AIN2), am I missing something? do i have to enable any parameter for it to work?.

Note:- When input is given to both the channels AIN3 and AIN4 and when data is checked in in_voltage3-voltage4_raw(AIN3-AIN4)  it shows data perfectly.Thanks in advance.

-SK

Parents
  • We've been reviewing the driver internally a bit based on your observations.

    I think you may have found a bug.

    Could you try changing the driver a bit ?

    Change this: linux/ad7192.c at master · analogdevicesinc/linux · GitHub 

    #define AD7193_CH_AIN1P_AIN2M 0x000 /* AIN1(+) - AIN2(-) */
    #define AD7193_CH_AIN3P_AIN4M 0x001 /* AIN3(+) - AIN4(-) */
    #define AD7193_CH_AIN5P_AIN6M 0x002 /* AIN5(+) - AIN6(-) */

    #define AD7193_CH_AIN7P_AIN8M 0x004 /* AIN7(+) - AIN8(-) */

    to

    #define AD7193_CH_AIN1P_AIN2M 0x001 /* AIN1(+) - AIN2(-) */
    #define AD7193_CH_AIN3P_AIN4M 0x002 /* AIN3(+) - AIN4(-) */
    #define AD7193_CH_AIN5P_AIN6M 0x004 /* AIN5(+) - AIN6(-) */

    #define AD7193_CH_AIN7P_AIN8M 0x008 /* AIN7(+) - AIN8(-) */

    Thanks

    Alex

Reply Children