![]() |
![]() |
![]() |
|
|
|||||||
| 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. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
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 |
|
|
|
|
|
|
(permalink) |
|
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).
|
|
|
|
|
|
|
(permalink) |
|
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.
__________________
Last edited by mrrmot; 27th May 2008 at 10:44 PM. |
|
|
|
|
|
|
(permalink) |
|
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 |
|
|
|
|
|
|
(permalink) |
|
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.
__________________
Last edited by mrrmot; 27th May 2008 at 11:01 PM. |
|
|
|
|
|
|
(permalink) |
|
Thanks, most appreciated. I sent my email as a private message to you.
Cheers, Craig |
|
|
|
|
|
|
(permalink) |
|
The 16F887 is even newer than the 16F877A and has a built in OSC.
|
|
|
|
|
|
|
(permalink) |
|
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...
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
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. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
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. |
||
|
|
|
|
|
(permalink) |
|
In the PIC's datasheet there should be a table of capacitor value's you can use. Look under the Oscillator settings.
|
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| 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 |