ADRV9002 Pyadi-iio Cyclic Buffer


I am using the following script to run a transmit test on the ADRV9002.

sdr = adi.adrv9002(uri="ip:")

sdr.tx_hardwaregain_chan0 = -40

sdr.tx_ensm_mode_chan0 = "rf_enabled"

Fs = 15360000
t = np.arange(0,0.1,1/Fs)

Fc = 5000000
fm = 20000
frm = np.cos(2 * np.pi * Fc * t + np.sin(2 * np.pi * fm * t)) * 2 ** 15
m = np.sin(2 * np.pi * fm * t) * 2 ** 15


sdr.tx_cyclic_buffer = True

for i in range(10000):

Despite defining the set up for "tx channel 0", I am only getting the expected TX RF output on TX2_OUT SMA and not the expected TX1_OUT SMA. 

Also, the only way I am able to get the transmit path to repeatedly transmit so I can view the results on a PXA is by looping the sdr.tx(frm) over and over again in a for loop. Is this the correct way to "constantly" transmit so that the output can be monitored continuously. Does the sdr.tx_cyclic_buffer = True do this somehow so that the sdr.tx does not have to be constantly looped? 



  • Correction, I am now running the adrv9002-split-dma branch, the error I am seeing now is

    when I try to run the sdr.tx(frm) command. I am in 'split" DMA mode and the "enabled" tx channel is channel "0"

    The error I get is:

    File "O:\Users\nTiberio\WDK\Python\Python_FM_SINAD\", line 72, in <module>

    File "C:\Users\ntiberio\AppData\Local\Continuum\anaconda3\lib\site-packages\adi\", line 394, in tx

    File "C:\Users\ntiberio\AppData\Local\Continuum\anaconda3\lib\site-packages\adi\", line 82, in disable_dds

    File "C:\Users\ntiberio\AppData\Local\Continuum\anaconda3\lib\site-packages\adi\", line 122, in dds_enabled

    File "C:\Users\ntiberio\AppData\Local\Continuum\anaconda3\lib\site-packages\adi\", line 48, in __update_dds

    AttributeError: 'NoneType' object has no attribute 'channels'

  • 0
    •  Analog Employees 
    on Feb 9, 2021 6:24 PM in reply to nmt4781

    I cannot repeat this on my end. Can you run this and provide the output:

    import adi

    sdr = adi.adrv9002(uri=<your uri>)



    for chan in sdr._txdac.channels:



  • I was able to successfully run from the adrv9002-split-dma branch in the end and resolve the errors I listed above, the error was on my side as I was not properly "switching" to this branch. 

    I am now correctly transmitting out of the TX1_OUT SMA port and the TX cyclic buffer is now functioning as expected as well. 

    Thank you for the help.


  • 0
    •  Analog Employees 
    on Feb 9, 2021 8:01 PM in reply to nmt4781

    Great! Thanks for letting us know.