cancel
Showing results for 
Search instead for 
Did you mean: 

PWM configuration

samsam0510
Associate

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?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> 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:

TDK_1-1723742230995.png

There is no configuration of TIM3_REMAP which allows PB4 and PC7 to be used at the same time.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

> 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:

TDK_1-1723742230995.png

There is no configuration of TIM3_REMAP which allows PB4 and PC7 to be used at the same time.

If you feel a post has answered your question, please click "Accept as Solution".