Arduino Crystal oscillator vs ceramic resonator

hi,
I have a little confusion related to the Arduino UNO crystal oscillator and ceramic resonator.
Which is the clock source for 328p among these two and what is the purpose of using these both?
does ATMEGA328p have an internal hardware clock?
Any documents related to this would be good.

Either can be a clock source. BUT see reply from @sterretje below if i've misunderstood your query.

I think that is simply down to giving the designer a choice of clock source.

Yes, there is an internal 8MHz clock source but it may need calibrating depending on your application.

The 328P datasheet?

The crystal on an Uno board is for the TTL-to-USB converter (e.g. 16U2) as that requires a more accurate clock. The ceramic resonator is for the 328P and is used as it's cheaper than a crystal.

Yes, see the datasheet.

in normal conditions does Arduino use 328p internal clock?
can we disable 328p internal clock?
Also, like the resonator is crystal oscillator is also connected to the Atmega328p clock pin.

The clock source is determined by the setting of fuse bits. These select either internal clock or external clock (various options).

The datasheet will explain how the clock sources are configured and/or selscted.

1 Like

No, when the bootloader is burned (in the factory), fuses are set to use the external clock.

See above.

The crystal (not crystal oscillator) on a Uno is not connected to the 328P. See schematic https://content.arduino.cc/assets/UNO-TH_Rev3e_sch.pdf

1 Like

Are you asking just for background or do you have a specific requirement?

Might be worth noting that other Arduino boards use crystal oscillators for the processor too. I have come across one library for DCF77 decoding that requires a quartz clock for stability because it can cope with a noisy signal, whereas another DCF library does not require quartz stability but is much less tolerant of noise. In my application I had a very clean DCF signal so I use the second.

It depends on what you mean by "internal clock" and "normal conditions. From the Microchip factory, the system clock comes from the internal "RC" (Resistor Capacitor) Oscillator (8 MHz) and the programming fuse to initialize the clock prescale to 8 is set so the chip runs at 1 MHz.

When the fuses are set as part of burning the Arduino UNO bootloader, the chip is set to expect a crystal or resonator on the XTAL1 and XTAL2 pins and the prescale of 8 is turned off.

It depends on what you mean by "internal clock".

If you want to use an external oscillator you would connect it to the XTAL1 pin.

Crystals typically have accuracy of 100-200 parts-per-million. The crystal in a watch is (somehow)
"trimmed" for better accuracy.

Arduino's resonator CSTCE16M0V53-R0 is +/- 0.5% (5000 ppm).

1. At the top-left corner of the following diagram (Fig-1), you can see the options to run ATmega328P using internal 8 MHz clock or external crystal/resonator controlled 16 MHz clock.


Figure-1:

2. The option is made by the fuse bit (Fig-2) -- CKSEL3:0.


Figure-2:

I'd be a bit shocked by a crystal that was only made to 200 ppm!

Aerospace Manufacturing, Oscillators, OCXO & VCXO Suppliers - UK - these ones in AT cut do 50ppm and can do better. If frequency is critical usually a trimmer capacitor is fitted to set the frequency precisely.

A watch crystal is made more accurate and also trimmed by adding caps; and often the watch circuit digitally compensates for a measured error. These ones do 20ppm before trimming. Aerospace Manufacturing, Oscillators, OCXO & VCXO Suppliers - UK

Error is: (200/1000000)*100 = 0.02%. Is it not good enough for the timings signals to be generated by the TC Modules of the MCU of the UNO Board?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

Those devices have a transistor and a crystal all in a single device. And perhaps the capacitors, as well. Saves manufacturing costs.

If you want to communicate with a particular member, you can send a private message via the forum.

You can choose either a quartz crystal, or a ceramic resonator for your custom design. The UNO R3 has the resonator you describe, many clones have a superior quartz crystal. Which one would you actually prefer?

On your breadboard, you have a through hole PCB part which is quite large, but you can easily purchase a surface mount SMD quartz crystal that is not very much larger than the resonator. Size is not a real issue here.

Here is the resonator:
https://www.digikey.com/en/products/detail/murata-electronics/CSTNE16M0V530000R0/8747729
Here is the quartz:
https://www.digikey.com/en/products/detail/transko-electronics-inc/CS22-F1010FM10-16-000M-TR/16836175

That should be on the BOM (Bill of Materials). I didn't look to see if one is provided, but that is the standard place for full component information.

There are several ways to clock the MCU, you don't have to copy exactly what Arduino did. The standard configuration uses either a quartz crystal or resonator circuit. Both are used in millions, and thousands of other devices, respectively, so if the information isn't available at Arduino, it's not a big problem.

Cast your net wider.

I recommend using the quartz crystal, it's far more accurate. The cost difference is negligible, many clones substitute a quartz crystal.

@john35S,

I have merged your new replies to this topic into the topic itself. If you want to reply to an old topic please ask the mods to open it, please don't create a new topic.

Thanks.

John, you will have to match the board revision number to a specific schematic and bill of material. Things change over time. The cost to manufacture a printed circuit board is based on the number of component placements. For low volumes, the cost may be $1.00 per placement. As you can see, a single placement is a LOT cheaper than placing 5 or 6 components.

It's not impossible that, you could obtain all the information on the specific part and even manufacturer, and place it on your specific PCB. Then find out it doesn't behave exactly as the Arduino PCB, because of impedance differences on the board due to layout.

I provided a link to a list of resonators, you can compare and see which one comes closest to the Arduino one. But for supreme confidence, you need to do your due diligence and execute a comprehensive design process, verifying each part in your design by comparing your expectations with the listed specifications.

Don't believe that just because you have the exact same part, it will behave the exact same way, in a different design.

Another way to say this, I think I repeat myself, don't obsess over copying it. Look at the specifications and make a decision.