cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4* Low Frequency HRTimer

BNG
Associate

Hello ST,

in my recent design I faced trivial task of synchronizing several outputs based on common timers and external events. I picked STM32G474 for this task as I found HRTimer perfect due to its architecture. What I didn't foresee is the fact that It's not possible to reduce APB2 frequency for this timer below 100MHz which in conjunction with HRTIM div4 allows going down only to 25MHz which results in maximum period of ~2.6ms (timer is only 16 bit). For my application I need at least 10ms. I understand this is limited due to High Resolution feature which I don't need in this case so I keep it disabled.

 

What I'm currently forced to do is to generate the code and then manually modify APB2 prescaler from div2 to div16. Hardware seems to be working perfectly fine in this configuration (at least we didn't notice any strange behaviour) however cube is "not aware" of my change so all other timebases are not properly recalculated and I'm forced to do the modification after every code regeneration.

Could you please enable reducing mentioned frequency within GUI for this timer in cases where High Resolution feature is not used?

Thank you and kind regards,

Bartosz

1 REPLY 1

Hello, 

I understand your need to go down till 100Hz, but the lowest frequency allowed by the STM32CubeMx configuration is 384Hz for Hrtim. Allowing such low frequency is not a common use case with STM32CubeMx, so I'm not sure that such modification will be included soon (yet I will mention it to STM32CubeMx product owners).

Have you tried to use SW programming to "skip" periods and lower artificially the frequency? using the repetition feature for instance? enable SET/RESET each 4 periods (in update event/period ISR)?

 

Best regrards.