Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216260

Forum Post: RE: Is it possible to use same timer module to generate 2 PWM signals with different freq,duty cycle ,number of clk pullse?

$
0
0

[quote user="Sujatha P.M"],But I don't want to produce  two PWM o/p at the same time..[/quote]

Your O/P didn't say that. The way it was worded implied "at the same time".

[quote user="Sujatha P.M"]When I want I should call the function by passing freq, dutycycle and no of cycles . [/quote]

So do just that. You'll most likely need an ISR to handle only producing a fixed number of pulses. Your function should set up the timer, set a variable that the ISR can see with the number of pulses, and then start the timer. When the timer ISR fires, decrement the variable. When it gets to 0, turn the timer off.


Viewing all articles
Browse latest Browse all 216260

Trending Articles