ZCU102+AD9082 Matlab Communication Toolbox Support - Hardware Setup Issue

I am trying to use Matlab to stream data for ZCU102+AD9082: https://wiki.analog.com/resources/tools-software/hsx-toolbox  Matlab version 2020.b, zcu102 rev1.1, AD9082.

After installing the "Communications Toolbox Support Package for Xilinx Zynq-Based Radio", The hardware setup pops up to let me do some configurations, write the SD card, and boot the board. In the "Verify Radio Connection" section, the "Test data path between host and RF card" didn't pass with error msg: Error receiving data from the RF card. The Done LED and DS44 LED on zcu102 are on and normal, But the HMC_STATUS LED on the AD9082 board is on and RED. It is similar to last week when I was trying to set up the Linux image but the device tree/HDFs are from AD9081 instead of AD9082: https://ez.analog.com/fpga/f/q-a/547029/ad9082-zcu102-hmc_status-red-led-is-on/424651#424651

I guess there is a mismatch between the hardware data lanes and the device tree/HDF. 

Is there any working solution for using matlab with ZCU102+AD9082?

Thanks,

Jiachen

Top Replies

Parents
  • In the Matlab, I am trying to get a frame of data: (I am referring to this example code: github.com/.../ad9081PFIR.m)

    uri = 'ip:169.254.145.15';
    %% RX
    rx = adi.AD9081.Rx();
    rx.uri = uri;
    rx.EnabledChannels = 1;
    rx.SamplesPerFrame = 32768;
    data = rx();

    But got errors:

    Error using matlabshared.libiio.base/cstatus
    Channel: voltage2_i not found
    
    Error in adi.common.Attribute/setAttributeLongLong (line 13)
                cstatus(obj,status,['Channel: ' id ' not found']);
    
    Error in adi.AD9081.Base/CheckAndUpdateHW (line 75)
                        obj.setAttributeLongLong(id,attr,value(k),output, tol, phy);
    
    Error in adi.AD9081.Rx/setupInit (line 204)
                obj.CheckAndUpdateHW(obj.ChannelNCOFrequencies,...
    
    Error in adi.common.RxTx/configureChanBuffers (line 219)
                setupInit(obj);
    
    Error in matlabshared.libiio.base/setupImpl
    
    Error in adi.common.RxTx/setupImpl (line 117)
                setupImpl@matlabshared.libiio.base(obj);
    
    Error in Untitled2 (line 7)
    data = rx();

    The sampling is NaN, and it doesn't have a set method:

    >> rx
    
    rx = 
    
      adi.AD9081.Rx with properties:
    
                 SamplingRate: NaN
        ChannelNCOFrequencies: [0 0 0 0]
           MainNCOFrequencies: [0 0 0 0]
             ChannelNCOPhases: [0 0 0 0]
                MainNCOPhases: [0 0 0 0]
                     TestMode: 'off'
                  EnablePFIRs: false
                PFIRFilenames: ''
              SamplesPerFrame: 32768
              EnabledChannels: 1
                          uri: 'ip:169.254.145.15'
    
    >> rx.SamplingRate = 1000
    In class 'adi.AD9081.Rx', no set method is defined for Dependent property 'SamplingRate'.  A Dependent property needs a set method to assign its value.

    Do you know how to resolve it?

  • 0
    •  Analog Employees 
    on Jul 16, 2021 7:00 PM in reply to InvasiveBrush

    The sample rate is not a tunable property at runtime. It can only be done through the device tree and will be bound by the available clocks and references.

    https://wiki.analog.com/resources/tools-software/linux-drivers/iio-mxfe/ad9081

    This applies as well: https://wiki.analog.com/resources/eval/user-guides/rf-trx-vcxo-and-profiles

    What device tree are you currently using with AD9082?

    -Travis

  • 0
    •  Analog Employees 
    on Jul 29, 2021 9:32 PM in reply to InvasiveBrush

    How are you arriving at these decimation/interpolation values? Main decimators/interpolators have a max setting of only 6.

    -Travis

  • I see. I am trying to use DMA in MATLAB to transmit some modulated data. Currently I am using the example file provided: https://github.com/analogdevicesinc/iio-oscilloscope/blob/master/waveforms/qpskwithfilt_30.72M.txt 

    It works in the IIO Oscilloscope by directly loading it:

    For controlling the Tx In the MATLAB, I made a vector of complex data from this .txt and transmitted it:

    %% TX
    tx = adi.AD9081.Tx('num_data_channels',2,'num_coarse_attr_channels',2,'num_fine_attr_channels',2);
    tx.uri = uri;
    tx.DataSource = 'DMA';
    tx.NCOEnables = [1 1];
    tx.EnabledChannels = [1];
    tx.MainNCOFrequencies = TX_MainNCOFreq;
    tx.EnableCyclicBuffers = true;
    
    filename = "ADI_waveforms\qpskwithfilt_30.72M.txt";
    delimiterIn = ',';
    headerlinesIn = 1;
    A = importdata(filename,delimiterIn,headerlinesIn);
    TxData = A.data(:,1) + A.data(:,1).*1j; %Make the 1-d complex data for channel 1
    tx(TxData);

    But it doesn't seem to be right:

    I used some code from this example code: https://github.com/analogdevicesinc/HighSpeedConverterToolbox/blob/master/test/AD9081HWTests.m

    It seems this example code is not transmitting complex data. So I am not sure what is the correct format for transmitting IQ data in matlab.

    My full code is here:

    uri = 'ip:169.254.145.15';
    TX_MainNCOFreq = [2400e6 2400e6];
    RX_MainNCOFreq = [2400e6 2400e6];
    %% TX
    tx = adi.AD9081.Tx('num_data_channels',2,'num_coarse_attr_channels',2,'num_fine_attr_channels',2);
    tx.uri = uri;
    tx.DataSource = 'DMA';
    tx.NCOEnables = [1 1];
    tx.EnabledChannels = [1];
    tx.MainNCOFrequencies = TX_MainNCOFreq;
    tx.EnableCyclicBuffers = true;
    
    filename = "ADI_waveforms\qpskwithfilt_30.72M.txt";
    delimiterIn = ',';
    headerlinesIn = 1;
    A = importdata(filename,delimiterIn,headerlinesIn);
    TxData = A.data(:,1) + A.data(:,1).*1j; %Make the 1-d complex data for channel 1
    tx(TxData);
    %% RX
    rx = adi.AD9081.Rx('num_data_channels',2,'num_coarse_attr_channels',2,'num_fine_attr_channels',2);
    rx.uri = uri;
    rx.EnabledChannels = [1];
    rx.SamplesPerFrame = 4096;
    rx.MainNCOFrequencies = RX_MainNCOFreq;
    data = rx();
    plot(real(data(:,1)),imag(data(:,1)),'o'); %Constellation
    
    tx.release();
    rx.release();

  • 0
    •  Analog Employees 
    on Jul 29, 2021 11:53 PM in reply to InvasiveBrush

    High-Speed Converter Toolbox does not scale input data. It directly converts it to ints. So you are likely only transmitting 0's.

    -Travis

  • That works. With the example data file, the constellation waveform is not showing very distinct 4 clusters. Is it related to the sampling rate? The data file is 30Mhz but the DAC sampling rate is 1.5Ghz. Do I need to manually interpolate the example data file to match the 1.5Ghz sampling rate?

    Thanks,
    Jiachen 

  • 0
    •  Analog Employees 
    on Jul 30, 2021 9:14 PM in reply to InvasiveBrush

    You are transmitting a filtered QPSK waveform, so it will unlikely be just 4 symbols. You also need to timing correct the data to fix any fractional offsets.

    -Travis

Reply Children
No Data