Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong SI reading for ad7124-8 #544

Closed
boweiliu0428 opened this issue Mar 12, 2024 · 2 comments
Closed

Wrong SI reading for ad7124-8 #544

boweiliu0428 opened this issue Mar 12, 2024 · 2 comments
Assignees

Comments

@boweiliu0428
Copy link

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.

@tfcollins tfcollins self-assigned this Mar 12, 2024
@tfcollins
Copy link
Collaborator

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

@boweiliu0428
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants