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.

Using the dual channel feature on the ADS4226EVM

Other Parts Discussed in Thread: ADS4226EVM, ADS4226, ADS6149

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

  • Hi,

    The EVM has a jumper selection for 2's complement data format or offset binary.  The Matlab code was written with the expectation of offset binary, but the EVM may have been set up for 2's complement.  The difference between the two formats is that the most significant bit is inverted.  To get from offset binary data to 2's complement simply invert the most significant bit.  To convert the other way, invert the msb.  The easiest thing to do is change the EVM to offset binary by moving a jumper (JP14) to offset binary LVDS.    Changing the Matlab code to expect 2's complement would involve inverting the msb of either the 12 bit or 14 data and then sign-extending through the rest of the 16 bit word - that could be done too.

    Regards,

    Richard P.

  • Hi,

    Moving a jumper (JP14) to offset binary LVDS does not give me the desired result.

    The result is the same with both jumper setting:

      3214
       3430
       3711
       4033
        267
        572
        820
        991
       1066
       1037
        907
        691
        410
         88
       3855
       3550
       3301
       3131
       3057
       3085

     

    I expected, if I short JP19 to 2's complement LVDS position, that the result shows a sine wave but it was not.

    The sampling resolution of ADS4226EVM is 12 bits. Therefore, 0 to 4096 values can be detected.

    4033 and 267 are shown in the figure and 4033 should be less than 267 or 267 should be higher than 4033.

    In readSerial_ADS4226.m, there are following statements:

    d = fread(obj,obj.BytesAvailable/2,'uint16');
            d = swapbytes(uint16(d));

            switch lower(adcName)
                case 'ads6149'
                    d = bitshift(d,-2);
                    bMask = hex2dec('3fff');

    ...

            d = bitand(d,bMask);

     

    Should I change this part to remove discontinuity or did I make a mistake in jumper setting?

     

    Regards,

    Euncheon

     

  • I solved this proplem with the code modification.

    Thanks.

     

    Regards,

    Euncheon