Skip to main content
Deepak Tajanpure
Associate
December 24, 2021
Question

How to synchronise 2 PWM in STM8S003F3?

  • December 24, 2021
  • 2 replies
  • 2170 views

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.

    This topic has been closed for replies.

    2 replies

    Cristian Gyorgy
    Associate II
    December 30, 2021

    Hi!

    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
    December 31, 2021

    synchronized means rising edge of both PWMs should match

    Thomas G
    Associate II
    May 28, 2022

    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.