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
 
Thread Tools Display Modes
Old 29th May 2004, 01:27 PM   (permalink)
Default Argh...Another Crystal Question

If the PIC is rated 20Mhz....
1. I should get crystal that are rated 20Mhz to get optimum speed...
2. Will tolerances of the crystal kill the PIC?
3. I see 30ppm kind of tolerances and stuff like this...shouldn't I get a a crystal less than 20Mhz?
4. Will a crystal clock oscillator rated at 19.9600Mhz work?
5. How about the timings for the serial communications?

ARgh.....totally lost...
__________________
There are no perfect solutions, only solutions acceptable for the times
Eric Koh is offline   Reply With Quote
Old 29th May 2004, 01:36 PM   (permalink)
Exo
Default Re: Argh...Another Crystal Question

Quote:
Originally Posted by Eric Koh
If the PIC is rated 20Mhz....
1. I should get crystal that are rated 20Mhz to get optimum speed...
It's rated MAX 20mhz, lower frequencies will work also...

Quote:
Originally Posted by Eric Koh
2. Will tolerances of the crystal kill the PIC?
Tolerances on the crystal speed will make the pic timing less accurate. The less tolerance on the crystal the closer the actual speed comes to the speed printed on the crystal... It will not damage the pic.

Quote:
Originally Posted by Eric Koh
3. I see 30ppm kind of tolerances and stuff like this...shouldn't I get a a crystal less than 20Mhz?
No, it will work fine with a 20mhz crystal, just forget the tolerances. Crystals are very accurate, even the worst ones are probabely very close to the given frequency

Quote:
Originally Posted by Eric Koh
4. Will a crystal clock oscillator rated at 19.9600Mhz work?
yes, but it isn't a nice clean value to write time critical code on.

Quote:
Originally Posted by Eric Koh
5. How about the timings for the serial communications?
Serial communication speed depends on a baud rate generator value wich you must put into BRG register (for harware serial comm.). The formulas to calculate this value are in the datasheets.
Exo is offline   Reply With Quote
Old 29th May 2004, 01:39 PM   (permalink)
Default

Thanks a kazillion...if I were to look up all the thousand and thousand of pages of specs from Microchip..I'll think I'll just see all my Microchip uC..


just another 9999,9999 things else to know......
__________________
There are no perfect solutions, only solutions acceptable for the times
Eric Koh is offline   Reply With Quote
Old 29th May 2004, 01:49 PM   (permalink)
Exo
Default

One thing to keep in mind is that a pic runs at 1/4 it's oscillator frquency. So, if you hook it up with a 20Mhz crystal then it will do 5000000 cycles...

Normal instructions take 1 cycle to complete except for program branches, wich take 2 cycles
Exo is offline   Reply With Quote
Old 29th May 2004, 08:48 PM   (permalink)
Default

For serial comminication try multiples of 2.304Mhz for 0% error.

I run 4.608Mhz instead of 4Mhz (unless you need to do timinig critical applications)

Ron
RonH is offline   Reply With Quote
Old 29th May 2004, 11:49 PM   (permalink)
Default

Do you mean I need to get another xtal with another freq to time the serial communications while keeping the main xtal at 20Mhz?

Or do I use the main xtal for serial communications, but with some funnie frequency instead of 20Mhz?
__________________
There are no perfect solutions, only solutions acceptable for the times
Eric Koh is offline   Reply With Quote
Old 30th May 2004, 02:35 AM   (permalink)
Default

A 20 MHz crystal, including common inaccuracies, is the intended source.

30 ppm is only 600 hz. 20 MHz is hardly a hard limit, a PIC can be overclocked anywhere from +10% to ??who knows?? before it gets unreliable. They already had to create a max rated freq based on possible lot variations (+/- many %) at the most extreme temp (- several %). +0.003% isn't going to break it.
Oznog is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 04:21 PM.


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