2024-02-19 04:48 AM
We need to make a master PWM that vary duty cycle from 1 to 35% and have a phase shift with two other pwm (this two other pwm are in phase and duty cycle 50%, but one starts with one and other starts wiht zero.). The phase shift should vary from 1 to 360 degrees. All the pwm have the same frequency and should be possible change the frequency for all. I tryed output compare between 3 pwm, but only works at 50% duty cycle.
2024-02-19 05:39 AM
It's not possible with a single timer. Run three timers, with two of those being slave timers and offset their starts to the master. You can then adjust the PWM of each of them independently. Might want to run the slave timers in one pulse mode and have them start every time the master updates. Will be a little tricky to get this all coded and robust to changes in frequency without glitches on the line.
2024-02-19 06:02 AM
Can you give an example in how to set this registers manually? I have to put TIM1 like master and TIM2 like slave that have two pwm with 50% duty cycle and phase shift 90 degrees between then. The first pwm i can change duty cycle. all of them should have the same frequency when i change frequency.