Swap resonator for crystal?

Very new to Arduino (haven't actually bought one yet), but I need one that's very small/light, so looking at the Pro Mini. However, I understand it uses a resonator rather than a crystal, and that may be a problem for what I will use it for. Can I just swap out the resonator for a crystal (same 16Mhz speed is fine)? If so, anyone know which size or model will fit? Electronics skills no problem :slight_smile: , just need to know if the Arduino prevents or makes it difficult for me to do this for any reason.

Thanks!

other than figuring out a way to cram in the caps for the crystal, I (in my limited knowledge of electronics) can't see why it wouldn't work...

You could use a 16MHz HC49S crystal, and you'll also need a pair of 22pF caps (one to ground from each side of the crystal). Should work just fine, no reason the Arduino wouldn't like it. That's how most Arduino models work anyway.

Jon
Freetronics: www.freetronics.com

Wouldn't HC49S be very large compared to the pads on the board? I should be able to find a physically smaller crystal to fit the pads (once I see exactly which resonator is on the board). Think I'll take the chance. Thanks.

They only Pro Mini (SparkFun) I know of already uses a crystal.

Really, that would be nice if it is. Yes, it's the Sparkfun one I'm referring to.

I just found this photo, and the 3-pin device should be a resonator... http://www.arduino.cc/en/Main/ArduinoBoardProMini

Sorry, my mistake! I just looked at my board and was going to correct myself. Getting a crystal and caps in there and making it look good will be a challenge.

Hmmm... should I roll my own then? I can get a PCB made relatively easily and an ATMega168 is less then $5 IIRC. I should have most of the other components already anyway. I really don't feel like buying a duemillanove and then having to chuck it in a drawer after a couple weeks.

I'm going to go search for available crystals first I think.

BTW, another thought -- will I need to make any code changes if I inject a 16Mhz clock into it (from an external board)?

you will have to change the fuses to use an external clock

I just found this photo, and the 3-pin device should be a resonator...

Perhaps you shoulld ask Sparkfun for a link to the datasheet to see if what you intend to replace the part with is actually better. These tiny resonators as used on the pro Mini are available with 0.02% accuracy and excellent temperature stability.

Another option (depending on your application) is to source one of the unused timers on the AtMega with an external clock.

Can I ask why you need a crystal instead of the resonator?

Is it an accuracy problem? It is true that resonators tend to be less accurate, but IIRC it's not much.

(1) Quartzes are fine, I use HC46U types which are reasonably small. SMD types can also be used, it is not really difficult to solder them...
They come in sizes of 2,5x3,2mm (ceramics) or 2,5x2 mm. However they are considerably more expensive than THT quartzes or resonators (> $1)

(2) Resonators are no longer less expensive than standard quarzes; they do not need additional capacitors, however they cannot be produced to such a precision as quartzes. With the possible exceptions of high price types they are susceptable to changing temperature and age....

I did ask Sparkfun for the datasheet ... waiting on a response to that.

I intend to accurately time some pulses from various sources, and from past experience (PIC stuff), I know that resonators have not been able to handle the precision I need. I will admit though, that I've been using a Murata resonator lately that works decently with 0.2% error. Let's see what Sparkfun says that they're using, and I'll be able to better determine what alternatives will fit.

BTW, as a reference, one of the crystals I use regularly is accurate to 30ppm (0.003%), which can serve as a decent timebase directly w/o the need for a 32.768khz watch crystal.

how about using internal oscilator? you have to change fuses and thats all, no need of external cristal, 8mhz is no so bad :slight_smile:

The internal oscillator is even less accurate than a resonator!

If power consumption is not a big issue, you can get some very small crystal oscillator modules. Since the oscillator circuitry is internal, they wouldn't be as sensitive to "rework" style wiring.

If you want accuracy, you should really use a OCXO or at least a TCXO.

The internal RC oscillator is tuned through the calibration bytes. I did not much checking but a small investigation some years ago showed a very good accuracy (<1%). However stability WRT temperature is not so good....

As a rough rule-of-thumb, the internal oscillator would be good for about 1% (if calibrated), a resonator 0.1%, and a crystal 0.01%