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.

TM4C1294NCPDT: Signal interrupt at the end of total ADC DMA transfere

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Hi Folks,

In my project I need to sample all of  the 20 analog inputs. To do this, I want to use ADC0's all sample sequencer and 1 from ADC1 so every distinct step in the sample sequencers will monitor a particular analog input pin. I plant to generate trigger event from a timer and use uDMA for result gaining. The following issues that I want to clarify:

  1. Can I configure timer for continues trigger generation without any interrupt routine? Without CPU load...

To get data from sample sequencers, I plan to use periphery scatter-gatter uDMA:

  1. Is the periphery scatter-gatter the right choose for getting all ADC result without programmatic interaction?
  2. How can I generate SINGLE uDMA (ADC) interrupt that asserts after all of the configured scatter-gatter uDMA transfer completed? Check the datasheet: DMA interrupt is only peer sample sequencer bases

Regards,

Toth, Norbert

  • Interesting idea. I have not tried that but think it should work.

    Norbert Toth said:
    Can I configure timer for continues trigger generation without any interrupt routine? Without CPU load

    Yes.

    Norbert Toth said:
    Is the periphery scatter-gatter the right choose for getting all ADC result without programmatic interaction?

    To get more than 8 samples without a CPU interrupt yes. I am not sure why you don't use 12 channels from one ADC and 8 from the other. It might simplify things. Since to convert 20 channels you will need to use more than one sequence, yes peripheral scatter-gather would be correct. You could setup ADC0 sequence 0 for 8 channels, ADC0 sequence 1 for 4 channels and ADC1 sequence 0 for the other 8 channels. A single timer can start both ADCs. ADC1 will complete first as it only has 8 channels to convert. For this ADC you can configure the DMA for basic or ping-pong mode. There is a good example in the new TivaWare version 2.2.0.295 that uses a timer to trigger the ADC and the DMA in ping-pong mode.

    C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\adc_udma_pingpong

    For ADC0 you would need to use peripheral gather-scatter to get the data from both sequences without CPU intervention. There is a gather-scatter demo in the new TivaWare, but it is for UART instead of ADC. Still you may find it helpful.

    C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\udma_scatter_gather

    You will actually only need to enable the interrupt that comes after the ADC0 gather-scatter sequence is complete because that will take longer. In the interrupt routine you can reset both uDMA channels before the next timer trigger.