Is it possible to use a timer to send a on-time-pulse PWM at a frequency of less than 1Hz?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-07 6:58 AM
For example, sending a 1.5second on-time pulse? It would also be helpful to be able to set a delay before the pulse starts as well as the 'repetition' of the pulse. The TIMER1 does have the required features but not sure how to scale down the frequency to under 1Hz. Should I chain timers as master/slave to obtain the low frequency?
Thanks!
Solved! Go to Solution.
- Labels:
-
STM32F4 Series
-
TIM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-09 10:45 AM
Solved! Thanks to your helpful answers, I was able to use TIM1 with the appropriate prescalers to get the pin output I required.
Thanks again,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-07 7:03 AM
Typically TIM1 and TIM8 have a repetition could for sending pulse trains, via PWM / One-Shot
TIM2 and TIM5 are typically 32-bit, depends on what unspecified STM32 part you're using.
Long delays one might consider using SysTick, depends on criticality of the placement.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-07 7:16 AM
Thanks. I'm currently using STM32F407 but could use any part that will do the job. I was thinking of using freeRTOS's software timers but the 'ticks' are 1ms which may not provide high enough frequency, or just barely. I was hoping I could do the pulse using one-time-pulse with repetition and delay features of TIMER1 which supports the repeat count.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-07 7:37 AM
> Should I chain timers as master/slave to obtain the low frequency?
If one timer can't provide the required period using its PSC and ARR, then yes, why not.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-07 12:07 PM
> The TIMER1 does have the required features but not sure how to scale down the frequency to under 1Hz.
Why can't you do this with TIM1?
timer clock of 168MHz
clock divider of /4
prescaler of 65535
period of 65535
--> timer update frequency 168MHz/4/65536/65536 = 0.00978 Hz.
Should be plenty slow enough for your needs, no?
Could set the delay before the pulse by adjusting CCRx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-08 4:21 AM
Write down desired frequency and peruod. What tolerances? Is this period constant?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-09 10:45 AM
Solved! Thanks to your helpful answers, I was able to use TIM1 with the appropriate prescalers to get the pin output I required.
Thanks again,
