Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 27th May 2008, 10:29 PM   (permalink)
Default Creating a PIC frequency supply

Hi,

I am getting a bit confused about creating clock frequencies for a PIC chip (PIC16F72 to be precise).

Looking at the datasheet for the chip I see it has an internal clock, but then some of the schematics seem to have external capacitors etc which I assume is to get the 20Mhz frequency required.

Do I need to create an external 20Mhz freq for the chip? If so how?

If I needed one I thought I would have to use a 555 timer chip - is this not necessary?

Or are these questions dependant on the use of the chip?

Thanks,

Craig
richacm is offline  
Reply With Quote
Old 27th May 2008, 10:40 PM   (permalink)
Default

The 16F72 is getting pretty long in the tooth and requires an external clock (DC to 20MHz). You need a 20MHz crystal and a couple of 18pf caps. See my Inchworm Assembly manual for a typical schematic (the power and clock pins are the same for the 16F877).
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 27th May 2008, 10:43 PM   (permalink)
Default

I've only worked with the 16f877 and 16f877a, but i think this is how your pic should be connected, too.

I always connect an oscillator ( quartz+2capacitors ) to the OSC0 and OSC1 pins. The frequency of the oscillator is then creating the time base, for the microcontroller. You should most definitely check the datasheet of your pic out. It surely is containing information on this.
__________________
Dazed&Confused

Last edited by mrrmot; 27th May 2008 at 10:44 PM.
mrrmot is offline  
Reply With Quote
Old 27th May 2008, 10:44 PM   (permalink)
Default

Thanks.

I am starting out so am not too sure what PIC chip to get - there are so many out there. Is the latest best one the 16F877?

Oh and where can I find your Inchworm assembly manual?

Cheers,

Craig
richacm is offline  
Reply With Quote
Old 27th May 2008, 11:01 PM   (permalink)
Default

Yeah, the 16f877 is pretty good. Generally even most industrial processes use a 8-bit controller. If u send me your e-mail, I can send you the whole schematic diagram of how to connect this pic.
__________________
Dazed&Confused

Last edited by mrrmot; 27th May 2008 at 11:01 PM.
mrrmot is offline  
Reply With Quote
Old 27th May 2008, 11:19 PM   (permalink)
Default

Thanks, most appreciated. I sent my email as a private message to you.

Cheers,

Craig
richacm is offline  
Reply With Quote
Old 27th May 2008, 11:49 PM   (permalink)
Default

The 16F887 is even newer than the 16F877A and has a built in OSC.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 28th May 2008, 12:18 PM   (permalink)
Default

Almost all PIC's share the same approach for external oscillators, and are connected up like this;



Have a look in the data sheet, and within the first 5 pages you will find the Pin-out for the device, just hook the crystal oscillator up to OSC1 and OSC2.

Using internal oscillators makes life even easier, and they are very easy to setup in code!

My PIC of choice has been the 18F4550 of late, and setting up the internal oscillator with Swordfish is simple;
Code:
Device = 18F4550
Clock = 8
Config FOSC = INTOSCIO_EC

OSCCON = %01111111

// begin the program...
External crystal oscillators are much more accurate then internal oscillators though, this isn't a real issue for 98% of projects
__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is offline  
Reply With Quote
Old 15th June 2008, 11:28 PM   (permalink)
Default

I don't know if you're in my position, but as a beginner I found that Microchip's free sample service was a good way to get several different PICs to try out. Just got four 16F887A in the mail without spending a dime. Morton's introductory book is very good indeed and starts with 16F54, but my biggest problem was the oscillator thing, so my first success was with the 12F508 because it has an internal oscillator.

Would the 16F887 be a little complicated in terms of initialization for the uninitiated? The datasheet looks intimidating. 16F5x and 12F5x seem more straightforward.
astronomerroyal is offline  
Reply With Quote
Old 16th June 2008, 01:24 AM   (permalink)
Default

Quote:
Originally Posted by astronomerroyal View Post
I don't know if you're in my position, but as a beginner I found that Microchip's free sample service was a good way to get several different PICs to try out. Just got four 16F887A in the mail without spending a dime. Morton's introductory book is very good indeed and starts with 16F54, but my biggest problem was the oscillator thing, so my first success was with the 12F508 because it has an internal oscillator.

Would the 16F887 be a little complicated in terms of initialization for the uninitiated? The datasheet looks intimidating. 16F5x and 12F5x seem more straightforward.
I didn't realise that Microchip had a free sample service...I will have to investigate! I started using the 16F690 which came with PIC2Kit and that has an internal clock although that caused me some other problems in terms of adjusting the frequency. In the end I went down to my local hardware shop and bought a 16F877A and wired up the Oscillator as discussed in this thread. It worked perfectly and I have had no issues with it. The datasheet for the 16F877A is intimidating but it does make sense. Initially it took me about 6 or 7 reads of a section to understand it and then I posted here to make sure I really understood it. I am steaming ahead now though with PIC programming...its all good fun!

One other thing is I really recommend getting a 3rd party compiler when starting out....basic or C. It makes it so much easier to learn and faster to do stuff.
richacm is offline  
Reply With Quote
Old 16th June 2008, 03:12 AM   (permalink)
Default

In the PIC's datasheet there should be a table of capacitor value's you can use. Look under the Oscillator settings.
Krumlink is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Creating a Blog! ElectroMaster Feedback/Comments 0 16th May 2008 11:36 AM
plz help on creating a preamp nilushi General Electronics Chat 1 23rd June 2007 06:53 PM
Creating inductors gastonanthony General Electronics Chat 34 13th May 2005 10:40 PM
Creating high frequency waves with low frequency crystals loopy Micro Controllers 5 14th February 2005 07:57 AM
Creating a C++ Program Deathshead General Electronics Chat 4 20th July 2004 03:18 PM



All times are GMT. The time now is 06:12 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.