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

External VS. Internal Oscillator

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



Joined: 01 Mar 2010
Posts: 73

View user's profile Send private message

External VS. Internal Oscillator
PostPosted: Tue Mar 12, 2013 4:59 pm     Reply with quote

I want to apologize if this question is not appropriate to ask here. I'm having a difficult time finding any information regarding this simple question... probably because it's a stupid question, but here it goes:

Is there any advantages to using an external oscillator as opposed to the internal one besides increased speed? Is it more accurate? Anything else to consider?
temtronic



Joined: 01 Jul 2010
Posts: 9165
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 12, 2013 5:32 pm     Reply with quote

External oscillators are far more accurate,especially over a wide temperature range.
Also you can use 'oddball' frequencies commonly used in 'high security' applications or where precise binary division is required.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Mar 12, 2013 5:35 pm     Reply with quote

Start by reading the data sheet for the particular PIC.

For internal RC:-

Data sheet, will give an idea of internal oscillator range, accuracy, and temperature stability.

External oscillator depends on type.

For external RC:-

Data sheet again tells you accuracy etc., plus (of course) tolerance on R and C.

For external others:-

Essentially tolerance etc, of say Xtal or resonator.
Again data sheet tells you possible range.

And so on, and so on......................

Other considerations:-

Start up time, cost, will UART frequency be accurate enough .............................


Mike
Ttelmah



Joined: 11 Mar 2010
Posts: 19350

View user's profile Send private message

PostPosted: Wed Mar 13, 2013 1:52 am     Reply with quote

The other one that has not been mentioned, is actual clock 'value'.
The internal oscillators will normally offer you either a fixed frequency (say 4MHz), or a number of binary multiples/divisions of a similar value.
Now for some applications (comms in particular), you may need to be able to generate a clock at a specific rate. So (for instance), to generate a reasonably accurate 115200bps communication link from a chip running at about 4MHz (the frequency 'area' because of power and RF limitations), you'd want to clock at perhaps 3.6864MHz, which then gives exactly 115200bps, using Fosc/32. The 4MHz doesn't allow such a nice accurate division.

On normal serial comms, the internal clocks on many chips, even when they are at the 'right' nominal frequency, are not accurate enough. On a lot of the later chips they have improved to be 'good enough' for 90% of applications.

Now, on USB for example, the internal clocks are not accurate enough at all. However we then have new chips which 'cheat', and as well as their internal clock have an internal PLL, allowing this to be synchronised to the data rate on an attached master device, allowing these to do USB, without an external clock. Neat, but means that the clock accuracy of the device is only 'good' when they are attached to the USB. You pays your money.....

It is a 'can you get close enough to what you want, without spending extra money' choice, versus also the extra pins gained. How dangerous this type of decision can be, can be seen with a lot of USB devices. Here many hubs etc., use ceramic resonators rather than crystals, which save a few (very few...) cents. Generally they work OK, meeting the USB specs, but only over a relatively narrow temperature range. Shift the units out into an outbuilding, and suddenly they stop connecting properly. Even worse though get a sudden summer heatwave, and they start failing in offices....

Best Wishes
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