cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change Period and Prescaler

pass3master
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

2 REPLIES 2
gbm
Lead II

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

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