>Hi all,
> I am having difficulties with initiating the PWM. Here's the code to
enable PWM4 single edge on LPC2104 at 11.0592 Mhz.
>
> PINSEL0 = 0x00020000;
> PWMPR = 0x7FF;
> PWMPCR = 0x00001000;
> PWMMCR = 0x00002000;
> PWMMR0 = 0x00002000;
> PWMMR4 = 0x00001000;
> PWMLER = 0x00000010;
> PWMTCR = 0x00000002;
> PWMTCR = 0x00000009;
>Anything I am missing.
>
>
> Yes, you may have to enable the PWM0 in the PCON register. My code
started to work after I found it was turned off.
Yes, rightly stated, i realized it that time. Anyways thanks. But the PWMLER
value for PWMMR0 needn't be set since to change the PWM cycle I need to
update the PWMMR4 value.
Thanks,
Vineet.
Danish Ali wrote: Oh and PWMLER probably wants to be
0x00000009 once you've set
PWMMR0 and PWMMR4
- Danish
--- In l..., "Danish Ali" wrote:
>
> I think the problem is that you're using MR4 to reset the counter,
> when you should be using MR0 for that.
>
> Try PWMMCR = 0x00000002;
>
> Regards,
> Danish
Oh and PWMLER probably wants to be 0x00000009 once you've set
PWMMR0 and PWMMR4
- Danish
--- In l..., "Danish Ali" wrote: >
> I think the problem is that you're using MR4 to reset the counter,
> when you should be using MR0 for that.
>
> Try PWMMCR = 0x00000002;
>
> Regards,
> Danish
Reply by Danish Ali●June 3, 20062006-06-03
I think the problem is that you're using MR4 to reset the counter,
when you should be using MR0 for that.
Try PWMMCR = 0x00000002;
Regards,
Danish
--- In l..., vineet jain wrote: >
> Hi all,
> I am having difficulties with initiating the PWM. Here's the code to
enable PWM4 single edge on LPC2104 at 11.0592 Mhz. >
> PINSEL0 = 0x00020000;
> PWMPR = 0x7FF;
> PWMPCR = 0x00001000;
> PWMMCR = 0x00002000;
> PWMMR0 = 0x00002000;
> PWMMR4 = 0x00001000;
> PWMLER = 0x00000010;
> PWMTCR = 0x00000002;
> PWMTCR = 0x00000009;
> Anything I am missing.
>
> Thanks in advance,
> Vineet.
> __________________________________________________
>
>
>
>
Reply by vineet jain●June 3, 20062006-06-03
Hi all,
I am having difficulties with initiating the PWM. Here's the code to
enable PWM4 single edge on LPC2104 at 11.0592 Mhz.