AnsweredAssumed Answered

SPC56EL - using FlexPWM DMA functionality

Question asked by Patrik Schantl on May 13, 2015
Latest reply on Sep 30, 2015 by d'angelo.giuseppe

Hello,

I would like to reload PWM duty cycle every 10 PWM periods using DMA functionality. Therefore I configured FlexPWM subodule 0 and DMA channel 10. An array stores 8 different values for VAL3 register which equal duty cycles from 10%...80%.
My DMA channel step looks like that:

DMAMUX.

CHCONFIG[10].R = DMA_CHANNEL_ENABLED | DMA_CHANNEL_NTRIGGERED | 12;

 

edmaChannelSetup(10,&dcPWM[0],&mcPWM_A.SUBMOD[0].VAL_3.R,2,0,1,1,2,8,-16,0,0);

 

Now VAL_3 register is written by DMA, but always with the last table element. If I reduce the DMA iterations to 4, then VAL_3 always gets the value of 4th element from my table. I already used DMA for reloading eTimer compare values and had no problems with writing one element from a table to compare registers with each compare event.
Is there no way to use the next element from table with every reload event?

Additionally, I am not quite sure if I understand the reload feature with DMA. The DMAEN register include the VALDE bit. In the reference manual, the description says "This read/write bit enables DMA write requests for the VALx register when RF is set". Does it mean that I get one request per VAL register (means totally six) or should the request be used to write all VAL registers with one DMA channel?

Best regards,
Patrik

Outcomes