Hi,
I found this answer is useful.
http://e2e.ti.com/support/data_converters/high_speed_data_converters/f/68/p/2719/9350.aspx#9350
I changed the code to think simply about this problem. In addition, I did not change the code looked nicely. This is working code for dual channel data acquisition but not the final for ADS4226EVM.
---- makeCapture_ADS4226.m
clear all;
fs = 120;
fin = 1;
N = 32768;
coherentFin;
fs = fs*1e6;
fin = fin*1e6;
fprintf('\n\nCoherent Input Frequency is %8.2f Hz\n\n', fin);
adcName = 'ads62p2x';
adcChnl = 'AB';
% Initialize and connect the serial port
initSerial;
% make a capture
writeSerial_ADS4226(objSerial1, adcName, N, adcChnl);
ADCout = readSerial_ADS4226(objSerial1, adcName);
leng = size(ADCout)%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ADCoutA = ADCout(1:N);%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ADCoutB = ADCout(leng-(N-1):leng);
delSerial;
Bits = 12;
figure(1)
adc_performance2(Bits, fs/1e6, fin/1e6, 1, double(ADCoutA), 1)
figure(2)
adc_performance2(Bits, fs/1e6, fin/1e6, 1, double(ADCoutB), 1)
---- adc_performance2.m
function adc_performance2(NumBits, Fs, Fin, FundaBins, ADCData, useWindow)
x = 1:1000;
y = ADCData(x);
plot(x, y)
Then, I get above result.
I wonder whether the values larger than 3500 is complying with the design intention of FPGA-firmware or not.
If it does not comply, could you please revise the code a little?
I expect readSerial_ADS4226 file should be modified to solve this problem since it seems a 2's complement number problem.
Regards,
Lim, Euncheon