Showing results for 
Search instead for 
Did you mean: 

How to synchronise 2 PWM in STM8S003F3?

Deepak Tajanpure
Associate II

I need 2 PWM signals each with different frequency and duty cycle. So I'm using TIM1 and TIM2 for this. But these PWMs are not synchronised. Please help me on this.

Cristian Gyorgy
Senior III


I don't really understand what you mean with "synchronized". If you say the 2 PWMs have different frequency how do you want them to be synchronized?

Deepak Tajanpure
Associate II

synchronized means rising edge of both PWMs should match

You're assuming a lot 🙂

I would recommend that you carefully study how the timers work (i.e., from the STM8S003F3 datasheet and the RM0016 manual), how they receive a clock, and clearly know your expectations regarding any latency between edges. Then make experiments.