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

clock frequency

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



Joined: 30 Nov 2008
Posts: 8

View user's profile Send private message

clock frequency
PostPosted: Tue Dec 02, 2008 3:05 am     Reply with quote

how to set the clock frequency to 4mhz can any one help with PIC c
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Tue Dec 02, 2008 4:57 am     Reply with quote

The frequency of the PIC is set by the crystal attached to its OSC pins. If you put a 4MHz crystal, and set (one of) your fuses to 'XT', you can use this crystal.

Some PICs also have an internal oscillator preset at 4MHz, or a dual speed oscillator, or a selectable-speed oscillator. You need to use the 'INTRC' or 'INTRC_IO' fuses to do this.

If you have a multi-speed internal oscillator have a look at the 'setup_oscillator' instruction.

Rohit
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Dec 02, 2008 9:48 am     Reply with quote

Read the manual about the #use delay() preprocessor directive. It is simple for the older chips, but gets complex for the newer chips with many clock options. Also read clock section of the datasheet for your PIC.
_________________
The search for better is endless. Instead simply find very good and get the job done.
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