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

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

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

820 Views
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 Kudos
Reply
3 Replies

703 Views
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 Kudos
Reply

703 Views
mykhayloshcherb
Contributor I

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

0 Kudos
Reply

703 Views
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 Kudos
Reply