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.

RTOS/CC1310: Sampling multiple ADC channels

Part Number: CC1310


Tool/software: TI-RTOS

Champs,

Customer requires sampling several ADC channels and I need to establish maximum sampling speed available for such use case. I put together and benchmarked a quick example utilizing Driverlib ADCBuf driver which essentially boils down to the following sequence inside the innermost loop.

adc = ADC_open(Board_ADC0, &params);

res = ADC_convert(adc, &adcValue0);

ADC_close(adc);

adc = ADC_open(Board_ADC1, &params);

res = ADC_convert(adc, &adcValue1);

ADC_close(adc);

Top sampling speed for such use case is around 5.6 Khz, which is way lower than the customer would require.

The question is: is there any way to speed things up, preferably have ADC HW free-run to do conversions according to preset parameters on more than one channel with no SW intervention?

thanks

Michael

  • Hi Michael,

    There is no support for multi-channel sampling with any of our drivers (or by HW) as of today. That said, I would assume you could push it a bit faster then 5.6 KHz, what is the customer requirement?
  • Hi M-W,

    Thanks for the prompt response. Customer ideally would like to sample two 50 Khz channels plus few more at a very low speed (5-10 Hz). It does not look like this is gonna fly.though. I copied the whole while(1) code below for reference. Typical values accumulated in the timebuffer are ~4200 which, assuming 24 Mhz clock, translates to ~5.6K samples per second. If you think I am missing something or can think of a way to speed things up I'd greatly appreciate your insights.

    regards

    Michael

    while (1) {
    t_b=TimerValueGet(MYTIMER,TIMER_A);
    adc = ADC_open(Board_ADC0, &params);

    /* Blocking mode conversion */

    res = ADC_convert(adc, &adcValue0);

    ADC_close(adc);

    t_a=TimerValueGet(MYTIMER,TIMER_A);
    adc0_timebuffer[tc]=t_a-t_b;

    t_b=TimerValueGet(MYTIMER,TIMER_A);

    adc = ADC_open(Board_ADC1, &params);
    /* Blocking mode conversion */
    res = ADC_convert(adc, &adcValue1);
    ADC_close(adc);

    t_a=TimerValueGet(MYTIMER,TIMER_A);
    adc1_timebuffer[tc]=t_a-t_b;
    tc++;
    if(tc==9) tc=0;
    } //while (1)

  • Hi Michael,

    As the ADC supports up to 200k samples/second I would be surprised if we were not able to push it a bit more then 5.6k S/s as you are seeing. That said, I do think your numbers are correct for the approach you have taken.

    Neither the ADCBuf or ADC driver is written to support ADC input multiplexing but the ADCBuf could potentially provide you with a better result as you can perform two back-to-back conversions on different channels if you want.

    So to me more specific on my question, how long of a "gap" between sampling the first signal to sampling the second signal are they OK with? Do they need to do single samples (C1 -> C2 -> C1 -> C2 ...) or do they want multiple samples / channel (C1 * X -> C2 * X -> C1 *x -> C2 * x ...) ?
  • Hi M-W,

    Yes, my assumption is that the sample rate for each channel needs to be (relatively) constant with continuous sampling in each channel. I will work with the customer to see to what extent this can be relaxed. I will come back to this thread should follow-up questions arise.

    Thanks a lot for your help!

    Michael