How to initialize a DMA channel for a circular buffer?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to initialize a DMA channel for a circular buffer?

Jump to solution
778 Views
dieterfalk
Contributor II

I want to initialize a DMA channel to transfer input capture values (e.g. FTM2_CH0) to a circular destination buffer using the modulo feature. This DMA should run continuously. The buffer will be checked periodically (reading the DADDR register value to determine the current write pointer.

I am not clear about the initialization of the DOFF register and minor-/major loop operation register if I want to use the continuous running DMA with the modulo feature. Can you help me with an example code? Thank you.

Labels (2)
0 Kudos
1 Solution
167 Views
dieterfalk
Contributor II

Hello,

thanks for these examples. They mainly show the general use of DMA in different examples. The modulo feature is not used.

In any case I think these example will help me to find a solution for my problem. Therefore I will close this task.

Dieter

View solution in original post

0 Kudos
7 Replies
167 Views
rendy
NXP Employee
NXP Employee

Hi,

please try attached example code which should demonstrate using of DMA. Let me know in case of any problems. Project are created with IAR version 7.10, will not work withe lesser version. You can download 30 day trial here: http://supp.iar.com/Download/SW/?item=EWARM-EVAL

Rene

168 Views
dieterfalk
Contributor II

Hello,

thanks for these examples. They mainly show the general use of DMA in different examples. The modulo feature is not used.

In any case I think these example will help me to find a solution for my problem. Therefore I will close this task.

Dieter

View solution in original post

0 Kudos
167 Views
timesyssupport
Senior Contributor II

Hello Dieter,

Are you looking to do this in MQX or Linux? Let me know, and I will see if there is any similar code available.

Thanks,

Timesys Support

0 Kudos
167 Views
dieterfalk
Contributor II

Hello,

the code should be independent on any OS.

Dieter

0 Kudos
167 Views
timesyssupport
Senior Contributor II

Hello Dieter,

I have reviewed all Linux driver source for the Vybrid Tower that uses eDMA (serial, dspi, asrc, sound), but unfortunately, none of these use the eDMA modulo feature.  karinavalencia, does the Freescale team have any input about how the DMAx_TCDn_DOFF, DMAx_TCDn_NBYTES*, DMAx_TCDn_BITER*, and DMAx_TCDn_CITER* registers should be configured when using the modulo feature of eDMA (bits 3-7 of DMAx_TCDn_ATTR set)? Dieter, feel free to clarify if this is not what you are looking for.

Thanks,

Timesys Support

167 Views
karina_valencia
NXP Apps Support
NXP Apps Support

rendy can you review  previous update  from Timesys and share your comments?

0 Kudos
167 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you help with this case?

0 Kudos