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?
Hello,
LDOK isn't set automatically, what it means is that after successfully writing to the register you wish to change, then you can use a DMA transfer to set the LDOK bit so the changes takes effect, I don't quite understand your second question, could you tell me what do you mean by transmission sequence, is it the DMA writing to the registers (i.e. VALx)?
Hope this helps,
Regards,
Aldo.
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------