Post Go back to editing

ADALM2000 as an ADC for continuous data sampling

Category: Hardware
Product Number: ADALM2000

Hi, is it possible to use Adalm2000 for continuous sampling of signals that will send raw data to the serial port, just like a microcontroller (but faster)?

If so, which is the easiest way to implement this? 

I would appreciate if anyone could provide any suggestions on this.

Thank you

Parents Reply Children
  • Hi Adrian, thank you for your answer. I managed to save in a .txt file, 1000sec (or more) of continuous data at 10Ksps, with 64 buffers and acquiring 2^10 samples per channel in every loop, with the following piece of matlab code: 

    fp = fopen('adalm.txt','w');
    for k=1:10000
        data = ain.getSamplesInterleaved_matlab(2*2^10);
        data = data.double.';
        v = data(1:2:end);
        fprintf(fp,'%.8f\n', v1);
    Nevertheless, the above code gives discontinuity between successive loops at 100Ksps. So I have 2 questions:
    1) Adalm2000 (latest firmware) seems to ignore all sample rates >10Ksps and <100Ksps (truncates them to 10Ksps). Is there a reason for this? Permissible sample rates should only be multiples of 10? 
    2) Is there a way to improve the above code in order to have continuous data at increased sample rates? 
    Thank you.
  • Sample rates can only be set to multiples of 10 because there is some input filtering going on based on sample rate.

    You can always use setoversamplingratio() to further divide the sampling rate to the sampling rate that you want. A technique is to always use max sample rate, and then only set oversampling ratio to max_sample_rate/target_sample_rate. 

    Tested in C++ with libm2k calls we reached a few MSPS(2-4 MSPS) of data without discontinuities. I would imagine that the MATLAB penalty is not that great. 

    The code looks fine. You can try increasing the number of samples. Every transfer has some overhead, and the amount of data you are transferring here is quite low.