Using one DMA channel for sending values to several CnV regitsters of one FTM on K28

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using one DMA channel for sending values to several CnV regitsters of one FTM on K28

579件の閲覧回数
mykhayloshcherb
Contributor I

I want to use PIT to trigger DMA that will put next PWM (CnV) value to different sequential channels of FTM3 at K28 CPU. I'v tried to use destination offset = 8 in minor cycle but it did not work.

0 件の賞賛
3 返答(返信)

462件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Mykhaylo,

I think you have to use nimor loop to write multiple CnV registers, and the end of minor loop, you can trigger another link DMA channels to write the FTM_PWMLoad register.

I attach an example, which use FTM0 channel4 or CH4F flag to trigger DMA based on K40, hope it can help you.

BR

Xiangjun Rong

0 件の賞賛

462件の閲覧回数
mykhayloshcherb
Contributor I

Sorry but I did not find where do you change multiple CnV values by one DMA channel. Can you explain?

0 件の賞賛

462件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Mykhaylo,

Unfortunately, the code only demos how to use channel link to write the FTM_PWMLoad register, if you want to have DMA write write for example six FTM_CnV registers, you have to change the code.

1)you have to set the EMLM bit in DMA_CR.

2)set the DMLOE bit, MLOFF, NBYTES bits

DMA_TCDn_NBYTES_MLOFFYES=0x00;

DMA_TCDn_NBYTES_MLOFFYES|=(1<<30)|((C2V-C1V)<<10) | (6*4);

it is okay

Hope it can help you

BR

Xiangjun nRong

0 件の賞賛