which crystal (@16MHz) for the atmega328

I'm planning on getting some atmega328's and crystals for standalone chip solutions. Anyone know which crystals are best to use and which type the arduino bootloader is setup for ?

Do you mean 16MHz Quartz Crystal Resonator without integral load capacitors (the traditional "crystal" that you find in a metal can), or a Crystalline Ceramic Resonator with integral load capacitors (the kind you have on a typical UNO board, and has 3 pins)?

They are both 16MHz, and they will both work. It's just all a question of accuracy (and repeatability of that accuracy). The Arduino neither knows, nor cares, which you are using.

The quartz crystal is far more accurate, with far greater temperature tolerances than the ceramic one. If timing is important to you, then go for quartz. If you want them dirt cheap, go for ceramic.

Also, with the quartz one you will need to provide the correct load capacitors to go with it.

Personally I never use the ceramic ones - I was brought up on quartz crystal resonators.

Well knowing that there are different options on types and that each have settings if you rpogram the avr in c I wondered which one the arduino is setup to use by default. Most of my projects are not time critical so I guess whatever is cheaper.

The schematic of the uno shows a quarz and two loading caps

All the fuse settings are detailed in the boards.txt file in the IDE. You can translate those hex values to actual fuse settings and see what is what if you really need that kind of detail.

And of course you can always change said fuse settings...

ah I didn't realize I could change the fuse settings. What do I look for in a ceramic resonator for the ATmega328 ?

Price, size, ease of use / mounting, etc. No need to worry too much about accuracy when dealing with ceramics, as they'll be pretty poor :wink:

If you are after minimum size and/or minimum component count and you can live with a clock frequency error of up to 0.5%, go for a 3-terminal ceramic resonator. If you want better accuracy, go for a parallel-resonant 16MHz quartz crystal and 2 capacitors.

well lets face it most applications can cope with 0.5% error. only clock type uses will need better (yes i'm currently designing another clock job to make a clock work and i'm using a clock crystal and old fashioned counters)

I use these from dipmicro, or the equivalent from mouser, digikey, taydaelectronics, or surface mount parts as needed:
http://www.dipmicro.com/store/XC7-16000
http://www.dipmicro.com/store/C1K22-50

majenko:
Price, size, ease of use / mounting, etc. No need to worry too much about accuracy when dealing with ceramics, as they'll be pretty poor :wink:

Humbug. :slight_smile: I have two "made in Italy" Uno boards with ceramic resonators on them. One is off by less than 50ppm, the other is off by ~300ppm at 23C.

EDIT: Changed Hz to ppm, oops.

majenko:
All the fuse settings are detailed in the boards.txt file in the IDE. You can translate those hex values to actual fuse settings and see what is what if you really need that kind of detail.

And of course you can always change said fuse settings...

So potentially I can change clock sources and speeds ?

"I can change clock sources and speeds"
Yes you can.

Look at the boards.txt file for 8MHz Promini vs 16 MHz Promini.
The change is very small.

sparkylabs:

majenko:
All the fuse settings are detailed in the boards.txt file in the IDE. You can translate those hex values to actual fuse settings and see what is what if you really need that kind of detail.

And of course you can always change said fuse settings...

So potentially I can change clock sources and speeds ?

Just keep in mind that just changing the values of the fuse bytes in the board entry of the boards.txt file does not by itself burn the changed value on the chips, you must perform the burn bootloader operation that will update the fuse bytes and burn the bootloader on the attached board via the selected hardware programmer.

Lefty

So i'd need to use the AVR programmer to redo the boot loader, A pity that file is not a bit easier to read. I don't need to worry about that anyhow yet.

Nick Gammon has a nice sketch for reading the fuses

sparkylabs:
So i'd need to use the AVR programmer to redo the boot loader, A pity that file is not a bit easier to read. I don't need to worry about that anyhow yet.

Yes you need one of the six 'hardware programmers' supported by the IDE, but keep in mind that one of the programmer types is simply an arduino board running the arduinoISP sketch and wired properly to the target AVR chip or board.

Lefty