Go Down

Topic: which crystal (@16MHz) for the atmega328 (Read 5681 times) previous topic - next topic

sparkylabs

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 ?

majenko

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.

sparkylabs

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

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...

sparkylabs

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

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 ;)

dc42

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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

sparkylabs

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)

CrossRoads

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
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.

afremont

#9
Mar 29, 2013, 02:07 pm Last Edit: Mar 29, 2013, 02:11 pm by afremont Reason: 1

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 ;)


Humbug. :)  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.
Experience, it's what you get when you were expecting something else.

sparkylabs


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 ?

CrossRoads

"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.
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.

retrolefty



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

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.

CrossRoads

Nick Gammon has a nice sketch for reading the fuses

http://www.gammon.com.au/forum/?id=11653
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.

Go Up