cancel
Showing results for 
Search instead for 
Did you mean: 

PWM with different types of pulses

sajeed
Associate II
Posted on January 16, 2013 at 08:43

Hello

I am new to the PWM programming , I need to generate pulses of different types in a particular pattern say 80--50--20 % duty cycle consecutively at different frequencies. I am using STM32F05XXX board. Any inputs in this regard could be of great help.

#pwm #pwm #pwm
5 REPLIES 5
Andrew Neil
Evangelist
Posted on January 16, 2013 at 08:52

''pulses of different types''

 

Please explain what you mean by that?

What, exactly, do you mean by the ''type'' of pulse?

sajeed
Associate II
Posted on January 16, 2013 at 10:09

Hi Neil

I mean pulses with varying duty cycle, usually we get the pulses with a fixed duty cycle but i need to vary the duty cycle for every pulse. The pulse should be somewhat like shown in the attached file.

Thanks and Regards

Sajeed

________________

Attachments :

Pulses.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzkQ&d=%2Fa%2F0X0000000bQs%2FJet8LsIFcH99K.zjo8mPYWE.lwsNteZP_wCdU7LO7hM&asPdf=false
frankmeyer9
Associate II
Posted on January 16, 2013 at 13:15

I suggest to retrieve the STM32F0 discovery firmware, and have a look at the example in:

...\STM32F0-Discovery_FW_V1.0.0\Project\Peripheral_Examples\TIM_PWM_Output

Posted on January 16, 2013 at 14:07

You should be able to change the CCRx registers (aka TIM_Pulse) at the Update interrupt to modulate the width. On the F1 it was also possible to use DMA to load TIM registers at the update, but requires you to pick appropriate resources.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sajeed
Associate II
Posted on January 18, 2013 at 06:01

Hi Clive

Thanks for your valuable suggestion , it worked for me.

Thanks again

Sajeed