Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: tristantech on July 29, 2009, 10:22:34 AM

Title: avr crystal oscillator
Post by: tristantech on July 29, 2009, 10:22:34 AM
hi, i want to attach an external crystal oscillator (the kind that has 4 pins, is in a metal case, and has all the circuitry built-in, like the kind in the picture below) to my atmega644. how do i do this?

(http://media.digikey.com/photos/ECS%20Photos/ECS-%20.5%20CLOCK%20OSCIL.jpg)
Title: Re: avr crystal oscillator
Post by: wil.hamilton on July 29, 2009, 11:13:06 AM
more information would be helpful, like, what is your circuit hooked up to?  what else is there?

anyways, here is the datasheet for the atmega644
http://www.atmel.com/dyn/resources/prod_documents/doc2593.pdf

if you look on page 35, section 7.8 it talks about how to use an external oscillator.
Title: Re: avr crystal oscillator
Post by: guru on July 29, 2009, 11:57:50 AM
There are 4 pins. Two pins are power and ground, connect these accordingly to your voltage regulator. If you want to get picky, place a bypass capacitor of .1uF across the power supply pins. One of the other pins will be OUT. Connect this to the OSC-IN pin of the atmel (Refer to datasheet). The other oscillator pin is not used since you are using this type of external oscillator.

Why would you want to use an expensive crystal oscillator? Usually a resistor/capacitor suffices for most people. A crystal (plus 2 20pf caps) is just as good as the external one when used with the Atmel's built-in crystal oscillator, and cheaper.