Skip to main content
AVoig.1
Associate II
October 31, 2022
Question

How can i generate a master PWM that can vary from 1 to 70% of duty cycle and other 2 PWM with 50% but all with same frequency?

  • October 31, 2022
  • 2 replies
  • 621 views

..

This topic has been closed for replies.

2 replies

S.Ma
Principal
November 1, 2022

Take a timer with at least 3 channels.

How many steps for duty cycle will be the minimum overflow period. Say 100 for 1% increment. Set Timer clock x 100 to be the desired frequency, then set each channel compare to the desired duty cycle and activate the pwm generation.

AVoig.1
AVoig.1Author
Associate II
November 1, 2022

But I want to make a phase shift from the other two PWM that are 50% duty cycle and complementary one with each other. I want to vary the first PWM independent from the other and want to phase shift. I don´t know how to put this in code to change the value of phase shift.