Skip to main content
VGros.3
Associate III
November 8, 2022
Solved

[STM32F446xxx] Synchronise 6 PWM outputs

  • November 8, 2022
  • 2 replies
  • 1756 views

Hello,

I try to synchronise 6 PWM outputs for an BLDC controller.

I use 3 timers :

0693W00000WHjN3QAL.pngMy target is STM32F446RET6 and I'm using STM32CubeIDE.

I read that I add to use master/slave mode. I'm not sure it is the best way, but I configured TIM2 (slave) as follow :

0693W00000WHjXRQA1.pngI chose TIM1 for my master timer :

0693W00000WHjQvQAL.png 

For now, the PWM outputs don't start.

I think I'm missing something. For example I chose ITR1 but I can't find in datasheet where does it come from.

Thanks for your help,

Best regards,

Valentin

This topic has been closed for replies.
Best answer by VGros.3

Thanks JW, it helped me. Now it is working only using CubeMX.

Here is the configuration of the master timer :

0693W00000WHr5GQAT.pngConfiguration of the slave timer :

0693W00000WHr5aQAD.png 

And we have to start both timers :

 HAL_TIM_OC_Start(&htim4, TIM_CHANNEL_1); // master timer

 HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); // slave timer

2 replies

waclawek.jan
Super User
November 8, 2022

0693W00000WHjdeQAD.pngRead the TIM chapter in RM.

If clicking in CubeMX does not bring you success, ditch Cube and write your own program.

JW

VGros.3
VGros.3AuthorBest answer
Associate III
November 9, 2022

Thanks JW, it helped me. Now it is working only using CubeMX.

Here is the configuration of the master timer :

0693W00000WHr5GQAT.pngConfiguration of the slave timer :

0693W00000WHr5aQAD.png 

And we have to start both timers :

 HAL_TIM_OC_Start(&htim4, TIM_CHANNEL_1); // master timer

 HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); // slave timer