Need help wich correct crystal placement for ATMEGA328P-AU

Hello.

I know this is a pretty trivial question but I'm new to building integrated circuits from scratch and I have a problem with a 16mHz crystal.

I'm currently designing a support board for a dvd player and I need help with the correct placement of the oscillator for the ATMEGA328P-AU.

I've seen a few different options online for connecting the oscillator to the arduino and I don't know which one to use/is correct for the ATMEGA328P-AU.

Below are 5 diagrams that I found, I would appreciate your help in choosing the right connection.

All arduino minis that I have in my collection have a connection to 1 ss, while boards with Atmega in IC package (standard) have the quartz connected differently. I would also like to find out what causes the differences in the quartz connection diagrams for Uno, Nano, Mega boards. I don't understand why each of these boards has the quartz connected differently to the IC.
I hope I described my problem correctly ;]
Regards!

The crystal for a a 28-pin ATMEGA328-PU goes across pins 9 and 10.

Because the pin numbers differs between different packages?

page 12

Btw, Mega is a different MCU.

ok I understand that other housings may have different leads, but that's not what I mean. I know which connectors on the Atmega it should be connected to. I mean what the circuit should look like before entering the IC.

See post #2.

ok so why are there no capacitors on arduino nano, why are they added on some pcbs, not on others like uno for example?

Are you aware you may not need an oscillator at all?

Very few projects need the extra speed of 16MHz. Almost all projects are perfectly ok with 8MHz and the atmega328 has an internal 8MHz oscillator.

A few projects need the extra timing accuracy that a crystal provides, but almost all do not need this.

So you may be able to simplify your project and also gain 2 more digital pins.

1 Like

ok I understand that it may have different pinouts, but why does the quartz circuit differ between the plates?

I've just heard that ATMEGA328P-AU can work without an external crystal.
Only from what I've heard I have to burn a bootloader for another arduino, I think attiny.
However since I've already scalped the original nano pcb from components I'll also press this crystal.
I'm interested in its correct implementation. I've already done a project from one of the YT-bers (portable soldering iron) and after putting it together the arduino worked at half power.
I wanted to avoid such things in the future that's why I'm asking you more experienced in the Arduino network :]

I take a guess it's Polish, but why?

1 Like

you guessed right.
sorry, I'm writing quickly at work xD
already corrected to English.

Going out on a limb here as I've generally used crystals and capacitors in my setups, but perhaps some of the differences you see may be because some designs use a ceramic resonator instead of a crystal.

I can't recall any of my projects using a Mohm resistor across the crystal either.

I can only speculate, so I prefer not to express such without looking more closely into the matter.

That's one of my speculations :upside_down_face:

I have now reviewed the original documentation from the arduino website and in the schematics between the arduino nano and uno, there are differences in the crystal circuit
(https://www.arduino.cc/en/uploads/Main/Arduino_Nano-Rev3.2-SCH.pdf
https://www.arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf
https://www.arduino.cc/en/uploads/Main/arduino-mega2560_R3-sch.pdf

From what I understood, none of the schematics have capacitors in the quartz circuit.

Nano has no resistor in the circuit, Uno has a resistor "before the quartz" and Mega has one behind the quartz, now I am a bit confused what and how to use xD

There are two different but similar components that can be used to control the microcontroller's clock frequency.

One is a 'crystal', these have a frequency tolerance of typically ±10 -50 parts per million. Crystals need two external capacitors to operate.

The other is a 'ceramic resonator', with a frequency tolerance of ±0.5% (= 5000 ppm)
The one used in the Arduino Uno R3 is a Murata CSTCE16M0V53-R0.
Ceramic resonators do not need external capacitors.

All your schematics show the symbol for a ceramic resonator (with integral capacitors).

The Arduino Uno R3 uses a (cheaper) ceramic resonator for the ATmega328P, but it also has a (more expensive) crystal for the ATmega16U2-MU(R).

The ATmega16U2-MU(R) needs to have the better tolerance of a crystal, as it is needed for the Serial UART timing.

As you only use a single ATmega328P-AU microcontroller in your circuit, and have RX and TX pins, you will need to use a crystal, plus 2 capacitors to get the required frequency tolerance.

1 Like

Some crystal cans contain capacitors, some Arduinos use resonators instead of crystals. Some Arduinos don't use an external oscillator or frequency determining element.

You have a great deal to learn before trying to "design" circuits.

1 Like

See this: ATmega328P Datasheet (from page 24)


About the resistance RF (the resistance in parallel with the XTAL):
For more information see the AN2867 application note attached here
an2867-guidelines-for-oscillator-design-on-stm8afals-and-stm32-mcusmpus-stmicroelectronics.pdf (3,0 MB)

1 Like

No, you must burn a bootloader for an atmega328 because you have an atmega328. A bootloader for another chip like an ATtiny would not work.

I would recommend this package of cores:

It includes a core which is suitable for atmega328 with no external crystal/resonator.

1 Like

It's because there's several different designs, different requirements for precision (An Arduino really doesn't need that high precision)

1 Like