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 support@ccsinfo.com

question about PWM

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







question about PWM
PostPosted: Mon Oct 04, 2004 7:29 pm     Reply with quote

"20MHz crystal seems to be 1.22 KHz (per Microchip manual)" via a search.

So I downloaded the datasheet but I didnt see any type of refence chart with that data for 4mhz.

I want to get in the range of 10hz or so.


btw I have a 16f876


Nick
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Mon Oct 04, 2004 10:02 pm     Reply with quote

You have to use the formulas in the datasheet to calculate the minimum possible frequency. For a 4MHz crystal it would be about 240Hz.

If you need a 10Hz wave you'll need to implement it using Timer/Compare interrupts.
J_Purbrick



Joined: 16 Sep 2003
Posts: 9

View user's profile Send private message

PostPosted: Tue Oct 05, 2004 11:04 pm     Reply with quote

"20MHz crystal seems to be 1.22 KHz (per Microchip manual)" was a quote from one of my postings! To get a complete sentence, it should have read something like, "The slowest PWM rate you can achieve with a 20MHz crystal seems to be 1.22 KHz (per Microchip manual)".

If you want to use the built-in PWM generator you'd have to run it with a ridiculously slow oscillator to get 10Hz. Better to do it in software.
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