ADRV9002 Pyadi-iio Cyclic Buffer

Hello,

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

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

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

frm.astype(complex)

sdr.tx_cyclic_buffer = True


for i in range(10000):
    sdr.tx(frm)

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? 

Thanks! 

-NT

  • 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\untitled16.py", line 72, in <module>
    sdr.tx(frm)

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

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

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

    File "C:\Users\ntiberio\AppData\Local\Continuum\anaconda3\lib\site-packages\adi\dds.py", 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>)

    print(dir(sdr))

    print(sdr._txdac.name)

    for chan in sdr._txdac.channels:

        print(chan.id)

    -Travis

  • 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.

    -NT

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

    Great! Thanks for letting us know.

    -Travis