Devices: ADC - AD8285CP-EBZ, Data capture - HSC-ADC-EVALCZ.
Hi! I'm trying to write MATALB program for data capture in our automotive radar project using HadBoardApi. I've found few examples for one-channel acqisition, but I can't scale that code for multiple chanels. Can you show me how to do that please?
Here is example of my code:
clear variables MyHadBoardApi = NET.addAssembly('C:\Program Files (x86)\Analog Devices\VisualAnalog\HadBoardApi.dll'); HadBoardApi.HadBoard.FindBoards(); if (HadBoardApi.HadBoard.BoardCount) disp('Board Found!') else disp('Board NOT Found!') end fpgaFilePath = 'C:\Program Files (x86)\Analog Devices\VisualAnalog\Hardware\HSC_ADC_EVALC\AD8283.bin'; HadBoardApi.HadBoard.Board.ConfigureFpga(fpgaFilePath); disp('FPGA Programmed!') %% Configure ADC/FPGA SPI Registers: %[reg_addrs, reg_values]=AD9625_parseXML('C:\ProgramData\Analog Devices\SPIController\Cfgs\ad8283.cal'); HadBoardApi.HadBoard.Board.SpiInitInterface(1,HadBoardApi.HadSpiParameters(1,0,1)); %HadBoardApi.HadBoard.Board.SpiWrite(reg_addrs, reg_values); %HadBoardApi.HadBoard.Board.SpiWrite(int16(hex2dec('00')), bin2dec('01111110')); HadBoardApi.HadBoard.Board.SpiWrite(int16(hex2dec('05')), bin2dec('00001111')); HadBoardApi.HadBoard.Board.SpiWrite(int16(hex2dec('0C')), bin2dec('00000010')); %HadBoardApi.HadBoard.Board.SpiWrite(int16(hex2dec('0D')), bin2dec('01000001')); %HadBoardApi.HadBoard.Board.SpiWrite(int16(hex2dec('0F')), bin2dec('01111100')); HadBoardApi.HadBoard.Board.SpiWrite(int16(hex2dec('2C')), bin2dec('00000000')); HadBoardApi.HadBoard.Board.SpiWrite(int16(hex2dec('FF')), bin2dec('00000001')); HadBoardApi.HadBoard.Board.FpgaSpiWrite(uint16([288;289;292]),uint16([135;7;31])); if (HadBoardApi.HadBoard.Board.SpiRead(int16(10))) disp('PLL Locked'); else disp('PLL NOT Locked'); end if (HadBoardApi.HadBoard.Board.SpiRead(int16(20))) disp('Twos Complement'); else disp('offset binary') end %% Get Data From ADC: DataLength = int32(2^10); HadBoardApi.HadBoard.Board.FillFifos (DataLength, 30); if (uint16(HadBoardApi.HadBoard.Board.FpgaSpiRead(uint16(330)))==16) HadBoardApi.HadBoard.Board.FpgaSpiWrite(uint16(320),uint16(3)); else ADC_Data1 = HadBoardApi.HadBoard.Board.CaptureFifoWords (DataLength, 0); %ADC_Data2 = HadBoardApi.HadBoard.Board.CaptureFifoWords (DataLength, 1); end u1 = (double(uint16(ADC_Data1))-32768); u2 = mod(u1,16); %u1(2,:)=((double(uint16(ADC_Data2))-32767)./32767); %u2 = u1 - mean(u1); plot(u1); %plot(abs(fft(u1)));
In this case I get same data for two channels, but there are two different signals from two generators on the ADC board.
This code is result of compilation of examples from this site. I feel lack of uderstanding how this code works because i can't find any documentation for HadBoardApi, but i've seen several mentions of some .chm file. Can you give a link to this file or any other docs please?
Thanks a lot.
Updated Title to include reference to AD8285CP-EBZ
[edited by: TonyM at 8:21 PM (GMT 0) on 3 Feb 2020]