CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PWM

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
masiha308



Joined: 07 Apr 2010
Posts: 3
Location: IRAN

View user's profile Send private message

PWM
PostPosted: Thu Apr 08, 2010 3:59 am     Reply with quote

Hi there

I want to set a pwm module in PIC16F877A but i dont know how to set this.
Can you help me?
I you can tell me step-by-step to design a pwm pulse for a variable duty cycle and variable priod.

thank you
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Thu Apr 08, 2010 4:38 am     Reply with quote

ex_pwm.c with the compiler.

Varying the actual frequency, is very rare in PWM applications. Problem is that as you change the frequency, the 'legal' values for duty change with them. Normally a PWM application, would run fixed frequency, and just vary the duty cycle, or if you wamted a variable frequency 'source', then you would run at either a fixed pulse width, or at just 50% duty cycle. Varying both in the same code would get complex....

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 08, 2010 10:49 am     Reply with quote

There are a large number of PWM sample programs in the forum
archives. You can use the forum's Search engine to find them.
Take a pwm function from the CCS manual. Put the name of the
function and your PIC type into the search engine. Example:
Quote:
set_pwm1_duty 16F877*

Then set it to: Search for all Terms.

You will get many hits. Here is one example:
http://www.ccsinfo.com/forum/viewtopic.php?t=17729&start=1
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group