EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

LPC2368: PWM1PR (prescale), PWM does not work if > 2

Started by Sergio Sider December 30, 2007
Hi All,

I am working with a LPC2368 (I suppose from rev.B). I was trying to vary the
PWM frequency changing the prescaler register. (PLL$0MHz, cpu`MHz,
peripheral clock = 60MHz (1:1), PWM set to top = 0x100.

Using the same configuration for the other registers in every run:

PWMPR1=0 ; pwm works , frequency (f)
PWMPR1=1 ; pwm works , frequency = f /2 , ok
PWMPR1=2 ; pwm works, frequency = f /3, ok
PWMPR1=3 and UP... PWM stuck in high (= dead)

Is is a bug?

the preset register was supposed to be 32bit...

Thanks for every idea!
Regards,
Sergio P. Sider
Sidertech

An Engineer's Guide to the LPC2100 Series

On Sun, 30 Dec 2007 19:34:37 -0200, you wrote:

>Hi All,
>
>I am working with a LPC2368 (I suppose from rev.B). I was trying to vary the
>PWM frequency changing the prescaler register. (PLL$0MHz, cpu`MHz,
>peripheral clock = 60MHz (1:1), PWM set to top = 0x100.
>
>Using the same configuration for the other registers in every run:
>
>PWMPR1=0 ; pwm works , frequency (f)
>PWMPR1=1 ; pwm works , frequency = f /2 , ok
>PWMPR1=2 ; pwm works, frequency = f /3, ok
>PWMPR1=3 and UP... PWM stuck in high (= dead)

Did you clear the PWMTC to ensure it starts at a value below the MR - remember a 32 bit counter can
take a loong time to roll over if it starts from some random value....

The 2024 Embedded Online Conference