Electronic – resonator or Crystal Oscillator for atmega2560

atmegacrystaloscillator

I've received the PCB that I have designed.

This PCB has an atmega2560 on it.

I have designed it to use a Crystal Oscillator such as this figure shows :
enter image description here

Is this designed supposed to work on an atmega2560 ?

Because, when I look at the schematic of the arduino mega, I see that they don't use a crystal oscillator, but they use a resonator with a 1M resistor :
enter image description here

Best Answer

I have designed it to use a Crystal Oscillator such as this figure [...]

Is this [...] supposed to work on an atmega2560 ?

Yes.

Using a crystal oscillator to provide the clock input, is shown in section 10 of the ATmega2560 datasheet (as you linked). It is also discussed in the Atmel Application Note: AVR042: AVR Hardware Design Considerations which I linked in an answer to one of your previous questions.

That application note also:

  1. highlights that PCB layout is important;

  2. discusses some of the differences between crystals and ceramic resonators, but doesn't focus on one of the main reasons why ceramic resonators are used - low cost!

  3. explains how to choose the values for the external capacitors used with a crystal; your schematic showing 22pF may or may not be optimal for your specific 16MHz crystal (check your crystal's datasheet for more information).

Note that the partial schematic which you included with the crystal oscillator, is not using the correct XTAL pin numbers for the ATmega2560 (as the text shows, the schematic seems to be for an ATmega16 etc.)

Also note that you need to consider which fuse settings to use - again, this is discussed in section 10 of the ATmega2560 datasheet.