Post Go back to editing

CN0540 long single shot sample timeout

Category: Software
Product Number: CN0540 + DE10Nano
Software Version: EVAL-CN0540-ARDZ

Hi all,

I'm trying to capture a long sample from the CN0540 but when I get above 1s the system freezes.

The same behaviour occurs  when using the onboard oscilloscope.

Is there anyway of increasing the timeout value so I can get a longer sample?

The code bellow works fine with a "rx_buffer_size = 2**17" but fails with "rx_buffer_size = 2**18"

import adi
import numpy
import time
import matplotlib.pyplot as plt


uri = "ip:"
xl = adi.cn0532(uri)
xl.sample_rate = 128000 #256000

for x in range(10):
xl = adi.cn0532(uri)
# Set number of samples to capture
xl.rx_buffer_size = 2**18 # 2**17
# Pull rx_buffer_size samples back from the device
data = xl.rx()

numpy.savetxt(".\Data\data.csv", data, delimiter=",")

datafft = numpy.fft.fft(data)
numpy.savetxt(".\Data\datafft.csv", datafft, delimiter=",")

n = data.size
timestep = 0.1
datafftfreq = numpy.fft.fftfreq(n, d=timestep)
numpy.savetxt(".\Data\datafftfreq.csv", datafftfreq, delimiter=",")

datahfft = numpy.fft.hfft(data)
numpy.savetxt(".\Data\datahfft.csv", datahfft, delimiter=",")





  • FormerMember
    0 FormerMember
on Nov 23, 2022 9:02 AM

I have moved this question into the software interface tools forum for proper support.

  • Yes. Timeout is set through the context:

    dev = adi.cn0532()

    dev.ctx.set_timeout(10000) # Time in miliseconds


  • Reply Children
    No Data