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.

CCS/EK-TM4C123GXL: Sampling using multiple ADC modules

Part Number: EK-TM4C123GXL

Tool/software: Code Composer Studio

Is it possible to sample two different ADC simultaneously, ie triggering them simultaneously without affecting the sampling rate ? Also another question, if I use the SS3 sample sequencer containing one sample, is it going to affect my sampling rate ? In my opinion it should not. Please clarify.

  • Uddipan Kundu said:
    Is it possible to sample two different ADC simultaneously, ie triggering them simultaneously without affecting the sampling rate ?

    When you use both ADC converters with the same trigger source, yes the conversions are truly simultaneous. 

    Uddipan Kundu said:
    if I use the SS3 sample sequencer containing one sample, is it going to affect my sampling rate ?

    I don't think I understand your question. If you are only using SS3 sampling a single channel, then your sample rate is a function of trigger source or ADC clock speed in the case of continuous conversions. If you are using a different sequence and then add sequence 3, it then depends on priority and trigger source. A high priority sequence will interrupt a lower priority sequence between samples, but not abort an on-going conversion. 

  • My question was that while using the sample sequencer 3 whether the sampling rate slows down from the 1 MSPS rate. I am using only SS3 to ensure fastest sampling rate.Clearly it should not slow down. However are there any other factors that can slow it down is what I wanted know. Does sampling with the ADC processor trigger ensure 1 MSPS sampling rate ? What if I use always mode, as there are no other lower priority sequences. Does it have the same sampling rate or if I use that mode can I generate interrupt to signal ongoing conversion ? And can I store the sampled value as the conversion process is continuous.

  • If you are sampling only one channel in continuous mode using the specified 16MHz ADC clock, then your sample rate will be 1Msps regardless of which sequencer you use. If you are using the uDMA to move the ADC samples to RAM, using sequence 3 is fine. If you are using the CPU and interrupts to move the data, then using sequence 0 which has an 8 level FIFO might be preferred as it will allow for a longer interrupt latency time.

  • Okay. But what is the continuous mode. If we use the ADC_PROCESSOR_TRIGGER to trigger the sampling process is that the continuous mode or if we use the ADC_TRIGGER_ALWAYS that is the continuous mode ? I guess its the former. What is the difference however while using any of these when using a single sequencer ? Thank you for your previous answer anyway. That cleared a lot of doubts.

  • Use  ADC_TRIGGER_ALWAYS to start continuous mode. Using ADC_PROCESSOR_TRIGGER prepares the ADC to trigger each time the function ADCProcessorTrigger() is called.

  • Bob Crosby said:

    Use  ADC_TRIGGER_ALWAYS to start continuous mode. Using ADC_PROCESSOR_TRIGGER prepares the ADC to trigger each time the function ADCProcessorTrigger() is called.

    The ADCProcessorTrigger function then triggers the conversion and takes as input the base address and the sequencer value. Then it samples according to the priority order set before. All the sampling in a sequencer however should take place at 1 Msps. Correct me if I am wrong.  The ADC_CONTINUOUS_TRIGGER however asserts the trigger throughout the process. However if we configure the ADC as ADC_PROCESSOR_TRIGGER  and call the function ADCProcessorTrigger() continually inside a while loop, it should give same result like the continuous mode, the overall sampling rate though might get slower due to the loop. Again correct me if I am wrong.  

  • Yes that is correct. Each conversion takes 1uS to complete. From a practical standpoint use ADC_TRIGGER_ALWAYS if you want 1Msps (one sample every uS). Using the processor to trigger the sample will eventually add small delays in the sampling caused when the CPU is busy doing work other than just sitting continually in the while loop.

  • Thanks a lot for your the answers. This really cleared my doubts.Anyway thanks again.