---- Original Message ----
From: "bobtransformer" <bgudgel@...>
To: <lpc2000@yahoogroups.com>
Sent: Tuesday, January 17, 2006 9:12 PM
Subject: [lpc2000] Re: PWM, change frequency during runtime
> I need to look this up and find out how it works also... With Atmel
> AVR parts at least, the new PWM value is not accepted as the compare
> value until the current PWM cycle completes. i.e. it is a syhcronous
> load which is the way I would expect it to work. Especially since you
> may be altering several different PWM channels at the same time.
>
> I really like that method and ~hope~ that the LPC parts are similar.
When PWM Enable (PWMTCR bit 3) is set, changing the MRx registers takes
effect at the next MR0 match (end of PWM cycle) because of the MRx shadow
registers. When that bit is clear, changing the MRx registers takes effect
immediately, in the middle of the cycle.
There is no such shadow register associated with PWMPR indicated on the PWM
block diagram, so changing PWMPR most likely takes effect immediately, in
the middle of the PWM cycle, regardless of PWM Enable.
Karl Olsen
Show quoted textHide quoted text
> -- In lpc2000@yahoogroups.com, "Joel Winarske" <joelw@i...> wrote:
>>
>>> The Question is:
>>> When i change the PWMPR to another value when the PWM is enabled, at
>>> which state/time is the new PWMPR active ?
>>
>> An educated guess:
>> It should happen on edge of PWMPC increment, which is driven by
>> pclk edge. So next PWMPC increment edge after writing reg.