Input capture using DMA

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

Input capture using DMA

1,030 Views
kenrenjen
Contributor III

Hello

I really have have a lack of understanding how to setup and use DMA for input capturing. How do define the registers to be written to and how do I get the values?

First of all, my problem is that I am trying to capture input signals on an IR and i figured out that i needed something to capture high frequency signals. (>450kHz) becouse of the overhead and becouse that very little code also takes too much time in the ISR.

I tryed with dual edge capture also, and by that I get very precise values, but it skips the time between the periods, becouse each channel caputere every second rising edge. Anyway. If you have any inputs or can help me out setting up DMA for input capture I will appreciate it.

I really miss some good examples on how to setup the diffrent times. I am working with a K60 using uTasker. Thanks in advance.

0 Kudos
5 Replies

583 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi Keneth,

Unfortunately I lack of an example exactly like the one you requested. But the attached project may be helpful.


It uses the ADC0 but performs change of channels using the DMA and transfer from the result to a buffer.

The project sets the FTM to trigger a DMA channel. The transfer from a 3 element buffer where the channels to measure are store.

The ADC is configures as SW trigger.  The results are transferred from the ADC0_RA to a 2 dimension array buffer. This array is configured to save the results for each channel and index.

The project needs to be opened using the KINETIS_120MHZ_SC examples as workspace I used this examples as reference.

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=K70_120&webpageId=132640893777571792D...

As you can see, the FTM triggers the DMA, you only need to reconfigure the FTM as input capture and add more DMA channels and maybe copy the FTMx_CnV value to other location via the DMA.

I hope this helps.

Alejandro

0 Kudos

583 Views
kenrenjen
Contributor III

Hi

Thanks for your reply.. I can't open the file you attached, can you try again?

Thanks.

0 Kudos

583 Views
Monica
Senior Contributor III

Hello Jensen,

were you ever able to download the content? Sorry for the delay on the follow up.

Best,

Monica.

0 Kudos

583 Views
kenrenjen
Contributor III

Hi Monica..

No I'm still not able to open the file.

Kenneth

0 Kudos

583 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi Kenneth,

Sorry for the delay.

Can you try with this file?

You may have to unzip it twice.

Best Regards,

Alejandro

0 Kudos