cancel
Showing results for 
Search instead for 
Did you mean: 

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 third.

AVoig.1
Associate II
 
1 ACCEPTED SOLUTION

Accepted Solutions

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4
AScha.3
Chief III

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".

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

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

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