cancel
Showing results for 
Search instead for 
Did you mean: 

PWM sine gen two timers idea

MM..1
Chief III

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.

2 REPLIES 2
Sarra.S
ST Employee

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

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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)