Is a resonator/crystal needed for 8MHz?

I recently built an Arduino clone with an Atmega328 and it seems to be working nicely. Now I am thinking about a 3.3V version. From what I can see, I have to run it at 8MHz. My question is should I use the internal 8MHz oscillator or use an external?

I am looking at an ABL-8.000MHZ-B2 datasheet. I have some 22pF caps I was using on the 5V. Can I use those on this too? The data sheet says, "Load Capacitance 18pF", so I guess I should use 18 instead? Or is 22 close enough?

Alternately, I was thinking about an external resonator. Is that any better than the internal? I am looking at AWCR-8.00MD datasheet. However, for 8MHz, this datasheet lists Vdd at 12V! So is that 12V max, or 12V period no discussion?

You should probably just use the internal clock. You'll have to adjust the fuse settings to select that instead of the normal Arduino crystal/resonator. You'll also want to set the processor clock rate so the timers work properly. The fuse and clock settings are in 'boards.txt'

johnwasser: You'll have to adjust the fuse settings to select that instead of the normal Arduino crystal/resonator. You'll also want to set the processor clock rate so the timers work properly. The fuse and clock settings are in 'boards.txt'

Thanks. Right, so if I understand correctly, I can simply choose the right setting from the Tools > Board menu? It looked like I would go with "Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ ATmega328". That seemed to describe this setup pretty well. Although this will be the first time I'm deviated from Duemilanove, so I want to make sure to get it right.

Internal Oscillator; Factory ... ±10% (serial communications is troublesome past ±4.5%) Internal Oscillator; Tuned ... ±1% Resonator ... 0.5% Crystal ... 100 ppm

A nice overview... http://www.maxim-ic.com/app-notes/index.mvp/id/2154

How accurate does your processor clock need to be?

[quote author=Coding Badly link=topic=55945.msg400944#msg400944 date=1300645834] How accurate does your processor clock need to be? [/quote]

Thanks! This is great information!

For prototyping, timing isn't usually a big deal, but I definitely need serial communication. So that means untuned internal is out. How do I tune it?! 1% looks a lot better.

But for applications that run full-time, even 0.5% sucks, that's 50 minutes a week. For those, maybe 5 minutes a week would be OK, which is about 500 ppm. Looks like I have the answer, thanks!

maniacbug: Thanks! This is great information!

You are welcome!

How do I tune it?!

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287558192

The current release directly supports ATtiny84 and ATtiny85 processors. I have a version that directly supports the ATmega168 and ATmega328 processors but I have not bothered to publish it. If you decide to use it, let me know and I'll publish an update for 168 / 328 processors.

Looks like I have the answer, thanks!

External crystal?

[quote author=Coding Badly link=topic=55945.msg400989#msg400989 date=1300650214] External crystal? [/quote]

External crystal for standalone permanent installations. For prototyping, either tune the internal or just use a crystal for everything.

[quote author=Coding Badly link=topic=55945.msg400989#msg400989 date=1300650214] http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287558192 [/quote]

Aha, so I looked into this. There's a register for it, OSCCAL! Handy. Ok, I'm sure I can figure out how to obtain the value for it. The trick is this, at some point you say, "Modify the bootloader to load the OSCCAL register". That's the scary part that I have not gotten anywhere close to.

I can't imagine it's worth rolling my own bootloader right now just to avoid an external clock, so I may just stick with the crystal.