cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8T6 SP1 and TIM3 PWM doesn't work together

e-zeki
Associate III

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?

2 REPLIES 2
TDK
Guru

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:

0693W00000GWfmiQAD.png 

0693W00000GWfmsQAD.png 

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.

If you feel a post has answered your question, please click "Accept as Solution".
e-zeki
Associate III

I'll try to replace the pins with their alternatives across to each other with a new project and share the results