stm32f7xx-hal icon indicating copy to clipboard operation
stm32f7xx-hal copied to clipboard

Timer period is off by one

Open jonathanpallant opened this issue 4 years ago • 0 comments

If you create a timer at, say, 250.khz() you will get a timer at very slightly less than that.

When you set the auto-reload register arr, you need to specify the last valid counter before it wraps to zero - i.e. one less than the period in clock cycles.

jonathanpallant avatar May 24 '21 15:05 jonathanpallant