2023-09-14 01:12 AM
Once I posted the issue about 2 PWM outputs synchronize.
https://community.st.com/t5/stm32-mcus-products/2-pwm-outputs-is-this-possible/td-p/587654
Now every 1st time after power on (or CPU reset if connected with IDE/Programmer) it works exactlly synchronized, but after 2nd start or afterward slave output timing is randomly skewed with master output.
What's wrong here?
-TIM2 = master .. trigger on counter overflow
-TIM3 = slave
-codes
I wonder that once timer start synchronous why timing is skewed only by PWM start or stop??
I cannot find difference in dumped registers.. configuration, 1st start, and 2nd start. ...see attached.
I'm glad to hear someone can advise.
kindly regards
Solved! Go to Solution.
2023-09-19 12:02 AM
hello @waclawek.jan
thank you for your advise, and now it was solved.
I used HAL_TIM_PWM_Stop() before, but it reset CR1.CEN I found.
then I modify it not to reset CR1.CEN as followings, and works as well expected.
regards.
2023-09-14 01:22 AM
2023-09-14 04:34 PM
hello @Issamos
thanks you for informing, but no hint about my problem is there.
1st time to start synchronizing PWM output is completely works, no doubt.
but problem is after stop PWM output and then restart it.
now I'm trying some TIM initialization made before restart, but still not work as expected.
regards.
2023-09-14 06:58 PM
represent the problem by diagram. see attached 'diagram1.png'.
>>now I'm trying some TIM initialization made before restart, but still not work as expected.
following is one of my trial.
I wonder that the answer is close here but not found now..
-call "generate event" before PWM start
--> result
regards.
2023-09-14 11:45 PM
I don't know what are you trying to do, but generally, if the slave has slave-mode controller set in Trigger mode, it does nothing more than set TIMx_CR1.CEN when first trigger arrives. In other words, if you set TIMx_CR1.CEN) in software, there's no effect from the trigger.
JW
2023-09-19 12:02 AM
hello @waclawek.jan
thank you for your advise, and now it was solved.
I used HAL_TIM_PWM_Stop() before, but it reset CR1.CEN I found.
then I modify it not to reset CR1.CEN as followings, and works as well expected.
regards.