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

CN0540 Spike in first rx() value #467

Open
WyattBreitner opened this issue Aug 20, 2023 · 0 comments
Open

CN0540 Spike in first rx() value #467

WyattBreitner opened this issue Aug 20, 2023 · 0 comments

Comments

@WyattBreitner
Copy link

This may just be a misunderstanding on my part, but when I first create a rx buffer, I get a massive spike in the first value.
This spike is also in the input_voltage value, and when I run iio_info.

>>> import adi
>>> adc = adi.cn0540.cn0540(uri='ip:localhost')
>>> adc.rx_output_type = 'SI'
>>> adc.rx()
array([-1343.99931187,    26.96727135,    26.96727135, ...,
          26.96678307,    26.96678307,    26.96727135])
>>> adc.rx()
array([26.96727135, 26.96678307, 26.96678307, ..., 26.96678307,
       26.96727135, 26.96727135])
>>> adc.rx_destroy_buffer()
>>> adc.rx()
array([-1343.99931187,    26.96678307,    26.96678307, ...,
          26.96678307,    26.96678307,    26.96678307])
>>> adc.rx_destroy_buffer()
>>> adc.input_voltage
-1571.821460852
>>> adc.sensor_voltage
2171.8311967201303
 iio:device0: ad7768-1 (buffer capable)
                1 channels found:
                        voltage0:  (input, index: 0, format: le:s24/32>>8)
                        2 channel-specific attributes found:
                                attr  0: raw value: -2080071
                                attr  1: scale value: 0.000488281
                4 device-specific attributes found:
                                attr  0: common_mode_voltage value: (AVDD1-AVSS)/2
                                attr  1: common_mode_voltage_available value: (AVDD1-AVSS)/2 2V5 2V05 1V9 1V65 1V1 0V9 OFF
                                attr  2: sampling_frequency value: 256000
                                attr  3: sampling_frequency_available value: 256000 128000 64000 32000 16000 8000 4000 2000 1000
                3 buffer-specific attributes found:
                                attr  0: data_available value: 0
                                attr  1: length_align_bytes value: 16
                                attr  2: watermark value: 1024
                1 debug attributes found:
                                debug attr  0: direct_reg_access value: 0x0
                No trigger on this device
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

1 participant