Skip to main content
msche.1
Associate III
February 17, 2022
Question

Why is my STM32 TIM16 interrupt speed not changing when I change the APB2DIV?

  • February 17, 2022
  • 1 reply
  • 1339 views

I'm building an elf file, SCPing it to the controller and using the fw_cortex_m4.sh to load it on the m4, but no matter what I set the APB2DIV scaler to the number of times per second TIM16 is called doesn't change.

The only thing that does seem to affect the frequency is the prescaler on the TIM16 pin, but I've already got it set to 0 and I only get about 1.4kH.

This topic has been closed for replies.

1 reply

KnarfB
Super User
February 17, 2022

APB2DIV is part of RCC and can influence more than just TIM16. The system is probavbly not configured to let the M4 do that.

hth

KnarfB

msche.1
msche.1Author
Associate III
February 17, 2022

Thanks for your answer, the problem turned out to be that I was counting the amount of times the ADC callback was hit not the timer counting.