AnsweredAssumed Answered

KV58: How to use eDMA to reload the value registers of FlexPWM?

Question asked by shenjiaqihi@gmail.com on Apr 20, 2019
Latest reply on Apr 25, 2019 by Aldo Gutierrez

IC:MKV58F1M0VLQ24

IAR 8.20.1

 

Hi, 

I want to use DMA to change the duty of PWM every cycle. But I don't know how to set the LDOK in PWMx_MCTRL0.

 

I have tried to use DMA to transfer the VAL2 and VAL3 registers, but the pwm signal didn't change. I have enabled the  DMA write requests in PWMx_SMnDMAEN, and I'm sure DMA has transferred the data to the PWM buffer.

 

The "KV5x Sub-Family Reference Manual" (Document Number: KV5XP144M240RM Rev. 4, 06/2016) wrote in P1359:

MCTRL0[LDOK] can be set in DMA mode when the DMA indicates that it has completed the update of all CTRL[PRSC], INIT,FRACVALx, and VALx registers in the corresponding submodule. Reset clears LDOK field.

 

So even I only want to change the VAL2 and VAL3, I must use DMA transfer all the register (CTRL[PRSC], INIT, FRACVALx, and VALx) to let the LDOK be set automatically? And is there any rules of transmission sequence?

Outcomes