Teensy 4.0 ADC SYNCH and 4 channels combined with DMA

Dear all,

I am trying to construct the following ADC triggering Synchronously by a Quadtimer and use DMA to transfer the data to a buffer:

DMA trigger.jpg

Whereby I use the QUAD timer to trigger the ADC, this is working with the example in the ADC_Module.cpp, first tried with one ADC and one pin. Lateron moved to two ADCs with sync mode and now trying to add DMA to the mix.

Before I used AnalogBufferDMA with for each ADC a double buffer and a DMA channel. However the DMA sources are set to ADC1_R0 and ADC2_R0 and the corresponding trigger for the DMA are at DMAMUX_SOURCE_ADC1 and DMAMUX_SOURCE_ADC2.

I assume that for the new configuration where ADC_ETC is added to the mix the trigger for the DMA needs to be set to DMAMUX_SOURCE_ADC_ETC. However this is a single trigger and not per ADC. How to cope with multiple DMA transfers from:

  • ETC_TRIG Result Data 1/0 Register (TRIG0_RESULT_1_0) 4 bytes transfer (Offset 28h from ADC_ETC base address: 403B_0000h)
  • ETC_TRIG Result Data 1/0 Register (TRIG4_RESULT_1_0) 4 bytes transfer (Offset C8h from ADC_ETC base address: 403B_0000h)

I read the references
Application note: https://www.nxp.com/docs/en/nxp/application-notes/AN12200.pdf
Forum Post: https://community.nxp.com/thread/482078

But not sure what the correct way is to start these DMA transactions, I would preferable start them without using an interrupt like done0 since the goals to offload the CPU as much as possible.

Curious if anybody has some thoughts on the above.

Thanks
 
Last edited:
Back
Top