cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F446xxx] Synchronise 6 PWM outputs

VGros.3
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
VGros.3
Associate III

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

View solution in original post

2 REPLIES 2

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
Associate III

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