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 QUESTION

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








PWM QUESTION
PostPosted: Sun Mar 05, 2006 4:53 pm     Reply with quote

Hi,

How can i get continuous 455 KHZ of PWM with a PIC16F628A?
Could anyone post a piece of sample code about it?

Thank you.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Sun Mar 05, 2006 4:58 pm     Reply with quote

Take a look at the example EX_PWM.C that comes with the compiler.
<program files>\picc\examples\EX_PWM.C
Guest








PostPosted: Sun Mar 05, 2006 5:31 pm     Reply with quote

Thank kender,

I was looking that, but i need to get closer values. For example.

1/20000000*4*1*11 = 454,545 hz and with 10 instead of 11 ->
1/20000000*4*1*10 = 500,000 hz

and I need 455khz. any suggestions?-

Thanks again.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Mar 05, 2006 5:47 pm     Reply with quote

You may have to change your crystal frequency.
Look at the formula given in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=17993

Look at a catalog of crystals to choose a suitable frequency.
http://dkc3.digikey.com/PDF/T061/0916.pdf
(For a PIC, you want the non-series type. Pick the type that
has a load capacitance of typically 18pf or 20pf).
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