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/LAUNCHXL-CC1310: two or more channels of continuous sampling with timer-ed UDMA using TIRTOS (how to set it up)

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

Tool/software: TI-RTOS

I am trying to follow the example (C:\ti\simplelink_cc13x0_sdk_1_40_00_10\examples\rtos\CC1310_LAUNCHXL\drivers\adcbufcontinuous) and sample two channels (IOID_23, IOID_24) continuously.

const ADCBuf_Config ADCBuf_config[CC1310_LAUNCHXL_ADCBUFCOUNT] = {
    {
        &ADCBufCC26XX_fxnTable,
        &adcBufCC26xxObjects[CC1310_LAUNCHXL_ADCBUF0],
        &adcBufCC26xxHWAttrs[CC1310_LAUNCHXL_ADCBUF0]
    },
};

Questions:

Do I need CC1310_LAUNCHXL_ADCBUF1, in addition to CC1310_LAUNCHXL_ADCBUF0?

  /* Set up an ADCBuf peripheral in ADCBuf_RECURRENCE_MODE_CONTINUOUS */
    ADCBuf_Params_init(&adcBufParams);
    adcBufParams.callbackFxn = adcBufCallback;
    adcBufParams.recurrenceMode = ADCBuf_RECURRENCE_MODE_CONTINUOUS;
    adcBufParams.returnMode = ADCBuf_RETURN_MODE_CALLBACK;
    adcBufParams.samplingFrequency = 200;
    adcBuf = ADCBuf_open(Board_ADCBUF0, &adcBufParams);


    /* Configure the conversion struct */
    continuousConversion.arg = NULL;
    continuousConversion.adcChannel = Board_ADCBUF0CHANNEL0;
    continuousConversion.sampleBuffer = sampleBufferOne;
    continuousConversion.sampleBufferTwo = sampleBufferTwo;
    continuousConversion.samplesRequestedCount = ADCBUFFERSIZE;

Questions:

Also need to ADCBuf_open(Board_ADCBUF1, ...)?

Also continuousConversion2.adcChannel = Board_ADCBUF0CHANNEL1;?

I'd like to take ADC samples on IOID_23 AND IOID_24 simultaneously. So I prefer only one timer triggered DMA, as well as one callback function. How shall I configure this?

  • Both the ADC it self and the driver is not designed to do time multiplexing between channels.

    The ADCBuf driver is designed to ensure sampling of a waveform with equal time between the samples. Since both the ADC and the driver is not designed for time multiplexing it is far from straight forward to sample more than one DIO using this driver.

    Are you sampling a waveform that require strict timing between sampling the two DIOs?
  • Thanks for the quick reply. Yes, I'd like to have a determined time interval (as small as possible) between two DIO samplings.

    I guess I can take single shot of one DIO and then do the other. That's going to be much slower than uDMA, right? How about using the Sensor Controller?
  • The ADC is a shared resource so with the this use case it should give more or less the same result to use the ADC driver and Sensor Controller. Typically using the later is good if you want to do one reading every second and only alert the CM3 if a value is above a limit/ changed above a limit.

    Yes, doing to sequential reads on two different IOs will take longer time since you have to configure the ADC between each sample to change which DIO it uses for input.

    In the ADC help in sensor controller studio you will find an example for reading multiple inputs, you can test the speed easily using this.
  • Ok, I'll bite. Just downloaded Sensor Controller Studio.   Where's the multi-channel example?  Both the data logger and the streamer look set up to do only one channel. 

  • As I wrote: Please look in the help for the ADC for some code snippets.
  • Ok, fine.   A little more information would be helpful though.  I finally found the example in the help you were talking about.  But there's no mention of sampling rate there.  Here's what I want to do: sample two channels at 20kHz.   It looks like you can schedule the ADC off timer 1, but that only runs at 4kHz.   Is it possible to get accurately-timed sampling of more than one ADC channel using the AUX processor?  If so, what's the maximum sample rate that the processor can support for two channels?