Forums

Re: Doubts on LPC2129

Started by Joel Winarske September 27, 2007
ranjani krishnan wrote:
> I am new to this ARM LPC2129. I want to generate 6 PWm signals for the
MOSFET driver to control my motor. Sample code for PWm generation is
available in net.Can anyone tell how to set the frequency of PWM
signals.What is the relation between the value given in MR0
register(given in hexadecimal value) and frequency ?How to generate 6PWM
signals with 60 degree delay?I also referred the user manual.there is no
relation mentioned for frequency calculation for PWM signals.I am a ME
student.
>
> I am doing my project with this.please clear my doubts.

Excerpt from the LPC2129 *user* manual:
"Seven match registers allow up to 6 single edge controlled or 3 double
edge controlled PWM outputs, or a mix of both types."

My advice is to find a logic analyzer and start experimenting. Regardless
of the part, you will want one to confirm your work.

I'm amazed at how many students request help on this forum. How do you
learn and build confidence in your abilities when someone else solves your
problem?

An Engineer's Guide to the LPC2100 Series

TouShey,...at least read the manual.

We were all students at one time (still am .. always learning) but read the darn
books!!!

Quoting Joel Winarske :

> ranjani krishnan wrote:
> > I am new to this ARM LPC2129. I want to generate 6 PWm signals for the
> MOSFET driver to control my motor. Sample code for PWm generation is
> available in net.Can anyone tell how to set the frequency of PWM
> signals.What is the relation between the value given in MR0
> register(given in hexadecimal value) and frequency ?How to generate 6PWM
> signals with 60 degree delay?I also referred the user manual.there is no
> relation mentioned for frequency calculation for PWM signals.I am a ME
> student.
> >
> > I am doing my project with this.please clear my doubts.
>
> Excerpt from the LPC2129 *user* manual:
> "Seven match registers allow up to 6 single edge controlled or 3 double
> edge controlled PWM outputs, or a mix of both types."
>
> My advice is to find a logic analyzer and start experimenting. Regardless
> of the part, you will want one to confirm your work.
>
> I'm amazed at how many students request help on this forum. How do you
> learn and build confidence in your abilities when someone else solves your
> problem?
>
--- In l..., dave@... wrote:
>
> ranjani krishnan wrote:
> > I am new to this ARM LPC2129. I want to generate 6 PWm signals for
the
> MOSFET driver to control my motor. Sample code for PWm generation is
> available in net.Can anyone tell how to set the frequency of PWM
> signals.What is the relation between the value given in MR0
> register(given in hexadecimal value) and frequency ?How to generate
6PWM
> signals with 60 degree delay?I also referred the user manual.there is
no
> relation mentioned for frequency calculation for PWM signals.I am a ME
> student.
> >
> > I am doing my project with this.please clear my doubts.
>
> Excerpt from the LPC2129 *user* manual:
> "Seven match registers allow up to 6 single edge controlled or 3
double
> edge controlled PWM outputs, or a mix of both types."
>
> My advice is to find a logic analyzer and start experimenting.
Regardless
> of the part, you will want one to confirm your work.
>
> I'm amazed at how many students request help on this forum. How do you
> learn and build confidence in your abilities when someone else
solves your
> problem?
>
hey dude here is the solution for ur problem
i will make it do-it-yourself way

i will explain you wat the datasheet screams
for eg. i want to generate a pwm of 8ms and on time of say 1ms
the first job is to set the resolution of the pwm step increase
it is set by the PWMTC (the step time of PWMTC is decided by the
Prescaler)

then u have to select double edged or single edged.
In my case i have used single edged so will explain that
out of seven register one act as a primary source u can call it as
master the master or MR0 selects the frequency of PWM.
The other match registers just counts upto there assigned values and
stops but they don't reset TIMER COUNTER, that job is done by using
MR0 (that's why its the master for me )
then set the PWM for continuous running mode. Now ur work is done
u just have to update the MR's in order to get varying Output.
you may or maynot generate PWM
................................__ __ __ _8ms__ __ __ __
MRO
____________|.......................................|________________
..................................__ __5ms_ __ __
MR1 _____________|........................ |____________________
..................................__ 1ms
MR2_____________|...|_____________________

i generated it but on keil it works fine
but on controller it doesn't give output but the method of generation
is like this only
--- In l..., "Joel Winarske" wrote:
>
> ranjani krishnan wrote:
> > I am new to this ARM LPC2129. I want to generate 6 PWm signals for the
> MOSFET driver to control my motor. Sample code for PWm generation is
> available in net.Can anyone tell how to set the frequency of PWM
> signals.What is the relation between the value given in MR0
> register(given in hexadecimal value) and frequency ?How to generate 6PWM
> signals with 60 degree delay?I also referred the user manual.there is no
> relation mentioned for frequency calculation for PWM signals.I am a ME
> student.
> >
> > I am doing my project with this.please clear my doubts.
>
> Excerpt from the LPC2129 *user* manual:
> "Seven match registers allow up to 6 single edge controlled or 3 double
> edge controlled PWM outputs, or a mix of both types."
>
> My advice is to find a logic analyzer and start experimenting.
Regardless
> of the part, you will want one to confirm your work.
>
> I'm amazed at how many students request help on this forum. How do you
> learn and build confidence in your abilities when someone else
solves your
> problem?
>
hey dude here is the solution for ur problem
i will make it do-it-yourself way

i will explain you wat the datasheet screams
for eg. i want to generate a pwm of 8ms and on time of say 1ms
the first job is to set the resolution of the pwm step increase
it is set by the PWMTC (the step time of PWMTC is decided by the
Prescaler)

then u have to select double edged or single edged.
In my case i have used single edged so will explain that
out of seven register one act as a primary source u can call it as
master the master or MR0 selects the frequency of PWM.
The other match registers just counts upto there assigned values and
stops but they don't reset TIMER COUNTER, that job is done by using
MR0 (that's why its the master for me )
then set the PWM for continuous running mode. Now ur work is done
u just have to update the MR's in order to get varying Output.
you may or maynot generate PWM
__ __ __ _8ms__ __ __ __
MRO ____________| |________________
__ __5ms_ __ __
MR1 _____________| |____________________
__ 1ms
MR2________________||_____________________

i generated it but on keil it works fine
but on controller it doesn't give output but the method of generation
is like this only