Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 9th November 2007, 04:17 PM   (permalink)
Default Help with Crystal Values for a new comer to PIC's

I hope I’m posting this to the right thread…

As soon as my parts arrive I want to build a project based on a PIC, now at this point I should mention I’ve never tinkered with PIC’s before so I know nothing about them…

Ok my question is this… the circuit I want to build calls on a 13MHz Crystal the PIC in the circuit is a 16F870, which according to it’s datasheet can run up to 20MHz (correct me if you know I’m wrong) Anyway I was just wondering seeing I can’t find a 13MHz Crystal but I can find a 10 or 20MHz one could I replace the called for Crystal with one of the two I can get and if I do so, will that mean I have to change the code I’m meant to load onto the PIC (and is changing the code like what I’m asking even possible?)

I hope this makes sense.

Thank you in advance…

Dawn.
Dawny is offline  
Old 9th November 2007, 04:32 PM   (permalink)
Default

It depends why it uses such an unusual value?, the two most common frequencies used are 4MHz and 20MHz - presumably there's a good reason for it using a 13MHz one?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 9th November 2007, 09:33 PM   (permalink)
Default

Timing accuracy is usually the reason to use a crystal instead of the internal oscillator.

You can get a crystal or oscillator made specially for not too much money, or you can change to code to keep the timing correct with a different crystal.

If you tell us something about the application, we might be able to work out how critical the timing is.
Diver300 is offline  
Old 10th November 2007, 01:18 AM   (permalink)
Default

oh the application is this thing http://hem.passagen.se/communication/frcpll.html
Dawny is offline  
Old 10th November 2007, 02:12 AM   (permalink)
Default

You will need to get the specified crystal if you are not comfortable on modifying the original software of the PIC to use other more standard frequency crystals.

See the following quote from that website.

Quote:
The accuracy of this counter is set by the frequency of the 13MHz crystal. I advice you to choose a good and stable crystal. In my case I use a very stable and accurate SMD 13.000MHz crystal.
__________________
L.Chung
eblc1388 is offline  
Old 10th November 2007, 03:39 AM   (permalink)
Default

You did not say where you live so it is difficult to let you know where to look for parts.

In the US I often use Mouser.

They have 549-CVT25-13 from Crystek Crystals
Data Sheet

Mouser's discription say 130MHz but in another column it lists the frequency as 13 MHz. The 130 must be a typo.

About $8

Post some pics when you get it working.
3v0 is online now  
Old 10th November 2007, 04:19 AM   (permalink)
Default

I'm Australain.
Dawny is offline  
Old 10th November 2007, 07:47 AM   (permalink)
Default

Okay going back to my first question and adapting it slightly in your opinions how hard would it be for me to change the code of the 16F870 to make it suitable with a 10MHz or 20MHz Crystal?

Dawn.
Dawny is offline  
Old 10th November 2007, 07:55 AM   (permalink)
Default

Quote:
Originally Posted by Dawny
Okay going back to my first question and adapting it slightly in your opinions how hard would it be for me to change the code of the 16F870 to make it suitable with a 10MHz or 20MHz Crystal?

Dawn.
Unfortunately, the author of the code has not made the source code available and this makes it almost impossible to change.

Mike.
Pommie is online now  
Old 10th November 2007, 08:44 AM   (permalink)
Default

oh well thank you anyway. Guess I should look for a differentfrequency counter that uses more common parts.

Dawn.
Dawny is offline  
Old 10th November 2007, 10:59 PM   (permalink)
Default

Or, write the author and ask for a different version. Some are more than willing.

Or, possibly easier, spend the 1.0 € for the specified crystal. He claims shipping is (1€ - 2.5€ Worldwide).
mneary is offline  
Old 11th November 2007, 01:27 AM   (permalink)
Default

That reminds me I've got to finish the Frequency counter on the Dragonfly. Was much easier to use a 18F2525 as its got a gated timer.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Old 11th November 2007, 05:44 AM   (permalink)
Default

It's probably best to tinker with PICs so that among other things (the thrill of making stuff happen) you may have some idea of what to do if something goes wrong. Now I realize that writing the code for this yourself is a bit far fetched at the moment.

It seems to me that a 13Mhz crystal was either something he had on hand and needed to get rid of or some tight code loop needs exactly the right crystal frequency. Using LEDs does place some overhead on the task, as does serial communication.

Were I to make one, which some day I hope to, I would used a timed interrupt every millisecond to read TMR1 and figure how far it has advanced since the last iteration. This will allow up to 65MHz, which is beyond the rating of TMR1's input of 50MHz. The external chip is a high speed divider, which is what I would use to get the high MHz or GHz range.

That much having been said, I recommend looking around for another project like this one. I believe you'll be able to find one that uses most of the same parts, except for a more common crystal.


After finding the above mentioned article independently when running another search, I thought about it more. This is the first one I've noticed that has an RF probe built in- wonderful if you're a radio enthusiast but may complicate using it some times.

Last edited by ldanielrosa; 12th November 2007 at 03:05 AM.
ldanielrosa is offline  
Old 12th November 2007, 06:40 AM   (permalink)
Default

Quote:
Originally Posted by Dawny
oh the application is this thing http://hem.passagen.se/communication/frcpll.html
Dawny, I think you must to developing your own software, cause i think the guy who design this circuit have smart idea to used pll ic as prescaler, as we know the special prescaler ic have much price then pll ic that was used for this circuit. You can get lmx2322/lmx2346 for USD 2.5 from digikey and special prescaler ic can be USD 6-8.


I will give you a clue to do it, first you must set the ic pll as test mode, so you will get the N counter at the output cpo pin (at lmx2322) or LD pin (lmx2346). Download the datasheet and read it so you know what i mean.

And finally you will only need a routine to measure the frequency. I've try it, but i'm not good enough with tmr, sorry

By the way, i've stock for 13Mhz smd from ABracon.
__________________
http://www.henryelectronics.com
blinkstar88 is offline  
Old 12th November 2007, 10:09 AM   (permalink)
Smile For pic...

For pic it is better to use crystals of multiple of 4 MHz.

like 4 Mhz , 8 MHz , .... uptil 40 MHz depending on type of pic controller....

Better to start with 4 MHz.... it will be ok...

Avoid 12 MHz for better accuracy...

Regards,

Simran..
__________________
Simran..
8051 Specialist..
simrantogether is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
cap values for crystal mactack Micro Controllers 12 18th August 2006 06:18 AM
Crystal or Crystal Oscillator? eblc1388 General Electronics Chat 4 21st August 2005 05:43 PM
Crystal questions zachtheterrible General Electronics Chat 7 9th April 2005 03:19 PM
Crystal oscillator questions Johnson777717 Micro Controllers 0 19th August 2004 11:41 PM
Sharing a crystal between 3 ICs DaKandEKid Electronic Projects Design/Ideas/Reviews 3 12th May 2004 03:18 AM



All times are GMT. The time now is 02:07 AM.


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

eXTReMe Tracker