Post Go back to editing

How to use the measurement probe TR_EN on Stingray

Category: Software

Hello!

Greeting!

We are configuring the TDD Engine based on the X-band radar platform. We found there is a TR_EN measurement probe to test the status of TDD. How to use it? We test this probe and the signal is always the same. Could you give some instructions about how to use it?

Best,

Dongyu

  • Hi Dongyu, 

    A test point for the TR pin of the ADAR1000 is pinned out on the ADAR1000EVAL1Z PCB as detailed in the Time Division Duplexing section of the wiki. This is to be connected to external equipment for monitoring. I have connected the TR pin to an oscilloscope while in TDD mode to measure switching speed of the signal. Some example measurements can be found on the ADAR1000EVAL1Z Data Wiki.

    Regards, 
    Sam

  • Hi Sam,

    Do you mean that when I run "XBDP_TDD_Example.m", I can detect the switch of the TX and RX as the setting in the code?
    If the code is as follows, is the excepted signal a rectangular wave with 10% duty cycle?

    sray.TxVCOon = [0 0]; %Stingray/Xud1a TR Frame Start
    sray.TxVCOoff = [100e-3 0]; %Stingray/Xud1a TR Frame Stop
    sray.TxOn = [0 0] ; %MxFE TX Enable Frame Start
    sray.TxOff = [100e-3 0]; %MxFE TX Enable Frame Stop
    sray.TxDPon = [0 0] ; %MxFE TX Datapath Frame Start
    sray.TxDPoff = [100e-3 0] ; %MxFE TX Datapath Frame Stop
    sray.RxOn = [101e-3 0]; %MxFE RX Enable Frame Start
    sray.RxOff = [1 0]; %MxFE RX Enable Frame Stop
    sray.RxDPon = [101e-3 0] ; %MxFE RX Datapath Frame Start
    sray.RxDPoff = [1 0] ; %MxFE RX Datapath Frame Stop
    Thanks!
    Best,
    Dongyu
  • Hi Dongyu, 

    Yes, that is correct. The command sray.FrameLength sets the pulse repetition period (units of ms) and the code you copied will determine the TX duration and Rx duration within the defined pulse repetition period or what is referred to as the "frame length". 

    Regards, 
    Sam

  • Hi Sam, 

    Thanks for your reply! I try to test the signal of TR Pin, but there is no rectangle signal. I am wondering whether it indicates that the TDD mode is not activated. To test TDD TX, I first connect the P3-13 and P3-15 on the interposer board, then I run the following code:

    clear all, close all, clc
    %% Array Mapping
    %verify element maps correctly to hardware!
    subarray = ...
        [[1 2 5 6 9 10 13 14];... %subarray 1
        [3 4 7 8 11 12 15 16];... %subarray 2
        [19 20 23 24 27 28 31 32];... %subarray 3
        [17 18 21 22 25 26 29 30]]';  %subarray 4 
    subarray_ref = [2 4 18 20]; %subarray reference elements
    dac_map = [4 3 2 1]; %DAC map to subarray
    dac_ref = 4; %DAC reference channel
    adc_map = [4 2 1 3]; %ADC map to subarray
    adc_ref = 4; %ADC reference channel
    
    %% Config Dev Platform
    
    % uri = 'ip:192.168.1.211';
    uri = 'ip:192.168.0.101';
    interFreq = 4.5e9; %Tx NCO Frequency & Unfolded Rx NCO Frequency [Hz]
    
    fs_RxTxIQ = 250e6; %IQ Sample Rate [Hz]
    periods = 32; %Desired Number Of Periods For Tx Signal
    basebandFreq = fs_RxTxIQ/periods; %Baseband Frequency [Hz]
    
    %Setup AD9081 Tx & Rx
    tx = adi.AD9081.Tx;
    tx.uri = uri;
    
    tx.EnabledChannels = [1 2 3 4];%Enabled Tx Channels, Only Needed for DMA
    
    tx.SamplesPerFrame = 2^12; %Number Of Samples: 4096
    
    tx.NCOEnables = ones(1,4);
    
    tx.MainNCOFrequencies = ones(1,4)*interFreq; %NCO Frequency
    
    tx.MainNCOPhases = zeros(1,4); %NCO Phase
    
    tx.DataSource = 'DMA'; %'DMA' or 'DDS'
    tx.EnableCyclicBuffers = 1; %0: Don't Cycle Tx Waveform, 1: Cycle Tx Waveform
    
    %create Tx waveform
    A = 2^15*db2mag(-6); %Tx Baseband Amplitude [dBFS]
    B = fs_RxTxIQ/2.5;
    N = tx.SamplesPerFrame;
    T = N/fs_RxTxIQ;
    t = linspace(-T/2,T/2,N);
    txSig = sinc(B*t);
    txSig2 = A*exp(2*-1i*pi*B*t);
    
    %CW Waveform
    swv1 = dsp.SineWave(A, basebandFreq);
    swv1.ComplexOutput = true;
    swv1.SamplesPerFrame = tx.SamplesPerFrame;
    swv1.SampleRate = fs_RxTxIQ;
    y = swv1();
    waveform = ones(tx.SamplesPerFrame,numel(tx.EnabledChannels)).*y;
    
    release(tx)
    tx(waveform); %send Tx data
    
    % Setup ADAR1000EVAL1Z in Tx Mode
    sray = adi.Stingray;
    sray.uri = uri;
    sray.Mode(:) = {'Tx'}; %set mode, 'Rx', 'Tx, 'Disabled'
    sray.TxAttn(:) = true; %1: Attenuation Off, 0: Attenuation On
    sray.TxGain(:) = 127; %127: Highest Gain, 0: Lowest Gain
    % sray.TRSwitchEnable(:) = false; %True: SPI control, False: TR Pin GPIO Control
    sray(); %Stingray Constructor
    sray.LatchTxSettings; %Latch settings to devices
    
    %Setup ADXUD1AEBZ, %Tx Mode
    sray.TXRX0 = 1; %0: RX, 1: TX
    sray.TXRX1 = 1;
    sray.TXRX2 = 1;
    sray.TXRX3 = 1;
    sray.RxGainMode = 0; %0: Low Gain, 1: High Gain, RX Mode only
    
    sray.PABiasOn(:) = -1.06;
    sray.TxPAEnable(:) = true;
    sray.TxPowerDown(1) = false; %Enable channel 1 for TX
    %% setup TDD
    sray.TxRxSwitchControl(:) = {'external'}; %spi: SPI TR Control, external: GPIO TR Control (TR_SOURCE)
     
    sray.FrameLength = 1; %frame length in ms
    sray.BurstCount = 0; %number of frames after enable. 0 equals infinite repeat
    sray.DMAGateingMode = 3;% 0 - none, 1 - rx_only, 2 - tx_only, 3 - rx_tx
    sray.Secondary = false;
    
    sray.TxVCOon = [0 0]; %Stingray/Xud1a TR Frame Start
    sray.TxVCOoff = [100e-3 0]; %Stingray/Xud1a TR Frame Stop
    sray.TxOn = [0 0] ; %MxFE TX Enable Frame Start
    sray.TxOff = [100e-3 0]; %MxFE TX Enable Frame Stop
    sray.TxDPon = [0 0] ; %MxFE TX Datapath Frame Start
    sray.TxDPoff = [100e-3 0] ; %MxFE TX Datapath Frame Stop
    sray.RxOn = [101e-3 0]; %MxFE RX Enable Frame Start
    sray.RxOff = [1 0]; %MxFE RX Enable Frame Stop
    sray.RxDPon = [101e-3 0] ; %MxFE RX Datapath Frame Start
    sray.RxDPoff = [1 0] ; %MxFE RX Datapath Frame Stop
    
    %units are in ms. Settings configure a 1 kHz PRF with 10% duty cycle
    sray.EnableMode = 3;% 1 - rx_only, 2 - tx_only, 3 - rx_tx
    sray.Enable = 1; %enable TDD Core

    Is there anything wrong? Could you give me some advice?

    best,

    Dongyu

  • Hi Dongyu, 

    The P3-15 sync pin needs to be toggled to activate the TDD engine. It's a +3.3V input. Has this been done?

    Sam 

  • Hi Sam,

    I connect the P3-13 which is 3.3V to the P3-15 and also detect the voltage of P3-15 which is 3.3v. What else can I do to detect if the TDD TX is activated successfully?

    Dongyu

  • Hi Dongyu, 

    I recommend connecting an oscilloscope channel to the TR probe point on the ADAR1000EVAL1Z and use it as the instrument trigger. To validate the RF output, I would recommend connecting one of the output channels to the input of a RF detector, then connect the Vout of the RF detector to an open channel on the oscilloscope.

    Regards, 
    Sam 

  • Hi Sam,

    Following your suggestion, I do some experiments:

    1. Connect P3-13 to P3-15:

    2. Connect one of the RF output to the input of a RF detector on the ADAR1000EVAL1Z board. And connect TR probe to an oscilloscope:

    3. Since there is no vout pin on the Stingray board which can be directly connected to an oscilloscope, we use the code "detect = sray.LTC2314RFPower" to detect the vout of the RF detector.

    4. The vout of RF detector is -54.4817, and the result of TR pin is:

    I think that there seems no Tx signal when we using TDD TX engine. The complete code we use is as following:

    clear all, close all, clc
    %% Array Mapping
    %verify element maps correctly to hardware!
    subarray = ...
        [[1 2 5 6 9 10 13 14];... %subarray 1
        [3 4 7 8 11 12 15 16];... %subarray 2
        [19 20 23 24 27 28 31 32];... %subarray 3
        [17 18 21 22 25 26 29 30]]';  %subarray 4 
    subarray_ref = [2 4 18 20]; %subarray reference elements
    dac_map = [4 3 2 1]; %DAC map to subarray
    dac_ref = 4; %DAC reference channel
    adc_map = [4 2 1 3]; %ADC map to subarray
    adc_ref = 4; %ADC reference channel
    
    %% Config Dev Platform
    
    % uri = 'ip:192.168.1.211';
    uri = 'ip:192.168.0.101';
    interFreq = 4.5e9; %Tx NCO Frequency & Unfolded Rx NCO Frequency [Hz]
    
    fs_RxTxIQ = 250e6; %IQ Sample Rate [Hz]
    periods = 32; %Desired Number Of Periods For Tx Signal
    basebandFreq = fs_RxTxIQ/periods; %Baseband Frequency [Hz]
    
    %Setup AD9081 Tx & Rx
    tx = adi.AD9081.Tx;
    tx.uri = uri;
    
    tx.EnabledChannels = [1 2 3 4];%Enabled Tx Channels, Only Needed for DMA
    
    tx.SamplesPerFrame = 2^12; %Number Of Samples: 4096
    
    tx.NCOEnables = ones(1,4);
    
    tx.MainNCOFrequencies = ones(1,4)*interFreq; %NCO Frequency
    
    tx.MainNCOPhases = zeros(1,4); %NCO Phase
    
    tx.DataSource = 'DMA'; %'DMA' or 'DDS'
    tx.EnableCyclicBuffers = 1; %0: Don't Cycle Tx Waveform, 1: Cycle Tx Waveform
    
    %create Tx waveform
    A = 2^15*db2mag(-6); %Tx Baseband Amplitude [dBFS]
    B = fs_RxTxIQ/2.5;
    N = tx.SamplesPerFrame;
    T = N/fs_RxTxIQ;
    t = linspace(-T/2,T/2,N);
    txSig = sinc(B*t);
    txSig2 = A*exp(2*-1i*pi*B*t);
    
    %CW Waveform
    swv1 = dsp.SineWave(A, basebandFreq);
    swv1.ComplexOutput = true;
    swv1.SamplesPerFrame = tx.SamplesPerFrame;
    swv1.SampleRate = fs_RxTxIQ;
    y = swv1();
    waveform = ones(tx.SamplesPerFrame,numel(tx.EnabledChannels)).*y;
    
    release(tx)
    tx(waveform); %send Tx data
    
    % Setup ADAR1000EVAL1Z in Tx Mode
    sray = adi.Stingray;
    sray.uri = uri;
    sray.Mode(:) = {'Tx'}; %set mode, 'Rx', 'Tx, 'Disabled'
    sray.TxAttn(:) = true; %1: Attenuation Off, 0: Attenuation On
    sray.TxGain(:) = 127; %127: Highest Gain, 0: Lowest Gain
    % sray.TRSwitchEnable(:) = false; %True: SPI control, False: TR Pin GPIO Control
    sray(); %Stingray Constructor
    sray.LatchTxSettings; %Latch settings to devices
    
    %Setup ADXUD1AEBZ, %Tx Mode
    sray.TXRX0 = 1; %0: RX, 1: TX
    sray.TXRX1 = 1;
    sray.TXRX2 = 1;
    sray.TXRX3 = 1;
    sray.RxGainMode = 0; %0: Low Gain, 1: High Gain, RX Mode only
    
    sray.PABiasOn(:) = -1.06;
    sray.TxPAEnable(:) = true;
    sray.TxPowerDown(1) = false; %Enable channel 1 for TX
    
    
    %% setup TDD
    sray.TxRxSwitchControl(:) = {'external'}; %spi: SPI TR Control, external: GPIO TR Control (TR_SOURCE)
     
    sray.FrameLength = 1; %frame length in ms
    sray.BurstCount = 0; %number of frames after enable. 0 equals infinite repeat
    sray.DMAGateingMode = 3;% 0 - none, 1 - rx_only, 2 - tx_only, 3 - rx_tx
    sray.Secondary = false;
    
    sray.TxVCOon = [0 0]; %Stingray/Xud1a TR Frame Start
    sray.TxVCOoff = [100e-3 0]; %Stingray/Xud1a TR Frame Stop
    sray.TxOn = [0 0] ; %MxFE TX Enable Frame Start
    sray.TxOff = [100e-3 0]; %MxFE TX Enable Frame Stop
    sray.TxDPon = [0 0] ; %MxFE TX Datapath Frame Start
    sray.TxDPoff = [100e-3 0] ; %MxFE TX Datapath Frame Stop
    sray.RxOn = [101e-3 0]; %MxFE RX Enable Frame Start
    sray.RxOff = [1 0]; %MxFE RX Enable Frame Stop
    sray.RxDPon = [101e-3 0] ; %MxFE RX Datapath Frame Start
    sray.RxDPoff = [1 0] ; %MxFE RX Datapath Frame Stop
    
    %units are in ms. Settings configure a 1 kHz PRF with 10% duty cycle
    sray.EnableMode = 3;% 1 - rx_only, 2 - tx_only, 3 - rx_tx
    sray.Enable = 1; %enable TDD Core
    
    detect = sray.LTC2314RFPower; %reads detected power (dBm) for J9 Input

    Could you give me some suggestions to figure out this problem? Thanks!

    -Dongyu

  • Dongyu, 

    The P3-15 pin (+3.3V Input) needs to be connected to an external source to toggle. I've had success using an Arduino or a simple switch to trigger the sync pin. P3-13 and P314 are for monitoring the TX and RX datapath switching for the TDD mode. They will also be enabled once the external sync is triggered.

    The onboard detector is not intended to be used for monitoring fast switching with MATLAB. Reading back the voltage in MATLAB is too slow for the TDD transitions. An external RF detector is recommended.  

    Regards, 
    Sam

  • Hi Sam,

    Following your suggestion, I use an Arduino to provide +3.3v. And I use the multimeter to detect the voltage difference between GND pin on the AD9081 and P3-15, which is 3.48V. Since we need to borrow other lab's RF detector, I just test the TR signal this time, the result are as follows:

    I think this is the signal generated by the external power, because it doesn't change as I run the "XBDP_TDD_Example.m ". To better test all the channel, I also enable all Tx channels using "sray.TxPowerDown(:) = false". Could you tell me when you can see the rectangle signal? Do I need to setup a stop point when I run the code? My TR signal are always the same.

    I think TDD engine synchronously control the AD9081, XUD1A and ADAR1000, right? So, I would like to test the DAC output on the AD9081 board using our normal (non RF) oscilloscope to see whether there is a rectangle wave. Before that, I set the NCO Frequency to 0Hz. Then I found the output signal of DAC is the original sinc signal not the expected rectangle signal after TDD control:

    Could you help me check whether my code is correct? I cannot find other reasons about why my TDD engine doesn't work.

    Dongyu