Skip to main content
Associate III
February 12, 2024
Solved

Dynamically change Period and Prescaler

  • February 12, 2024
  • 2 replies
  • 1994 views

We are using interrupt of timer function.
Currently, Period and Prescaler are set in the initial settings (MX_TIM6_Init), but what should I do if I want to dynamically change Period and Prescaler?

 

[IDE]STM32CubeIDE 1.14.0

[board]​ STM32F412 Discovery kit

This topic has been closed for replies.
Best answer by pass3master

Thank you for your response.
Close because your perfect answer helped me to solve the problem.

2 replies

gbm
Super User
February 12, 2024

Just write new values to PSC and ARR register. Make sure that ARR preload option is turned on.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
pass3masterAuthorBest answer
Associate III
February 20, 2024

Thank you for your response.
Close because your perfect answer helped me to solve the problem.