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

Crystal or Internal Oscillator

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



Joined: 19 Jul 2009
Posts: 5

View user's profile Send private message

Crystal or Internal Oscillator
PostPosted: Fri Jul 31, 2009 9:25 am     Reply with quote

I'm fairly new to using PICs, so plz correct me if I'm wrong:

I'm under the impression that external crystals are more accurate than internal oscillators. Are there any other advantages/disadvantages associated with using either?

I will use the PIC for a PID controller of a precision vacuum pump. Now I see that I do have room on the PCB I'm designing, I wonder if I should add in a crystal.

Thanks.
Jerson



Joined: 31 Jul 2009
Posts: 122
Location: Bombay, India

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

PostPosted: Fri Jul 31, 2009 10:04 am     Reply with quote

If you are looking for general accuracy, go with the internal oscillator. Saves on the crystal and its associated costs. If you need precision of frequency and drift, choose external crystal. You should check that the PIC you plan to use has an internal oscillator option if you need to use it.
_________________
Regards
Jerson Fernandes
mkuang



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

PostPosted: Fri Jul 31, 2009 10:26 am     Reply with quote

A good quality crystal with 30ppm accuracy from -40C to +85C costs about 50cents in quantities of sevral hundred to a thousand. I don't know about you but I would not want to save the 50 cents if I have the board space (plus two associated capacitors of course). This is even more important if you are doing any sort of asynchronous communication like RS232 or RS485. The internal oscillators in the PICs are typically about 2% accurate, at room temperature. So if your device is sitting in a lab all day it probably doesn't matter but if you ever send it out into the hot sun where it can to +60C easy and you want reliable transmission then it is anybody's guess what's going to happen.
lyndia



Joined: 19 Jul 2009
Posts: 5

View user's profile Send private message

PostPosted: Fri Jul 31, 2009 2:04 pm     Reply with quote

Thanks =)
SherpaDoug



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

View user's profile Send private message

PostPosted: Fri Jul 31, 2009 7:13 pm     Reply with quote

The PIC internal oscillators almost always work well enough for RS232 comms. They only fail when your CUSTOMER tries to use it!
Check out the oscillator accuracy graphs in the PIC datasheets. If you run at less than 5V or other than room temperature RS232 becomes a gamble. Note that if you are communicating with a PC, the PC may also have some baud rate error. If the PIC drifts one way and the PC drifts the other way you are DOOMED!
Be smart and use a crystal, or a ceramic resonator if price is a big issue.
_________________
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