View previous topic :: View next topic |
Author |
Message |
se07860
Joined: 13 May 2008 Posts: 5
|
How to change the clock frequency in a existing project? |
Posted: Thu May 15, 2008 8:42 am |
|
|
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
|
Re: How to change the clock freqüency in a existing project |
Posted: Thu May 15, 2008 8:54 am |
|
|
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
|
|
Posted: Thu May 15, 2008 9:05 am |
|
|
Job done and working.
Thanks for your answers to my qüestion (i think one answer has disappeared ) |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu May 15, 2008 9:25 am |
|
|
se07860 wrote: | (i think one answer has disappeared ) | I deleted my answer as it was a double post. |
|
|
|