Timer PWM and Counter question
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-12-31 7:53 AM
Posted on December 31, 2014 at 16:53
I am using an STM32F407
I want to generate exactly 400 pulses on PE5 or PE6 with a 50% duty cycle.I believe PE5 can be connected to TIM9 CH1, and PE6 can be connected to TIM9 CH2I have the PWM code running and I have located the TIM Base/ counter example.QuestionsDo I need to use an interrupt or can I just load a counter with 400 and let it count down to zero and stop?Can I do this with one timer or do I need two timers?If I need two timers how do I synchronize them so I can get exactly 400 pulses?Thanks and Happy New Year.Barry #tim-counter
Labels:
- Labels:
-
TIM
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-12-31 9:17 AM
Posted on December 31, 2014 at 18:17
Not sure if TIM9 has a ''Repetition Count'', but even so those are only 8-bit wide.
If the frequency isn't too high you should be able to count off 400 updates and turn the pulse(s) off easily enough. With one timer you can output two phase aligned output of the same period, but differing duty, if you want something more complicated than that then you'll need more than one timer.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
