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

Parents
  • 0
    •  Analog Employees 
    on Feb 8, 2021 8:21 PM
    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. 

    Are you loading a profile? If you use IIO-Scope does this hold true with the DDS or the DAC Buffer outputs?

    Does the sdr.tx_cyclic_buffer = True do this somehow so that the sdr.tx does not have to be constantly looped? 

    Just set the tx_cyclic_buffer to True and do not loop. Just a single buffer needs to be passed. Note that if python exits or the sdr object is cleared the drivers will switch back to DDS mode.

    -Travis

  • Thanks for the response,

    Even after setting the tx_cyclic_buffer to True and passing the buffer once as shown below, the transmitter still does not constantly transmit the buffer, I see the TX data on the PXA only for a brief moment when the sdr.tx(frm) is called but it only shows a continuous transmission when looping the sdr.tx(frm) command. I also am not exiting Python or destroying the sdr object.

    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 = frm.astype(complex)

    sdr.tx_cyclic_buffer = True
    time.sleep(1)
    sdr.tx(frm)


    while True:
        pass

    Thanks,

    -NT

Reply
  • Thanks for the response,

    Even after setting the tx_cyclic_buffer to True and passing the buffer once as shown below, the transmitter still does not constantly transmit the buffer, I see the TX data on the PXA only for a brief moment when the sdr.tx(frm) is called but it only shows a continuous transmission when looping the sdr.tx(frm) command. I also am not exiting Python or destroying the sdr object.

    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 = frm.astype(complex)

    sdr.tx_cyclic_buffer = True
    time.sleep(1)
    sdr.tx(frm)


    while True:
        pass

    Thanks,

    -NT

Children