2024-09-16 08:10 AM
Looking for a recommendation for generating a discrete number of pulses from PWM, for the example below i setup timer 1 to generate PWM and timer 2 with input capture interrupt to count the pulses, I did this with both rising and falling edge and both resulted with slight errors. I attempted to create a 3-pulse burst, but as can be seen it doesn't quite work. Any suggestions on how I can implement this better?
After 3 pulses on the interrupt, I stop PWM on channel 1.
Rising Edge mode Tim2 interrupt mode, 3 full pulses generated plus a 4th partial.
Rising Edge mode Tim2 interrupt mode, only 2 full pulses generated.
Solved! Go to Solution.
2024-09-16 08:19 AM
Hello,
Look at these thread as they may help:
2024-09-16 08:19 AM
Hello,
Look at these thread as they may help:
2024-09-16 09:59 AM
With TIM1 and 3 pulses, the best option is to use the Repetition counter (TIMx_RCR). Read its description in the TIM chapter in Reference Manual (RM).
JW
2024-09-16 05:16 PM
I will look into this than you.
2024-09-16 05:17 PM
Thank you, the first link had a sample program that worked for me.