Hello Sir:
I used the ePWM module in my current project ; I have already realized the frequence and duty ratio ;
but I want to accurately control the number of send PWM pluses;
Is there any method to realize it?
Thanks!
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.
Hello Sir:
I used the ePWM module in my current project ; I have already realized the frequence and duty ratio ;
but I want to accurately control the number of send PWM pluses;
Is there any method to realize it?
Thanks!
Flyer,
have you solved your issue yet?
If not I suspect that you have a boundary condition error in your loop. If you are missing 10 pulses at 10 kHz that's equivalent to 1mS of delay, so instead delay from 0 to 1000 or 1 to 1001.
Regards,
Cody
Flyer,
the fact that adjusting the frequency does suggest that the problem is in the PWM not in the timer. Try subtracting 1 from your TBPRD value. Remember in the PWM zero counts as a TBPRD tick.
If this doesn't solve your issue, what if your TBCLK in Hertz?
Additionally, if your still having issues, lets begin debugging this as two issues.
Regards,
Cody