cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use a timer to send a on-time-pulse PWM at a frequency of less than 1Hz?

LMorr.3
Senior II

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!

1 ACCEPTED SOLUTION

Accepted Solutions
LMorr.3
Senior II

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,

View solution in original post

6 REPLIES 6

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
LMorr.3
Senior II

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.

> 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

TDK
Guru

> 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.

If you feel a post has answered your question, please click "Accept as Solution".
S.Ma
Principal

Write down desired frequency and peruod. What tolerances? Is this period constant?

LMorr.3
Senior II

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,