Skip to main content
pvanc9
Associate
February 1, 2007
Question

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

  • February 1, 2007
  • 2 replies
  • 683 views
Posted on February 01, 2007 at 13:17

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

This topic has been closed for replies.

2 replies

pvanc9
pvanc9Author
Associate
May 17, 2011
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 III
May 17, 2011
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.