2022-04-07 06: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.
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,
2022-04-07 07: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.
2022-04-07 07: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.
2022-04-07 07: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
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.
2022-04-08 04:21 AM
Write down desired frequency and peruod. What tolerances? Is this period constant?
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,