2023-03-20 11:49 PM
the below code is not working for me
//HAL_TIM_PWM_Start(&htim15,TIM_CHANNEL_1);
HAL_TIMEx_PWMN_Start(&htim15,TIM_CHANNEL_1);
Solved! Go to Solution.
2023-03-22 12:54 AM
CH1N is controlled by the same channel as CH1, except that CH1N is inverted (we will leave out details such as the dead time required for half bridges for this consideration). If you want to control two DC motors separately, you also need two separate PWM channels, consequently 9 PWM channels for 9 DC motors.
Since we don't know yet which STM32 you want to use, we can't give a hint yet.
Regards
/Peter
2023-03-21 03:06 AM
Hello @Davi ,
You can use this code, it works fine:
HAL_TIM_PWM_Start(&htim15, TIM_CHANNEL_1);
HAL_TIMEx_PWMN_Start(&htim15, TIM_CHANNEL_1);
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-03-21 03:18 AM
2023-03-21 03:59 AM
I think you should set PWM on CH1 and CH2N :
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_2);
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-03-21 06:42 PM
The problem is I have 9 DC motor, all motors are need pwm,
so I want to use CH1 and CH1N seperatly to control 2 motor
can I do this?
2023-03-22 12:54 AM
CH1N is controlled by the same channel as CH1, except that CH1N is inverted (we will leave out details such as the dead time required for half bridges for this consideration). If you want to control two DC motors separately, you also need two separate PWM channels, consequently 9 PWM channels for 9 DC motors.
Since we don't know yet which STM32 you want to use, we can't give a hint yet.
Regards
/Peter
2023-03-22 11:06 PM
Thank you, STM32G070RB
2023-03-22 11:52 PM
With the STM32G070RB you are able to control up to 10 PWM channels:
Think that's enough for your 9 motors?
Regards
/Peter
2023-03-22 11:56 PM
yes, thank you very much
2023-03-23 12:46 AM
You're welcome!
When your question is answered, please mark this topic as answered by choosing Select as Best for the preferred answer, as also explained here. This will help other users find that answer faster.
Good luck!
/Peter