cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change Period and Prescaler

pass3master
Senior

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 III

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

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