This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TSW14J56EVM: TSW14J56evm

Part Number: TSW14J56EVM

Hi,

Actually I have been working on the ADS54J60evm+TSW14J60evm.

So, I am planning to automate the whole process of HSDC using MATLAB.

I have saved the MATLAB directory in the C:\Program Files (x86)\Texas Instruments\High Speed Data Converter Pro\HSDCPro Automation DLL\64Bit DLL.

I am not sure of which folder contains the Automation DLL (I mentioned this one C:\Program Files (x86)\Texas Instruments\High Speed Data Converter Pro\HSDCPro Automation DLL\64Bit DLL).

Also, Is the HSDC Automation DLL installed in the HSDC installer only or do I need to download the ping pong example available on the HSDC site.

I referred to the Automated Data Transfer Between TSW40RF8x and TSW14J56 using MATLAB mentioned on the HSDC site.

I'll be attaching some relevant documents.

Can you share with me your mail ID, I'll send you the MATLAB code.

Thanks.

  • Please zip your code and attach it in this post.

  • I am not finding any option to attach files

  • On the bottom of the page, click on "Insert", then select "Image/Video/File". I new window opens. Click on 'Upload', then navigate to the file. 

  • hsdc_matlab_dll.txt
    % Add folder into path that contains the Automation DLL
    addpath(genpath('C:\Program Files (x86)\Texas Instruments\High Speed Data Converter Pro\HSDCPro Automation DLL\64Bit DLL'));
    % Load the Automation DLL
    if ~libisloaded('HSDCProAutomation_64Bit')
        [notfound,warnings]=loadlibrary('C:\Program Files (x86)\Texas Instruments\High Speed Data Converter Pro\HSDCPro Automation DLL\64Bit DLL\HSDCProAutomation_64Bit.dll', @HSDCProAutomationHeader);
        %[notfound,warnings] = loadlibrary(___) returns warning information, and can include any of the input arguments in previous syntaxes.loadlibrary(libname,hfile) loads functions from C shared library libname defined in header file hfile into MATLAB®. 
        % The loadlibrary function only supports calling functions that are callable from C and header files that can be parsed by a C compiler.
    end
    
    %****ADC SETTINGS****%
    
    % Board Serial Number with board type separated by hyphen. Eg: TIVHIV9Z-TSW1400
    BoardSerialNumberADC = 'T751R8Z5-TSW14J56revD';
    % Firmware file path which needs to be loaded to the board.
    FirmwareFilePath = 'C:/Program Files (x86)/Texas Instruments/High Speed Data Converter Pro/14J56revD Details/Firmware/TSW14J56REVD_FIRMWARE.rbf';
    ADCDevice = 'ADS54J60_LMF_8224';
    WaitToCheck=1; % Wait to check if firmware is downloaded properly? 0 - No, 1 - Yes. If yes, timeout should be greater than 60sec.
    TimeoutInMs = 30000;
    ADCOutputDataRate = 983040000;
    %ADCInputTargetFrequency = 0;
    NumberOfSamplesPerChannel = 65536; % Smaller number of samples, faster execution time of script.
    %NumberOfSamplesForAnalysis = 16384;  %Keep smaller to reduce FFT time
    %ChannelIndex=0; % Interested channel's index(0-based)
    
    %Get Array of Capture Data
    Number_Of_Samples_Per_Channel = 4096;
    OffsetSamplePerChannel = 0;
    Capture_Data_Array_Len = 32768; % Number_of_Samples_per_channel * Number_of_Channels
    CaptureData_16bits = zeros(Capture_Data_Array_Len,1); %Initializing the array for the total number of samples
    
    % Selection Settings
    TestSelection = 0; % Time Domain-0; Single Tone-1; Two Tone-2; Channel Power-3
    PlotType = 1; % Codes - 0; Bits - 1; Real FFT - 2; Complex FFT - 3
    
    % File Save Settings. 
    CSVFilePathWithName = 'C:\Users\a0489979\Desktop\SS.csv'; 
    %BinaryFilePathWithName = 'C:/Users/Public/Documents/Texas Instruments/High Speed Data Converter Pro/Example Files/MatLAB Files/ADCData.bin';
    
    %The CSV file contains the time domain data of all channels with each channel as a separate column.
    %The binary file contains the time domain data of all channels in interleaved format.
    
    % ********************************************************************************//
    % ********** The actual call to the function contained in the dll ****************//
    % ********************************************************************************//
    fprintf('\nPlease open the HSDCPro GUI before using these Automation DLL functions.');
    input('\nPress ENTER to start...');
    
    % Connecting to the board and selecting DAC device
    fprintf('\n\nConnecting to board : %s',BoardSerialNumber);
    [Error_Status] = calllib('HSDCProAutomation_64Bit','Connect_Board',BoardSerialNumber,TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    % calllib(libname,funcname,arg1,...,argN) calls function funcname in C library libname, passing input arguments arg1,...,argN. 
    % The calllib function returns output values obtained from funcname in x1,...,xN.
    
    
    fprintf('\n\nSelecting ADC Device : %s',ADCDevice);
    [Error_Status] = calllib('HSDCProAutomation_64Bit','Select_ADC_Device',ADCDevice,120000);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    % Download Firmware(OPTIONAL). Selecting device itself(above function) will automatically download the firmware
    % fprintf('\n\nDownloading Firmware : %s',FirmwareFilePath);
    % [Error_Status] = calllib('HSDCProAutomation_64Bit','Download_Firmware',FirmwareFilePath,WaitToCheck,60000);
    % fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    fprintf('\n\nReloading Device INI...');
    [Error_Status] = calllib('HSDCProAutomation_64Bit','Reload_Device_INI',TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    fprintf('\n\nConfiguration Settings:');
    fprintf('\n\nPassing ADC Output Data Rate = %d',ADCOutputDataRate);
    [Error_Status] = calllib('HSDCProAutomation_64Bit','Pass_ADC_Output_Data_Rate',ADCOutputDataRate,TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status));
    
    %fprintf('\n\nADC Input Target Frequency = %d',ADCInputTargetFrequency);
    %[Error_Status] = calllib('HSDCProAutomation_64Bit','Set_ADC_Input_Target_Frequency',ADCInputTargetFrequency,TimeoutInMs);
    %fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status));
    
    fprintf('\n\nNumber of Samples per Channel = %d',NumberOfSamplesPerChannel);
    [Error_Status] = calllib('HSDCProAutomation_64Bit','Set_Number_of_Samples',NumberOfSamplesPerChannel,TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status));
    
    %fprintf('\n\nAnalysis Window Length = %d',NumberOfSamplesForAnalysis);
    %[Error_Status] = calllib('HSDCProAutomation_64Bit','ADC_Analysis_Window_Length',NumberOfSamplesForAnalysis,TimeoutInMs);
    %fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status));
    
    fprintf('\n\nChecking if HSDCPro GUI has completed all its operations...');
    [Error_Status] = calllib('HSDCProAutomation_64Bit','HSDC_Ready',TimeoutInMs); % Waiting to check if HSDCPro has completed all its operations.
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status));
    
    fprintf('\n\nGetting an array of Capture Data in 16 bits');
    [Error_Status, CaptureData_16bits] = calllib('HSDCProAutomation_64Bit','Get_Capture_Data_16bits',Number_Of_Samples_Per_Channel, OffsetSamplePerChannel, CaptureData_16bits, Capture_Data_Array_Len, TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status));
    
    fprintf('\n\nSaving ADC Raw Data as CSV file at %s', CSVFilePathWithName);
    [Error_Status] = calllib('HSDCProAutomation_64Bit','Save_Raw_Data_As_CSV',CSVFilePathWithName,TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    
    %fprintf('\n\nSaving ADC Raw Data as Binary file at %s', BinaryFilePathWithName);
    %[Error_Status] = calllib('HSDCProAutomation_64Bit','ADC_Save_Raw_Data_As_Binary_File',BinaryFilePathWithName,TimeoutInMs);
    %fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    % Applying FFT Settings, just for displaying 'Bit' and 'Time Domain' on the
    % graph in HSDC
    
    fprintf('\n\nTest Selection Option = %d (Time Domain-0; Single Tone-1; Two Tone-2; Channel Power-3)',TestSelection);
    [Error_Status] = calllib('HSDCProAutomation_64Bit','ADC_Test_Selection',TestSelection,TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    fprintf('\n\nGraph Plot Type = %d (Codes - 0; Bits - 1; Real FFT - 2; Complex FFT - 3)',PlotType);
    [Error_Status] = calllib('HSDCProAutomation_64Bit','ADC_Plot_Type',PlotType,TimeoutInMs);
    fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    
    
    % Disconnecting from the board
    %fprintf('\n\nDisconnecting from the board');
    %[Error_Status] = calllib('HSDCProAutomation_64Bit','Disconnect_Board',TimeoutInMs);
    %fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 
    
    %input('\n\nPress ENTER to exit..');

  • Raeleen,

    It appears you are trying to use the Matlab 64bit example present in the HSDC Pro installer folder and edit it as per the usage. 

    Can you place the file 'data_capture.m', which you are working on, at the below location and run it. The header file and the thunk files are present at the following location:

    C:\Program Files (x86)\Texas Instruments\High Speed Data Converter Pro\HSDCPro Automation DLL\Manual and Examples\Automation DLL Matlab Example\64Bit Matlab

    Please find the HSDC Pro Automation DLL Manual at the following location,

    C:\Program Files (x86)\Texas Instruments\High Speed Data Converter Pro\HSDCPro Automation DLL\Manual and Examples\HSDCPro Automation DLL Manual.doc

    Regards,

    Jim