ADRV9002 + ZCU102 + Pyadi iio + RX Testing


I have successfully used the TES software to generate Python code for a basic RX test for the ADRV9002/ZCU702 using a signal generator as a source.

I was curious if it would be possible to set up the ADRV9002/ZCU102 using Pyadi-iio Python library to "receive" data from a signal generator as well.

I attempted use a modified version of the example code provided on the Pyadi-iio repository to do this shown below:

sdr = adi.adrv9002(uri="ip:")
sdr.interface_gain_chan0 = "0dB"
sdr.rx_ensm_mode_chan0 = "rf_enabled"
fs = int(sdr.rx0_sample_rate)
sdr.rx_buffer_size = 2 ** 18

for i in range(20):
    a = sdr.rx()[0]

# Plot the spectogram of this data
plt.specgram(a, NFFT=1024, Fs=fs)
plt.title("PSD of 'signal' loaded from file")

Is the Pyadi-iio library for the ADRV9002 capable of setting up the transceiver to "receive" a real signal from an RF source?

Are there an examples of such a test?



  • 0
    •  Analog Employees 
    on Jan 13, 2021 9:42 PM 2 months ago

    Yes, the basic example provided in the repo does this. The same class (adi.adrv9002) controls TX and RX but you do not necessarily have to use the TX DMA or DDSs, or the RX DMAs.


  • Great thank you, I have the example running successfully now with a sig generator.

    I am trying to set up the ADRV9002 for a receive test with the following settings:

    % Defince Configuration
    % Duplex: TDD (TX or RX, cannot do both at the same time
    % Setup: Custom
    % Channels: Channel 1
    % RX1
    % Dataport sample rate: 64 kSPS
    % Rx RF Input: Rx1A
    % RF Channel BW: 25
    % TX1
    % Dataport sample rate: 64 kSPS
    % Tx RF Output: Tx1
    % RF Channel Bandwidth: 35 kHz
    % Board Configuration
    % Default settings
    % Initialization
    % Device Clock Input
    % Frequency 38.4 MHz
    % Device Clock Output
    % Frequency 19.2 MHz
    % Clock PLL
    % Low Power
    % Processor Clock
    % Processor Clock Divisor 1
    % Rx1
    % Carrier Freq 41 MHz
    % Intermediate Freq 490 kHz
    % Lo Opt Best Phase Noise
    % Tx1
    % Carrier Freq 41 MHz
    % Lo Opt Best Phase Noise
    % ADC Rate
    % ADC Rate High
    % Rx1 Opt High Performance
    % Init Cals
    % Rx
    % QEC, RF DC Offset
    % Tx
    % LO Leakage, Loopack Path Delay, QEC
    % Tracking Cals
    % Rx
    % AGC, Rx Baseband DC rejection, RxQEC FIC
    % Tx
    % none
    % Gain Control (may not be working)
    % Interfaece Gain Control Mode Automatic
    % Rx1 Gain Control Mode Automatic
    % Increment Step Size 2
    % Decrement Step Size 2
    % Signal Detection
    % Detection Mode Peak Only (default settings)
    % Gain Compensation Corrected Gain

    For settings like rx0_sample_rate and rx0_rf_bandwidth, can these settings be changed via the Pyadi-iio library or are these only able to be set via the TES software?



  • 0
    •  Analog Employees 
    on Jan 14, 2021 8:31 PM 2 months ago in reply to nmt4781

    The majority of ADRV9002's configure is applied through profiles. Similar to AD9371 and ADRV9008/9. If you want to change anything related to the datapath, like sample rate, it needs to be done through a profile. The pyadi classes expose the runtime configuration as writable properties and anything not changeable will be read only.

    TES is the source of profiles and can export them in a form the driver and pyadi can understand. This is the JSON profile export feature in TES provided through the File menu. Once you have the profiles and related stream binaries they can be loaded through the profile and stream attributes.

    It is important to note that the driver will require a specific version of TES since the profiles can change pretty heavily between TES versions. The TES profiles supported by the driver and pyadi are from TES v0.12 in the R2-2019 release. 


  • Thank you, this was very helpful and answers a ton of questions!

    I can only find a location to download TES v.0.14 online.

    Is there a location to download TES v.0.12 to generate these profiles, I currently have v.0.11.


  • 0
    •  Analog Employees 
    on Jan 15, 2021 12:55 AM 2 months ago in reply to nmt4781

    Please make a post here for it:

    The IIO drivers will be supporting v0.14 shortly, most of the fixes have been merged, but we are still testing.