1
\$\begingroup\$

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

\$\endgroup\$
2
  • 3
    \$\begingroup\$ Datasheet says? \$\endgroup\$ Commented May 6, 2016 at 23:59
  • \$\begingroup\$ Looks like a crystal oscillator can be used according the datasheet on page 41. But I would have liked to have a confirmation! I'm not used to work with crystal oscillators, resonators,... \$\endgroup\$
    – tuxben
    Commented May 7, 2016 at 8:53

2 Answers 2

3
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ okay, so both using a crystal or a resonator work for an atmega2560. Yes PCB layout is important, the clock source should be as close of the micro processor as possible. Yes I know the pins are not correct. Thank you for the reference to the section 10. For future readers, here are some links to know the difference between crystal, resonators,... electronics.stackexchange.com/questions/36308/… electronics.stackexchange.com/questions/86676/… \$\endgroup\$
    – tuxben
    Commented May 8, 2016 at 9:26
0
\$\begingroup\$

Datasheets says "Either a quartz crystal or a ceramic resonator may be used." so that answers perfectly my question ;) See section 10.4 of the full datasheet : http://www.atmel.com/Images/Atmel-2549-8-bit-AVR-Microcontroller-ATmega640-1280-1281-2560-2561_datasheet.pdf

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.