DMA CITER register modification on-fly

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

DMA CITER register modification on-fly

Jump to solution
630 Views
davidzhou
Contributor V

Hi,

I have K60 and have written a DMA channel with dummy source / destination addresses. I need to modify the

DMA_TCD0_CITER_ELINKNO = DMA_CITER_ELINKNO_CITER_MASK;

  CITER register value (reset to 0x7FFF), after certain numbfer of major loops. My question:

Is it thread-safe to modify the CITER register in another timer interrupt ISR?

Or have to stop the DMA operation and modify the register?

Thank you

David Zhou

0 Kudos
1 Solution
467 Views
jeremyzhou
NXP Employee
NXP Employee

Hi David,

Please following the steps to modify the TCD register.

-disable the dma channel by clearing DMA Request Enable bit

-wait for DMA_TCDn.active = 0

-change the TCD to the initial configuration (to start from beginning)

-enable the dma channel by setting DMA Request Enable bit

Now once the dma channel is started again, it again loads TCDn to eDMA registers

and executes the minor loop according to the values in TCDn.

Hope it helps.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
468 Views
jeremyzhou
NXP Employee
NXP Employee

Hi David,

Please following the steps to modify the TCD register.

-disable the dma channel by clearing DMA Request Enable bit

-wait for DMA_TCDn.active = 0

-change the TCD to the initial configuration (to start from beginning)

-enable the dma channel by setting DMA Request Enable bit

Now once the dma channel is started again, it again loads TCDn to eDMA registers

and executes the minor loop according to the values in TCDn.

Hope it helps.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
467 Views
davidzhou
Contributor V

Jeremy,

Thank you for your answer.

David

0 Kudos