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

How to change the clock frequency in a existing project?

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



Joined: 13 May 2008
Posts: 5

View user's profile Send private message

How to change the clock frequency in a existing project?
PostPosted: Thu May 15, 2008 8:42 am     Reply with quote

Hello,

i have a home-made board with a 16F876A-I/SP and a xtal of 4MHz and i want to change it for an 20MHz xtal. The question is... What must i do to change the clock frequency from 4 to 20MHz? I don't know how to do it because I've tried to do this but the software doesn't work.

Thanks for your help
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: How to change the clock freqüency in a existing project
PostPosted: Thu May 15, 2008 8:54 am     Reply with quote

Well, if you just replaced the 4MHz crystal with a 20MHz crystal, the first thing you need to do is to change the configuration fuses for the oscillator type from XT to HS. 20MHz is too high to work reliably with the XT configuration.

The next thing you have to do is to examine all the aspects of your software that are dependent on the clock speed. This includes the serial baudrate, if you are using a serial port, timers, etc. Some of these things can be done automatically by the CCS compiler if you specify the new frequency using the #USE DELAY command. But you should not count on this happening without your thinking it through yourself. Without getting into the details of your application, it is impossible to say everything that might need to be done to accommodate the 20MHz crystal.

Robert Scott
Real-Time Specialties
se07860



Joined: 13 May 2008
Posts: 5

View user's profile Send private message

PostPosted: Thu May 15, 2008 9:05 am     Reply with quote

Job done and working.
Thanks for your answers to my qüestion (i think one answer has disappeared Shocked )
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu May 15, 2008 9:25 am     Reply with quote

se07860 wrote:
(i think one answer has disappeared Shocked )
I deleted my answer as it was a double post.
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