Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 1 of 1

Thread: Teensy 4.0 ADC SYNCH and 4 channels combined with DMA

  1. #1
    Junior Member
    Join Date
    Mar 2020
    Posts
    9

    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:

    Click image for larger version. 

Name:	DMA trigger.jpg 
Views:	22 
Size:	47.1 KB 
ID:	20601

    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/appl...es/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 by Maverick2k; 06-15-2020 at 03:09 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •