cancel
Showing results for 
Search instead for 
Did you mean: 

STR912 PWM on-the-fly modification of the duty cycle

pvanc9
Associate
Posted on February 01, 2007 at 13:17

STR912 PWM on-the-fly modification of the duty cycle

2 REPLIES 2
pvanc9
Associate
Posted on May 17, 2011 at 09:36

Hello,

Who can cleanly play with PWM,please help me.On my sinewaveform is ugly spike. /only on downward part /

I write directly to pwm register TIM3_OC1R = signal16;

I think I do not want interrupt on pwm.

TIM3_OC1R = 0x000001FC;//ini signal

TIM3_OC2R = 0x00000400;//PWM period

TIM3_CNTR = 0x00000000;//ini count

TIM3_CR2 = 0x00000000;//prescaler 00

TIM3_CR1 = 0x00008150;

Thanks for your help.

mark9
Associate II
Posted on May 17, 2011 at 09:36

See page 133 of the reference manual. It has this footnote:

When Counter = OC2R, then OCF2 bit will be set. This can generate an interrupt if OC2IE is

set. This interrupt will help any application where pulse-width or period needs to be changed

interactively.