Post Go back to editing

AD7176-2 Overlay for RPi - Error in Selecting Matching Device

Category: Software
Product Number: AD7176-2
Software Version: Python 3.9.2, Kuiper Linux 2021_R2, Pyadi-iio 0.0.13

Hi All,

Following up on my previous post, I've made a DT overlay for the AD7176-2 based on an overlay for the AD7124-8. But I'm still running into the same issue that the device is not able to be selected.

This is my DT Overlay

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

	fragment@0 {
		target-path = "/";
		__overlay__ {
			vref: fixedregulator@0 {
				compatible = "regulator-fixed";
				regulator-name = "fixed-supply";
				regulator-min-microvolt = <5000000>;
				regulator-max-microvolt = <5000000>;
				regulator-boot-on;
			};
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			clocks {
				ad7176_mclk: clock@0 {
					#clock-cells = <0>;
					compatible = "fixed-clock";
					clock-frequency = <16000000>;
				};
			};
		};
	};

	fragment@2 {
		target = <&spi0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			ad7176@0 {
				compatible = "adi,ad7176-2";
				reg = <0>;
				spi-max-frequency = <5000000>;
				interrupts = <25 2>;
				interrupt-parent = <&gpio>;
				refin1-supply = <&vref>;
				clocks = <&ad7124_mclk>;
				clock-names = "mclk";

				#address-cells = <1>;
				#size-cells = <0>;

				channel@0 {
					reg = <0>;
					diff-channels = <0 1>;
				};

				channel@1 {
					reg = <1>;
					diff-channels = <2 3>;
				};
			};
		};
	};

	fragment@3 {
		target = <&spidev0>;
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@4 {
		target = <&spidev1>;
		__overlay__ {
			status = "disabled";
		};
	};
};

And this is the error message I get;

Traceback (most recent call last):
File "/home/analog/AD7176/AD7176_adi.py", line 4, in <module>
my_adi = adi.ad717x(uri="local:")
File "/usr/local/lib/python3.9/dist-packages/adi/ad717x.py", line 85, in __init__
raise Exception("Error in selecting matching device")
Exception: Error in selecting matching device

I have compiled using the command; $ dtc -O dtb -o rpi-ad7176-myOverlay.dtbo rpi-ad7176-myOverlay.dts in Kuiper Linux command line and moved the .dtbo file into the /boot/overlays folder. I've added the following line into the /boot/config.txt file; dtoverlay=rpi-ad7176-myOverlay.

Any insight into where I'm going wrong would be greatly appreciated.

I'd also like to make the inputs single ended (I believe you have to specify this in the .dts/.dtbo file) - if anyone has an example they can show me of how to do this that'd be awesome!