2026-01-17 4:27 AM
Attempting to blink an LED using output compare function of a timer, but I've not been able to get signal or toggling to happen on the pin.
I'm using TIM5 channel 3, because I'm planning on using SPI1 eventually (I need to use a clock source separate from SPI1, which is on APB2) and the TIM5 associated alternate function GPIO on PA2 is in a convenient location.
Meter on the pin indicates a floating pin signal (not going high or low), and LED visually indicates same (no dim light or other visual indication of rapid toggling).
The pin itself is fine as normal GPIO: setting same pin as GPIO (not alternate function for TIM5), I'm able to blink "manually" via software. It seems to just be using that pin as TIM5 that causes problems.
Here's the CubeMX setup:
My understanding from the datasheet is that TIM5 is on APB1:
APB1 timer clocks set to 10.5MHz:
...so TIM_CLK/CKD/((PSC + 1)*(ARR + 1))
= 10500000 / 4 / ((43749 + 1) * (59 + 1))
= 1 Hz (should be blinking once per second)
2026-01-17 4:37 AM
...one more detail, the device errata sheet doesn't list anything for this, unless I'm missing something.