Configuring external ADC (AD74413R) with STM32MP157F-DK2
Hello Everyone,
I am working on a custom board based on STM32MP157F-DK2. Our custom board have two external ADC (AD74413R) connected to the main processor. I have changed the device tree added proper driver for the external ADC. While reading the files from iio folder, i am getting "Connection timeout error". Device tree and error message is shown below.
Device tree
&spi4 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi4_pins_b>;
pinctrl-1 = <&spi4_sleep_pins_b>;
//chip select -> PA10 for ext ADC0
cs-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>;
//enable SPI4
status = "okay";
ad74413r@0 {
compatible = "adi,ad74413r";
//this is chip select address 0
reg = <0>;
//base address and register size
#address-cells = <1>;
#size-cells = <0>;
//max. frequency 10Mhz
spi-max-frequency = <10000000>;
spi-cpol;
//ADC_READY -> PA5
//alert pin - >PA4
interrupt-parent = <&gpioa>;
interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
//add sense resistor
refin-supply = <&ad74413r_refin>;
//reset pin -> PA9
reset-gpios = <&gpioa 9 GPIO_ACTIVE_LOW>;
//this channel have the function of voltage input
channel@0 {
reg = <0>;
adi,ch-func = <CH_FUNC_VOLTAGE_INPUT>;
};
};
};
Error :
root@stm32mp1:/sys/bus/iio/devices/iio:device0# cat in_voltage0_raw
cat: in_voltage0_raw: Connection timed out
Regards
Rehan Shakoor
