2021-11-06 05:31 AM
Hi,
I have a strange problem here, I configure SPI1 as Half duplex master and configure the unused MISO pin to TIM3 PWM Generation CH1.
But as soon as I initialize SPI1 PWM stops working.
I looked up the performance block diagram they're not even on the same APB Bus, but somehow pwm doesn't work. Interrupt still works but pin is always low.
I'm also using TIM2 CH1 as pwm output and it doesn't get effected
I tried alternative pins for both TIM3 CH1(A6 to B4 ) and SPI(A5-7 to B3-5) still nothing changed. curious thing for both peripheral alternative pins are the same (TIM3 CH1 is SPI1 MISO pin in both locations)
What am I missing here?
2021-11-06 06:11 AM
Pins on the STM32F1 are mapped per-function and not per-pin. For shared pins, you can only have one peripheral enabled at a time.
According to the datasheet:
That said, CubeMX does allow you to do this configuration (SPI1 + TIM3), so maybe there's something there. Or maybe it's a CubeMX bug.
2021-11-09 01:05 AM
I'll try to replace the pins with their alternatives across to each other with a new project and share the results