Post Go back to editing

AD4020 Linux behavior

Hello,

I'm new to IIO (though have experience in other Linux drivers) and I'm setting up an AD4020 evaluation board with Zedboard and its Linux driver.  I've followed instructions from the following links:

https://github.com/analogdevicesinc/meta-adi/tree/master/meta-adi-xilinx

https://wiki.analog.com/resources/tools-software/linux-drivers/iio-adc/ad400x

and I've managed to come up with the images to boot the Zedboard ADI kernel with AD4020 driver.

Following the last part in https://wiki.analog.com/resources/tools-software/linux-drivers/iio-adc/ad400x, I can verify it shows the ad4020 device and the in_voltage0_scale.  However, repeatedly cat'ing the in_voltage_raw always return the same result - 1048575 - which is the maximum raw as it is a 20-bit ADC.  My expectation is that this is the command that triggers the spi-axi-engine to poll the AD4020 ADC, and the result will be different even by a bit from the previous one perhaps due to noise.

I tried to experiment this time without the evaluation board.  The AD4020 iio:device0 is still there, perhaps because of the device tree, and reading in_voltage0_raw still returns the same and unchanging 1048575 value. 

I tried both scenarios putting back the board and removing it, and for both scenarios I tried reading the in_voltage0_raw, while at the same time using an oscilloscope to read the SCK line from the FMC.  I would expect there is at least a clock activity here, but there is NONE! 

What should be the expected behavior here?  What is the proper way to initiate ADC read here?  Hopefully you can help me.

Top Replies