Skip to main content
Graham1904
Associate III
June 24, 2020
Question

STM32L476 running a PWM from TIM1 at 80MHz with a prescaler of 32 and a reload of 1000 reveals a PWM of 25KHz and not 2.5KHz as calculated. Why is this? My bad maths :)

  • June 24, 2020
  • 1 reply
  • 649 views

..

This topic has been closed for replies.

1 reply

Graham1904
Associate III
June 24, 2020

I think I have found the answer. The initial MX_TIM1_Init() the htim1.Init.Period was set to 1000 but in the code after the MX_TIM1_Init() I set htim1.Instance->ARR = 100 :) It seems that the ARR isn't updated in STM32CubeIDE when you change the IOC file :)