Sign in

Not a member? | Forgot your Password?

Search msp430



Search tips

Subscribe to msp430



Free PDF Downloads

Advanced Linux Programming

What Every Programmer Should Know About Memory

Introduction to Embedded Systems

C++ Tutorial

Embedded Systems - Theory and Design Methodology

Discussion Groups

See Also

ElectronicsDSPFPGA

Find us on Facebook





Discussion Groups | MSP430 | how to change duty cycle?

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

how to change duty cycle? - mazeltob - May 10 11:13:56 2007

hi... i am still very new here.....

i have a question, which should be very basic to all of you.

what i ask is that how to change duty cycle in PWM. i know we need to
update the value of CCRx to match the counter value.

this is done in one PWM cycle. what if i wanna change this CCRx value
for next PWM cycle to have other Duty Cycle? is it done by software or
hardware?

what i guess is that the very last overflow of one pwm cycle generates
interrupt that is fed to execute software line to write a new value to
CCRx. is it correct?

and how can we know the exact value to a certain Duty Cycle to generate?
for example, i wanna to have duty cycle from 30% 50% 55% 60% 62%. the
values for each duty cycle are already defined somewhere (like a table
to refer) and software reads them to write?

Please help me out with this questions...

Thanks in advance.

sonny

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: how to change duty cycle? - Crane - May 11 7:59:39 2007

Set the timer value to determine the period and the capture value to
determine the duty cycle.

Generally these two values are stored in RAM by the applications software. A
Timer
overflow reads the two values and sets the timer register to the period and
the capture
register to the duty cycle.

You could use a table but that is not very efficient. If you want 50% just
shift period value right once
and put it in the capture register.

Crane

mazeltob wrote:
>
> hi... i am still very new here.....
>
> i have a question, which should be very basic to all of you.
>
> what i ask is that how to change duty cycle in PWM. i know we need to
> update the value of CCRx to match the counter value.
>
> this is done in one PWM cycle. what if i wanna change this CCRx value
> for next PWM cycle to have other Duty Cycle? is it done by software or
> hardware?
>
> what i guess is that the very last overflow of one pwm cycle generates
> interrupt that is fed to execute software line to write a new value to
> CCRx. is it correct?
>
> and how can we know the exact value to a certain Duty Cycle to generate?
> for example, i wanna to have duty cycle from 30% 50% 55% 60% 62%. the
> values for each duty cycle are already defined somewhere (like a table
> to refer) and software reads them to write?
>
> Please help me out with this questions...
>
> Thanks in advance.
>
> sonny
>

--

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.