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.

Argh...Another Crystal Question

Status
Not open for further replies.

Eric Koh

New Member
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...
 
Eric Koh said:
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...

Eric Koh said:
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.

Eric Koh said:
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

Eric Koh said:
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.

Eric Koh said:
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.
 
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..

:D
just another 9999,9999 things else to know......
 
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
 
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
 
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?
 
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.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top