Post Go back to editing

sometime pyadi receives on only first 2 channel instead of all 4 channel on FMCOMMS5

Category: Software
Product Number: FMCOMMS5 with ZC702

Run below code on ZC702 with Aug 3 2022 image:

import time
import adi

sdr = adi.FMComms5("ip:127.0.0.1")

record_duration = 0.25 * 1e-3
rx_lo = 2412000000
rx_gain = 30
rx_rf_bandwidth = 20000000
sample_rate = 20000000

sdr.sample_rate = sample_rate
sdr.rx_rf_bandwidth = rx_rf_bandwidth
sdr.rx_rf_bandwidth_chip_b = rx_rf_bandwidth

sdr.rx_lo = rx_lo
sdr.rx_lo_chip_b = rx_lo

gain_control_mode = "manual"
sdr.gain_control_mode_chan0 = gain_control_mode
sdr.gain_control_mode_chan1 = gain_control_mode
sdr.gain_control_mode_chip_b_chan0 = gain_control_mode
sdr.gain_control_mode_chip_b_chan1 = gain_control_mode

sdr.rx_hardwaregain_chan0 = rx_gain
sdr.rx_hardwaregain_chan1 = rx_gain
sdr.rx_hardwaregain_chip_b_chan0 = rx_gain
sdr.rx_hardwaregain_chip_b_chan1 = rx_gain

sdr.rx_enabled_channels = [0, 1, 2, 3]

# this is buffer size in samples for one channel
rx_buffer_size = int(record_duration * sample_rate)
sdr.rx_buffer_size = rx_buffer_size

time.sleep(1) # reserve for FPGA to response

data = sdr.rx()

for idx in range(10):
print("%5d+%5dj %5d+%5dj %5d+%5dj %5d+%5dj" % (
np.real(data[0][idx]), np.imag(data[0][idx]),
np.real(data[1][idx]), np.imag(data[1][idx]),
np.real(data[2][idx]), np.imag(data[2][idx]),
np.real(data[3][idx]), np.imag(data[3][idx])))

sdr.rx_destroy_buffer()
Four running result are shown as below:
analog@analog:~/workspace/fmcomms5_py $ python3 fmcomms5_py_source.py
-2+ 1j 1+ 0j -3+ -10j -1041+-1041j
-1+ 0j -3+ -1j -3+ -10j -1041+-1041j
0+ 2j -2+ 0j -3+ -10j -1041+-1041j
0+ -1j 1+ 0j -3+ -10j -1041+-1041j
0+ 0j 1+ 2j -3+ -10j -1041+-1041j
-1+ 0j -1+ 1j -3+ -10j -1041+-1041j
0+ -2j -1+ 1j -3+ -10j -1041+-1041j
0+ 1j 1+ 0j -3+ -10j -1041+-1041j
-1+ 0j 3+ 0j -3+ -10j -1041+-1041j
1+ 0j -2+ -1j -3+ -10j -1041+-1041j
analog@analog:~/workspace/fmcomms5_py $ python3 fmcomms5_py_source.py
-1+ 0j -1+ -2j 1+ 0j 0+ 1j
1+ 0j -1+ -2j 1+ 0j 1+ 2j
0+ 1j 0+ 1j -1+ 0j -1+ 1j
0+ 1j -1+ 0j 1+ -1j -2+ 0j
-1+ 1j 1+ 0j 0+ 1j 0+ 0j
0+ -1j 2+ -1j -1+ -1j -1+ 0j
0+ 0j 1+ 0j -1+ -1j 1+ 0j
1+ 0j 1+ 0j -1+ 0j 0+ 0j
-1+ -2j 1+ 1j 0+ 0j -3+ 1j
0+ -1j -2+ 0j -1+ 1j 0+ 1j
It is easy to see that ch0/1 are correct for two running. But ch2/3 are not correct for the first running. When ch2/3 are correct are totally randomly, sometimes it can repeat the error for tens time.