Skip to main content
Associate II
September 18, 2025
Question

Problem in Speed Detection Using Dynamic Prescaler(6step mode+hall sensor)

  • September 18, 2025
  • 0 replies
  • 213 views

Issue 1:

file: hall_speed_pos_fdbk_sixstep.c
function: HALL_TIMx_CC_IRQHandler()
line: 393
The prescaler is affected when UEV is generated by the function SixStep_StepCommutation().
This function is called immediately after the prescaler is set,
so the prescaler value is applied in the current loop, not in the next loop.
Therefore, the prescaler does not need to be incremented by +2;
incrementing by +1 is enough.


Issue 2:

file: stm32g0xx_mc_it.c
function: TIM2_IRQHandler()
line: 148
When the prescaler is changed, it is affected by the update event, which is generated in software during commutation.
If a phase shift is set, the update event is generated with a delay.
As a result, the counter may run with two different prescaler values.