DMA CITER register modification on-fly

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

DMA CITER register modification on-fly

跳至解决方案
1,293 次查看
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 项奖励
回复
1 解答
1,130 次查看
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 项奖励
回复
2 回复数
1,131 次查看
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 项奖励
回复
1,130 次查看
davidzhou
Contributor V

Jeremy,

Thank you for your answer.

David

0 项奖励
回复