Skip to main content
Explorer
February 12, 2024
Solved

Dynamically change Period and Prescaler

  • February 12, 2024
  • 1 reply
  • 1967 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.

    1 reply

    Graduate
    February 12, 2024

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

    pass3masterAuthorAnswer
    Explorer
    February 20, 2024

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