PWM VS TIMERS

Started by "joris.mushrooms" July 28, 2009
Hello everybody,

I'm quite a newbie in ARM programming (even if i met this in the past) and i have a question about PWM implementations.

I'm planning to use a lpc2460 and especially PWMs and timers. Are the 2 fonctions linked? can i use all PWM channels and still have my timers free?
i've read the manual again again and still, i dont find the answer.

also, does anyone got a sample program for pwm and/or timer use? I could train myself and base my program on it.

thanks in advance !

ps:if its not clear enough, i can explain more.

joris

An Engineer's Guide to the LPC2100 Series

At least for LPC214x / LPC213x the counters used in PWM are
independent from timers.

In the other hand...the timers are shared for the capture/compare ports.

2009/7/28 joris.mushrooms :
> Hello everybody,
>
> I'm quite a newbie in ARM programming (even if i met this in the past) and
> i have a question about PWM implementations.
>
> I'm planning to use a lpc2460 and especially PWMs and timers. Are the 2
> fonctions linked? can i use all PWM channels and still have my timers free?
> i've read the manual again again and still, i dont find the answer.
>
> also, does anyone got a sample program for pwm and/or timer use? I could
> train myself and base my program on it.
>
> thanks in advance !
>
> ps:if its not clear enough, i can explain more.
>
> joris
>
>

--
Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 91 120 1798
+34 636 52 25 69
skype: ajoajoajo
Thanks for quick answer.

That's what i thought. gonna write a small prog using the 4 timers and the pwm, with different frequencies, to be sure.

Does somebody got an example for PWM? i allready wrote the timer test prog.

thanks again Miguel.
--- In l..., Miguel Angel wrote:
>
> At least for LPC214x / LPC213x the counters used in PWM are
> independent from timers.
>
> In the other hand...the timers are shared for the capture/compare ports.
>
> 2009/7/28 joris.mushrooms :
> >
> >
> > Hello everybody,
> >
> > I'm quite a newbie in ARM programming (even if i met this in the past) and
> > i have a question about PWM implementations.
> >
> > I'm planning to use a lpc2460 and especially PWMs and timers. Are the 2
> > fonctions linked? can i use all PWM channels and still have my timers free?
> > i've read the manual again again and still, i dont find the answer.
> >
> > also, does anyone got a sample program for pwm and/or timer use? I could
> > train myself and base my program on it.
> >
> > thanks in advance !
> >
> > ps:if its not clear enough, i can explain more.
> >
> > joris
> >
> >
>
>
>
> --
> Miguel Angel Ajo Pelayo
> http://www.nbee.es
> +34 91 120 1798
> +34 636 52 25 69
> skype: ajoajoajo
>

Well they do not reply



_____

From: l... [mailto:l...] On Behalf Of
joris.mushrooms
Sent: 28 July 2009 15:11
To: l...
Subject: [lpc2000] lpc 24xx pwm example needed





Thanks for quick answer.

That's what i thought. gonna write a small prog using the 4 timers and the
pwm, with different frequencies, to be sure.

Does somebody got an example for PWM? i allready wrote the timer test prog.

thanks again Miguel.

--- In lpc2000@yahoogroups .com, Miguel
Angel wrote:
>
> At least for LPC214x / LPC213x the counters used in PWM are
> independent from timers.
>
> In the other hand...the timers are shared for the capture/compare ports.
>
> 2009/7/28 joris.mushrooms :
> >
> >
> > Hello everybody,
> >
> > I'm quite a newbie in ARM programming (even if i met this in the past)
and
> > i have a question about PWM implementations.
> >
> > I'm planning to use a lpc2460 and especially PWMs and timers. Are the 2
> > fonctions linked? can i use all PWM channels and still have my timers
free?
> > i've read the manual again again and still, i dont find the answer.
> >
> > also, does anyone got a sample program for pwm and/or timer use? I could
> > train myself and base my program on it.
> >
> > thanks in advance !
> >
> > ps:if its not clear enough, i can explain more.
> >
> > joris
> >
> >
>
>
>
> --
> Miguel Angel Ajo Pelayo
> http://www.nbee. es
> +34 91 120 1798
> +34 636 52 25 69
> skype: ajoajoajo
>



