Post Go back to editing

Dynamic LO1 and LO2 switching on ADRV9029 (IronPython/TES)

Thread Summary

The user is trying to dynamically switch between LO1 and LO2 on Rx3 of the ADRV9029 evaluation board using IronPython and the TES. The final answer confirms that dynamic LO switching is not supported and must be configured during initialization. The user's code attempts to use the `LoSourceMappingSet` function, which is not available for the ADRV9029.
AI Generated Content
Category: Software
Product Number: ADRV9029

Hello,

I am currently working with the ADRV9029 evaluation board.

I would like to be able to switch dynamically between LO1 and LO2 on Rx3.

I found the following code lines in the DLL Help section of the TES:

   initStruct.clocks.rx12LoSelect = Types.adi_adrv9010_LoSel_e.ADI_ADRV9010_LOSEL_LO1
   initStruct.clocks.rx34LoSelect = Types.adi_adrv9010_LoSel_e.ADI_ADRV9010_LOSEL_LO2
   initStruct.clocks.tx12LoSelect = Types.adi_adrv9010_LoSel_e.ADI_ADRV9010_LOSEL_LO1
   initStruct.clocks.tx34LoSelect = Types.adi_adrv9010_LoSel_e.ADI_ADRV9010_LOSEL_LO2

However, these settings are intended for the initialization procedure and not for dynamic switching during runtime.

I also found the function LoSourceMappingSet, which should allow me to map LO1 and LO2 to Rx3 as described below:

     rxPllMappingMask   | Channel PLL Source Mapping
   ---------------------|------------------------------------
        bit[0]          | 1 = Rx12 to LO2, 0 = Rx12 to LO1
        bit[1]          | 1 = Rx34 to LO2, 0 = Rx34 to LO1

Unfortunately, I am facing a roadblock. I am unable to make my IronPython code run correctly on the ADRV9029 board using TES. I keep receiving the following error:

System.Exception: ERROR 9025 does not support adi_adrv9025_LoSourceMappingSet ... 

Does this error mean that the LoSourceMappingSet function cannot be used with the ADRV9029?

My questions are:

  1. Is it possible with this chip to switch from LO1 to LO2 for a specific Rx or Tx channel after the initialization and calibration procedures are complete?
  2. If yes, what is the procedure? I assume I should follow the "CALIBRATION GUIDELINES AFTER PLL FREQUENCY CHANGES" section in UG-1727.
  3. If LO switching is possible after initialization, do you have an example of IronPython code that could help me use the LoSourceMappingSet function correctly?

Best regards,
François


 
import System
import clr
import time
import datetime
from System import Array
from System.Diagnostics import Stopwatch
from System.Collections.Generic import List

clr.AddReferenceToFileAndPath("C:\\Program Files\\Analog Devices\\ADRV9025 Transceiver Evaluation Software_x64_FULL\\adrvtrx_dll.dll")

from adrv9010_dll import AdiEvaluationSystem
from adrv9010_dll import Types
from adrv9010_dll import FpgaTypes

link = AdiEvaluationSystem.Instance
connect = False

if (not link.IsConnected()):
    connect = True
    link.platform.board.Client.Connect("192.168.1.10", 55556)
    print "Connexion..."

if (not link.IsConnected()):
    raise Exception("ERREUR: Pas connecte au TES.")

print "Connecte."

RadioCtrl  = link.platform.board.Adrv9010Device.RadioCtrl

CAPTURE_TIME_MS = 2 

RX_CHANNEL_MASK = 4   

start_freq = 3000000000 
step_freq  = 50000000   
nb_points  = 10
freq_list  = [start_freq + (i * step_freq) for i in range(nb_points)]

PLL_LO1 = Types.adi_adrv9010_PllName_e.ADI_ADRV9010_LO1_PLL
PLL_LO2 = Types.adi_adrv9010_PllName_e.ADI_ADRV9010_LO2_PLL


VAL_RX3_ON_LO1 = 0
VAL_RX3_ON_LO2 = 2

results_buffer = []
sw = Stopwatch()


def FastRxCapture(mask, time_ms):
    Rx_data_list = link.platform.board.PerformRx(
        FpgaTypes.adi_fpga9010_RxTollgateTrigSources_e.ADI_FPGA9010_IMM_TRIG,
        mask, time_ms, time_ms * 2 + 100
    )
    return (Rx_data_list[4], Rx_data_list[5]) 


print "\n=== 1. Initialisation ==="
RadioCtrl.RxTxEnableSet(RX_CHANNEL_MASK, 0x01) 

if len(freq_list) > 0: RadioCtrl.PllFrequencySet(PLL_LO1, freq_list[0])
if len(freq_list) > 1: RadioCtrl.PllFrequencySet(PLL_LO2, freq_list[1])
time.sleep(0.5) 

print "\n=== 2 ==="

RadioCtrl.LoSourceMappingSet(VAL_RX3_ON_LO1)

for i in range(len(freq_list)):
    current_freq = freq_list[i]
    

    using_LO1 = (i % 2 == 0)
    

    mapping_val = VAL_RX3_ON_LO1 if using_LO1 else VAL_RX3_ON_LO2
    
    if using_LO1:
        pll_to_move = PLL_LO1 
       
        pll_to_move = PLL_LO1 
    else:
        pll_to_move = PLL_LO2
        
    next_use_of_this_pll = i + 2

    sw.Restart()
    try:
        RadioCtrl.LoSourceMappingSet(mapping_val)
        
        (I, Q) = FastRxCapture(RX_CHANNEL_MASK, CAPTURE_TIME_MS)
        
        sw.Stop()
        elapsed = sw.Elapsed.TotalMilliseconds
        results_buffer.append((current_freq, I, Q, elapsed))
        
        if next_use_of_this_pll < len(freq_list):
            RadioCtrl.PllFrequencySet(pll_to_move, freq_list[next_use_of_this_pll])

        src_str = "LO1" if using_LO1 else "LO2"
        print "Freq %d : %.3f GHz | T=%.2f ms | %s (MapVal=%d)" % (i, current_freq/1e9, elapsed, src_str, mapping_val)

    except Exception as e:
        print "ERREUR Freq %d : %s" % (i, str(e))
        sw.Stop()


print "\n=== 3. Sauvegarde ==="
path = 'C:\\Users\\a942666\\Desktop\\Alternance\\Stage\\Code_IronPython_ADRV\\Results'
ts = datetime.datetime.now().strftime("%H%M%S")

try:
    for item in results_buffer:
        f_val, i_dat, q_dat, t_ms = item
        filename = "PP_Final_%s_Freq_%d.txt" % (ts, f_val/1e6)
        full_path = System.IO.Path.Combine(path, filename)
        with open(full_path, 'w') as f:
            f.write("I\tQ\n")
            limit = min(len(i_dat), 1000)
            for k in range(limit):
                f.write("%d\t%d\n" % (i_dat[k], q_dat[k]))
    print "Sauvegarde terminee."

except Exception as e:
    print "Erreur Disque: " + str(e)

if (connect): link.platform.board.Client.Disconnect()





Parents Reply Children
No Data