Skip to main content
AVoig.1
Associate II
November 1, 2022
Solved

How to make a PWM master that vary from 1 to 90%, steps of 1. The second PWM is 50% duty cycle and must have the same frequency of PWM master and the third is complementary and same as second. PWM master have to phase shift relation to second and thi

  • November 1, 2022
  • 2 replies
  • 1808 views

..

Best answer by Tesla DeLorean

One TIM

Use PWM Mode 1 on CCR1, Sweep the CCR1 for CH1 to change the duty

Use PWM Mode 1 on CCR2 = (ARR+1)/2 for 50/50

Use PWM Mode 2 on CCR3 = (ARR+1)/2 for 50/50 anti-phase

TIMx->CCR1 = ((TIMx->ARR + 1) * percent) / 100;

2 replies

AScha.3
Super User
November 1, 2022

if you looking for personal to work for you, what you wanna pay for working for you ?

"If you feel a post has answered your question, please click ""Accept as Solution""."
AVoig.1
AVoig.1Author
Associate II
February 19, 2024

Thank you! Some day you will need help and you say the same message that you sended to me. Thank you for nothing!

Tesla DeLorean
Guru
November 2, 2022

One TIM

Use PWM Mode 1 on CCR1, Sweep the CCR1 for CH1 to change the duty

Use PWM Mode 1 on CCR2 = (ARR+1)/2 for 50/50

Use PWM Mode 2 on CCR3 = (ARR+1)/2 for 50/50 anti-phase

TIMx->CCR1 = ((TIMx->ARR + 1) * percent) / 100;

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
AVoig.1
AVoig.1Author
Associate II
February 21, 2024

I will try again, can i share my code with you after i try?