Go Down

Topic: Standalone ATMega328 Crystal Selection (Read 2129 times) previous topic - next topic

FestusHagen

Hi All,

Breadboarding the ATMega328.

Needing some clarity.

Upon reading the ArduinoToBreadboard article, it states:
    a 16 MHz crystal,
    a 10k resistor, and
    two 18 to 22 picofarad (ceramic) capacitors.

However, Not all the required info is provided in the article parts list to make a crystal selection ...
1. What is the correct:
     Tolerance
     Frequency Stability
     Load Capacitance

2. Does the Load Capacitance define the PicoFarad for the Caps ??

Sorry, Tried searching with no definitive answer and tried finding this info in the datasheet, unfortunately I have not the education to comprehend the cryptology of datasheets!

Thanks

-Enjoy
fh  : )_~

CrossRoads

I use these two parts without any problems.
http://www.dipmicro.com/store/XC7-16000
http://www.dipmicro.com/store/C1K22-1000

I believe the circuit is pretty tolerant of variance in value.
I've built a bunch with wirewrap, which you would think would add a lot of capacitance and probably some inductance, and I've built a lot using PCBs with the same parts, and also with surface mount caps. I haven't noted any differences in operation, even at 115K serial speeds to a USB/Serial adapter module.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

FestusHagen

Much Thanks ...

Be nice if folks would write their articles/tutorials clearly and concise without ambiguity for those that they are writing them for ... us that do not know!

-Enjoy
fh  : )_~

kf2qd

Or get hold of a 16Mhz resonator and forget about the extra components.

The reason for the perceived ambiguity is that it really isn't all that critical and a variety of components will work with no percepable change in performance unless you are really pushing things and need a certain set of parameters to be held to closely. Different capacitor values will affect teh timing of the crystal. If you are using the Arduino for some application where you need closer timing then you would have to adjust those components. For most playing/experimenting close enough is better than we need.

frank26080115

Do you absolutely need 16 MHz? You can skip both the crystal and resonator if you just ran on the internal 8 MHz resonator.

You don't need the 10 kilo-ohm resistor, there's an internal pull-up built into the ATmega already
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

CrossRoads

#5
Jun 29, 2012, 08:03 pm Last Edit: Jun 29, 2012, 08:06 pm by CrossRoads Reason: 1
There were numerous discussions in the old forum of erratic operation in standalone designs that were solved by adding the 10K pullup to compensate for the weak internal reset pullup, as the Arduino designs do.

This Atmel Application note also suggests the use of an external 10K pullup when an external reset switch is connected.
http://www.atmel.com/Images/doc8278.pdf
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

FestusHagen

The purpose of a tutorial is to educate, ambiguity causes misinformation, misinformation inhibits quality education.

One needs to be taught what is proper and correct, what one does from there is up to them.
If they were given the proper and correct information then they have the ability to make an educated decision as to their choices.

Personally, I do not accept mediocrity, close enough is not good enough.
Right is right, Wrong is wrong and if it ain't right it's wrong!

As for what I need ... I am certain y'all could answer that better then I without even knowing what I'm trying to do, I know very little about electronics at circuit level, but I'm gaining.

I have ordered according to the specs of the components CrossRoads linked, I suspect they'll work just fine.

Thanks y'all

-Enjoy
fh  : )_~

michael_x

The correct answer is : "In general it does not matter ..."
Although there's less ambiguity, it's definitely wrong to say " You need a 16MHz crystal of max 20 ppm, and capacitors of 20 pF with max 5% "

FestusHagen

Why would you say that is wrong?

In appearance it seems correct. (I don't have a clue if the numbers are technically correct . :( )

But those numbers would of had me on my way (blindly) without any need of assistance. (and IMO wasting y'alls time)

I really didn't have a clue that it was not that critical, I'm from a world where if it's a bit off, it won't work, period!

Thanks

-Enjoy
fh  : )_~

frank26080115

here's the math formula for the capacitor calculation you asked for earlier



it's from this page

http://www.oscilent.com/spec_pages/PNDescrpt/Load_Cap.htm
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Osgeld

Quote
Right is right, Wrong is wrong and if it ain't right it's wrong!


and the closer you get to zero the harder it is. Electronics is not perfect, and those cherry numbers in the datasheet will not match exactly whats in your hand, nor will it match the identical part in the other hand even if they are made one right after another... Depending on what degree of accuracy it will never be "right", it will be "close enough".

Its just one of those things you have to get, its always going to be a little loose when dealing with components, and while you can spend a ton of time getting everything exactly perfect, its not going to happen the next time you try it, even with the same parts! Due to wiring, materials, environmental factors and 3 particles of dust floating by neptune type stuff (again within you expectancy of accuracy)

Now I do totally agree with you with your points in regards to the tutorial, and your attitude to learn how to do it right is very commendable, Right IS right, Wrong IS wrong, BUT there is a big fat spectrum of grey as well. When your dealing with something measuring in one trillionth of a unit with a 15-20% tolerance, totally dependent on temperature, well its your sanity.
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

kf2qd

And close enough is close enough! Ever read the tolerances on some of your components? typically we use a resistor that is 10%, pay a bit more for 5% and a lot more for 1%. Capacitors can have tolerances like +10%, -50%.

While in the theoretical world it is easy to work with "ideal" components, out here in the real world we work with "actual" components. Don't have that 100 Ohm resistor, here's a 150, Yep, good enough for testing...

Tolerances - I used to be a machinist. we had tolerances on parts. Some guys would take all day to make a part that was dead on. I worked to the tolerances and could make 4 good parts that were all within tolerance and when installed no-one every knew the difference, except my 4 parts actually cost less because they took less time to make. Were they as good as the "perfect" part? as far as the machine was concerned they lasted just as long and did the same job as the other guys 1 part.

Good enough is generally good enough.

funkyguy4000


Do you absolutely need 16 MHz? You can skip both the crystal and resonator if you just ran on the internal 8 MHz resonator.

You don't need the 10 kilo-ohm resistor, there's an internal pull-up built into the ATmega already


Yes you do.
Even if you don't want your end deal to have the 16 MHz crystal and the 10K pull-up with it all the time, you do need them at one point.  Burning the bootloader.  Whether you are programming it to use the 8MHz internal clock, your arduino needs to have that external 16MHz crystal to burn the bootloader with.
Accelerate to 88 miles per hour.

frank26080115



Do you absolutely need 16 MHz? You can skip both the crystal and resonator if you just ran on the internal 8 MHz resonator.

You don't need the 10 kilo-ohm resistor, there's an internal pull-up built into the ATmega already


Yes you do.
Even if you don't want your end deal to have the 16 MHz crystal and the 10K pull-up with it all the time, you do need them at one point.  Burning the bootloader.  Whether you are programming it to use the 8MHz internal clock, your arduino needs to have that external 16MHz crystal to burn the bootloader with.


No you don't, from factory, the RC oscillator is the default oscillator
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

funkyguy4000

That is from factory though, Not from sparkfun that already has a bootloader on it. 
If you wish to use the bootloader, you need a 16MHz crystal during the burn.
Accelerate to 88 miles per hour.

Go Up