analogdevicesinc / pyadi-iio

Python interfaces for ADI hardware with IIO drivers (aka peyote)

Home Page:https://analogdevicesinc.github.io/pyadi-iio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong SI reading for ad7124-8

boweiliu0428 opened this issue · comments

https://github.com/analogdevicesinc/pyadi-iio/blob/main/adi/rx_tx.py#L206 says
x[i][samp] = (raw + rx_offset[i]) * rx_scale[i]
but for ad7124-8 it should be
x[i][samp] = (raw) * rx_scale[i] + rx_offset[i]
according to https://wiki.analog.com/resources/tools-software/linux-drivers/iio-adc/ad7124

This has resulted in wrong readings in "SI" units (mV) when running ad7124-8 in bipolar mode.

Hi,

So iio/libiio standard equation is

x[i][samp] = (raw + rx_offset[i]) * rx_scale[i]

Can you please verify with the forum here that the driver is correct https://ez.analog.com/linux-software-drivers/f/q-a

You are right. I was using the latest released version 0.0.16 in pip. Now I compiled 0.0.17 from source and everything works fine, thanks to your change. Please release 0.0.17 into pip soon.