At which frequency is more stable?

Hi everyone,
does changing ATmega328p frequency affect the stability of the microcontroller ?
My microcontroller is stopped sometimes because of EMI from nearby electrical components like contactors or main voltage regulator.
So, does changing frequency from 16MHZ to 8MHZ improve the stability ?
and what is the Appropriate capacitors value should I connect to 8MHZ crystal ?
I'm using 22pf
Thank you

you'd be better off to consider EMI Shielding like a metallic screen that surrounds sensitive electronics

1 Like

The official Arduino Uno (and Nano and other boards) are well designed. They are reliable.
The cheap Uno clones sometimes barely work, because there is so much noise on the board.

Please show us the schematic, pcb board layout and a photo.
Using 16MHz or 8MHz should not matter. It is most likely the overall noise in your circuit.
It is very easy to build a circuit with a ATmega328P that stops working with the slightest electric noise from outside.
You need enough decoupling capacitors and the crystal with 22pF should be close to the ATmega328P chip. Some forget that the GND path from the 22pF should be short and should go directly to a GND pin of the ATmega328P. I read on this forum that a lower value for the 22pF is sometimes better. The Arduino software uses a low swing voltage for the crystal as default. You can change a fuse for the full swing. I had to do that in one of my projects in the past.

There is a lot that can be done, but the start is always decoupling capacitors.

Then there is the subject of grounding. That is a craftsmanship on its own. If nearby electrical components can somehow reach the GND of the Arduino, then everything can go wrong. A path from the electrical components can go via the mains, via a adapter, and into the Arduino board.

Only if you pick a frequency too high for the chip and the supply voltage. You are seeing EMI affecting your circuit which is nothing to do with clock speed.

22pF is fine for most microcontroller crystal oscillators as far as I know - you really need to read the datasheets for the chip and for the particular crystal to be sure but its likely to just work fine.

Don't confuse a ceramic resonator with a quartz crystal though, ceramic resonators come with built-in capacitors.

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