Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Oscillator Interval VS external

Status
Not open for further replies.

haxan

New Member
Hi, I have always used external oscillator (4Mhz) up till now. I just want to know if there are any advantages of using external VS internal or maybe in what conditions internals shouldn't be used etc.

I am using PIC18F4520.
 
Hi, I have always used external oscillator (4Mhz) up till now. I just want to know if there are any advantages of using external VS internal or maybe in what conditions internals shouldn't be used etc.

I am using PIC18F4520.

Internal oscillators are less accurate, it's only an RC oscillator - it's obvious advantages are less components, and it frees up more I/O pins - if you don't need extreme accuracy, then it's a perfect solution.
 
I've used the internal RC many times for serial communication up to 19.2 kbaud or so, depends on the temperature and voltage variation you expect your project to be under as they will change the internal RC's clock frequency the most.
 
i have done a fair few projects now, and i have only used the internal oscillator, so far has worked fine no matter what i have thrown at it.
 
There are tables in the PIC datasheets which show calculated error values for different baud rates. I would check them to see what values you are likely to get.

I have used the internal oscillator with software and hardware UART and never had a problem. If you are writing a serious app then add some CRC or error correction data into your protocol and you will be fine.

As a general note about the internal oscillator, if you change speeds (including the first time you set the speed in your program) don't forget to wait for the oscillator to be stable. You can do this by checking the IOFS bit in the OSCCON register.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top