Hi,

PWMs and timers are not linked.

They are both based on timer/counter peripheral, but each PWMs and Timers have their own timer / counter. So basically, you can run PWM independently and use the timer for other purpose.

Of course, the timer can be used to generate PWM as well (check the EMR register manual).

See http://www.standardics.nxp.com/support/documents/microcontrollers/zip/code.bundle.lpc23xx.lpc24xx.uvision.zip

for a sample. It's based on LPC23xx, but still compatible with LPC24xx.

-daniel

--- On Tue, 7/28/09, Miguel Angel wrote:

> From: Miguel Angel
> Subject: Re: [lpc2000] PWM VS TIMERS
> To: l...
> Date: Tuesday, July 28, 2009, 12:37 PM
> At least for LPC214x / LPC213x the
> counters used in PWM are
> independent from timers.
>
> In the other hand...the timers are shared for the
> capture/compare ports.
>
> 2009/7/28 joris.mushrooms :
> >
> >
> > Hello everybody,
> >
> > I'm quite a newbie in ARM programming (even if i met
> this in the past) and
> > i have a question about PWM implementations.
> >
> > I'm planning to use a lpc2460 and especially PWMs and
> timers. Are the 2
> > fonctions linked? can i use all PWM channels and still
> have my timers free?
> > i've read the manual again again and still, i dont
> find the answer.
> >
> > also, does anyone got a sample program for pwm and/or
> timer use? I could
> > train myself and base my program on it.
> >
> > thanks in advance !
> >
> > ps:if its not clear enough, i can explain more.
> >
> > joris
> --
> Miguel Angel Ajo Pelayo
> http://www.nbee.es
> +34 91 120 1798
> +34 636 52 25 69
> skype: ajoajoajo



Thx everybody for help.

rtc works well, im starting pwm part.

--- In l..., Daniel Widyanto wrote:
>
>
> Hi,
>
> PWMs and timers are not linked.
>
> They are both based on timer/counter peripheral, but each PWMs and Timers have their own timer / counter. So basically, you can run PWM independently and use the timer for other purpose.
>
> Of course, the timer can be used to generate PWM as well (check the EMR register manual).
>
> See http://www.standardics.nxp.com/support/documents/microcontrollers/zip/code.bundle.lpc23xx.lpc24xx.uvision.zip
>
> for a sample. It's based on LPC23xx, but still compatible with LPC24xx.
>
> -daniel
>
> --- On Tue, 7/28/09, Miguel Angel wrote:
>
> > From: Miguel Angel
> > Subject: Re: [lpc2000] PWM VS TIMERS
> > To: l...
> > Date: Tuesday, July 28, 2009, 12:37 PM
> > At least for LPC214x / LPC213x the
> > counters used in PWM are
> > independent from timers.
> >
> > In the other hand...the timers are shared for the
> > capture/compare ports.
> >
> > 2009/7/28 joris.mushrooms :
> > >
> > >
> > > Hello everybody,
> > >
> > > I'm quite a newbie in ARM programming (even if i met
> > this in the past) and
> > > i have a question about PWM implementations.
> > >
> > > I'm planning to use a lpc2460 and especially PWMs and
> > timers. Are the 2
> > > fonctions linked? can i use all PWM channels and still
> > have my timers free?
> > > i've read the manual again again and still, i dont
> > find the answer.
> > >
> > > also, does anyone got a sample program for pwm and/or
> > timer use? I could
> > > train myself and base my program on it.
> > >
> > > thanks in advance !
> > >
> > > ps:if its not clear enough, i can explain more.
> > >
> > > joris
> > --
> > Miguel Angel Ajo Pelayo
> > http://www.nbee.es
> > +34 91 120 1798
> > +34 636 52 25 69
> > skype: ajoajoajo
>