Skip to main content
Graduate II
July 5, 2024
Question

PWM sine gen two timers idea

  • July 5, 2024
  • 1 reply
  • 784 views

Hi, req is generate sine wave and manage frequency precisely . My design require range 2Hz to 10Hz with for example step 0,002Hz.

My idea is one PWM timer for sine with same table for exampel 10bit. 

Second linked timer for manage one sample time on PWM and regulate frequency precisely.

How timers on F030 can be linked this way or other idea?

Now my timer PWM is TIM3 and not linked TIM16 manage angle calcs and new CCR on TIM3.

    This topic has been closed for replies.

    1 reply

    ST Employee
    July 9, 2024

    Hello @MM..1

    Your idea is valid, you can use 2 timers, one for generating the PWM signal and another for managing the sample time and frequency, however, TIM16 and TIM3 cannot be linked by configuring the master/slave mode, there are no internal connection between these 2 timers

    check TIMx internal trigger connection in your product RM:

    SarraS_0-1720529155744.png

     

    MM..1Author
    Graduate II
    July 9, 2024

    Thank you Sara, but can you explain or show example how use two timers for example for generate 2.2222Hz and switch it to 2.2242Hz (this is required sine wave freq no PWM)