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.
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
Sorry but I did not find where do you change multiple CnV values by one DMA channel. Can you explain?
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