This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to dynamically change ePWM's period?

Other Parts Discussed in Thread: LAUNCHXL-F28069M

I am using the LAUNCHXL-F28069M launch board. I use eCAP to measure sensor signal period(reflect motor's RPM) and want to generate PWM waveform. I need the PWM's period be same as the sensor signal period, and the sensor period gonna change gradually. Now I already have the sensor period, but problem is when I change the PWM period, it seems introduce some noise(?). My implementation is: set ePWM register's PRDLD=immediate. Read eCAP register's ECAP value(represent sensor's period), then calculate ePWM's PRD, then write to ePWM register's PRD. But it does not work as my expectation. 

Does anyone know how to dynamically change ePWM's period? thanks a lot.