Sign in

username or email:

password:



Not a member?
Forgot your Password?

Search msp430



Search tips

Subscribe to msp430



Discussion Groups

See Also

DSPFPGA

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.


So far in May, you have voted 0 times ou of a total of 20 votes by the community.
Please help us clean the archives from unuseful discussion threads by using the voting system! Details here.


Is this thread worth a thumbs up?

0

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


(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

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
>

--
View this message in context: http://www.nabble.com/how-to-change-duty-cycle--tf3722253.html#a10430524
Sent from the MSP430 - Discuss mailing list archive at Nabble.com.


(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )