2024-08-15 10:03 AM
Hi, I'm a newbie in this embedded board and I'm having a hard time setting up the PWM pins.
I'm currently using an STM32F103RB with a bldc motor driver shield that has pin 5, 6, 9 for PWM input.
The corresponding pins for them are PB4, PB10, PC7 so I tried to activate pwm for those.
However, PB4(TIM3_CH1) and PC7(TIM3_CH2) couldn't be configured at the same time and when I tried to set PC7 after setting PB4 to TIM3_CH1, PB4 automatically switches to some other pin that can be compatible with PC7.
Why does this happen even if they use the same timer but have different channels?
Solved! Go to Solution.
2024-08-15 10:18 AM - edited 2024-08-15 10:18 AM
> Why does this happen even if they use the same timer but have different channels?
The STM32F1 series, which is nearly 20 years old now, handles pin assignments differently than newer families. They are done on a per-peripheral basis rather than a per-pin basis.
Per the reference manual, here are the possible pin options for TIM3:
There is no configuration of TIM3_REMAP which allows PB4 and PC7 to be used at the same time.
2024-08-15 10:18 AM - edited 2024-08-15 10:18 AM
> Why does this happen even if they use the same timer but have different channels?
The STM32F1 series, which is nearly 20 years old now, handles pin assignments differently than newer families. They are done on a per-peripheral basis rather than a per-pin basis.
Per the reference manual, here are the possible pin options for TIM3:
There is no configuration of TIM3_REMAP which allows PB4 and PC7 to be used at the same time.