I am working on configuring the AD7193 sensor on a Raspberry Pi via SPI and encountered some issues related to the clock configuration and device tree setup. Below is a detailed description of the problems and the steps I have taken so far.
When I attempt to initialize the AD7193, the kernel logs show the following error:
[ 6.689495] ad7192 spi0.0: External clock frequency out of bounds
[ 6.689526] ad7192: probe of spi0.0 failed with error -22
hier is the ad7193.dts code
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <&spidev0>;
__overlay__ {
status = "disabled";
};
};
fragment@2 {
target = <&spidev1>;
__overlay__ {
status = "disabled";
};
};
fragment@3 {
target = <&gpio>;
__overlay__ {
ad7193_pins: ad7193_pins {
brcm,pins = <23>;
brcm,function = <0>;
brcm,pull = <2>;
};
};
};
fragment@4 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
adc: ad7193@0{
compatible = "adi,ad7193";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&ad7193_pins>;
spi-max-frequency = <1000000>;
adi,clock-source-select = [02];
spi-cpha;
spi-cpol;
dvdd-supply = <&vdd_3v3_reg>;
avdd-supply = <&vdd_5v0_reg>;
interrupts = <23 2>; /* high-to-low edge triggered */
interrupt-parent = <&gpio>;
adi,reference-voltage-mv = <3300>;
adi,refin2-enable;
adi,rej60-enable;
adi,chop-enable;
adi,buf-enable;
adi,int-clock-output-enable;
adi,burnout-curr-enable;
Sadi,sinc3-enable;
adi,unipolar-enable;
status = "okay";
};
};
};
};
I would greatly appreciate any guidance or insights to resolve these issues. Thank you in advance for your support!