Recommendation for stopping PWM signal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
STM32G4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-16 08:19 AM
Hello,
Look at these thread as they may help:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-16 08:19 AM
Hello,
Look at these thread as they may help:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-16 05:16 PM
I will look into this than you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-16 05:17 PM
Thank you, the first link had a sample program that worked for me.