stm32f7xx-hal
stm32f7xx-hal copied to clipboard
Timer period is off by one
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.