Skip to content

Conversation

@AndyOesmer
Copy link
Contributor

@AndyOesmer AndyOesmer commented Sep 16, 2025

Description

edit cn0554 example to use adc read raw instead of .rx function

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Hardware:
  • OS:

Documentation

If this is a new feature or example please mention or link any documentation. All new hardware interface classes require documentation.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have signed off all commits and they contain "Signed-off by: "
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

edit cn0554 example to use adc read raw instead of .rx function

Signed-off-by: Andrea Oesmer <Andrea.Oesmer@analog.com>
@tfcollins
Copy link
Collaborator

Why not just use the SI output type to do this for you? https://analogdevicesinc.github.io/pyadi-iio/buffers/index.html#buffer-units

@thorenscientific
Copy link
Contributor

Why not just use the SI output type to do this for you? https://analogdevicesinc.github.io/pyadi-iio/buffers/index.html#buffer-units

This is less about the units than the nature of the application, which is typically a slow control loop - read channel A from AD7124, tweak channel A on the LTC2668, read ADC channel B, tweak channel B, etc. So rx-ing a big buffer of all channels doesn't make much sense. And rather than averaging readings from the buffered read, simply reduce the sampling frequency, which pushes the averaging into the ADC itself. That said - @AndyOesmer you could use the to_volts method:
https://github.com/analogdevicesinc/pyadi-iio/blob/main/adi/ad7124.py#L95
... but even that could use some cleanup, not sure where the if np.int16 comes from, this is a 24-bit part.
Another wrinkle - the AD7124 driver is being updated. It's going to be a while before it makes it into the Kuiper image, but we should be prepared to update the AD7124 pyadi, as well as all projects that use it (CN0554, CN0508, and make sure there are no others.)

@tfcollins
Copy link
Collaborator

Whats the final decision here @thorenscientific ?

@AndyOesmer
Copy link
Contributor Author

Hi @tfcollins, @thorenscientific, apologies for the delayed response. I might opt to revise and use the to_volts method instead, as advised. Will update here once changes are applied. Thanks!

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

Successfully merging this pull request may close these issues.

3 participants