Using ADC_ETC with EDMA, automatic transfer start?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using ADC_ETC with EDMA, automatic transfer start?

441 Views
jackking
Senior Contributor I

I am looking at using ADC_ETC and DMA together on iMXRT1062.  I see the SDK sample project (adc_etc_edma) which does transfer the ADC results using DMA successfully.

But, I also see that there is a call to EDMA_StartTransfer(&edmaHandle) after the EDMA callback sets a flag.  According to the i.MX RT1060 Reference Manual Rev. 2 (page 3375), this should not be necessary, as the ADC_ETC completion should trigger a new DMA transfer directly.  The ADC_ETC trigger chain is being triggered by the PIT, so this should allow the ADC_ETC->DMA transfer to run completely through DMA repeatedly.

I tried removing the StartTransfer call from the example, but the ADC_ETC does not seem to trigger a new DMA transfer.  Is there some other setting that is required for the ADC_ETC to initiate a new DMA transfer?

thanks


0 Kudos
Reply
6 Replies

303 Views
mayliu1
NXP Employee
NXP Employee

Hi @jackking ,

 

Thanks for your patience.

I got the answer from the SDK expert in charge of the ADC module:

TCD0_CSR[DREQ] is set to 1 in the EDMA driver. The request is disabled after each major loop ends, so it needs to be re-enabled.

mayliu1_0-1739848447088.png

mayliu1_1-1739848459215.png

Wish it helps you.
If you still have question about it, please kindly let me know.

BR

MayLiu

0 Kudos
Reply

414 Views
mayliu1
NXP Employee
NXP Employee

Hi @jackking ,

Thank you so much for your interest in our products and for using our community.

I checked the i.MX RT1060 Reference Manual Rev. 3 page3451,  it seems different from the version 2.

https://www.nxp.com/webapp/Download?colCode=IMXRT1060RM

mayliu1_0-1739499054124.png

I can not see all your code in the post. But I think you can check that  whether the  register DMA_CTRL[TIRGa_ENABLE]set to 1  when complete the the last trigger in chain in your project.

 

Wish it helps you.
If you still have question about it, please kindly let me know.

 

BR

MayLiu

0 Kudos
Reply

411 Views
jackking
Senior Contributor I

I think you are looking at an old SDK version… 

IMG_0993.jpeg

 

This version of the SDK does have an example for adc_etc_edma.  The sample does enable DMA triggering for the ADC_ETC, using ADC_ETC_EnableDMA()

 

 

0 Kudos
Reply

385 Views
mayliu1
NXP Employee
NXP Employee

Hi @jackking ,

 

Thanks for your updated information.

Yes,  I can import adc_etc_edma demo after update my SDK version 24.12.00.

Regarding your issue, I have consulted SDK expert in charge of the ADC module, he will explain that, Please keep patience.

Best Regards

MayLiu

0 Kudos
Reply

422 Views
jackking
Senior Contributor I

And the Reference Manual entry which suggests this should not be necessary:
SCR-20250213-hdfu.png

0 Kudos
Reply

422 Views
jackking
Senior Contributor I

This is the line in the SDK example I am referring to:

SCR-20250213-hcdg.png

0 Kudos
Reply