I have made a custom board with Atmega2560.
I had used a crystal by Murata (XRCGB16M000FXN16R0).
The board works fine till now with respect to the functionality that I am using, toggling some GPIOs and RS232 communication.
The problem is that the clock level peak to peak is very low (around 22mV p-p) as compared to clock level on Arduino Mega board which is around 78mV p-p. Also the clock doesn't look as clean as the one on Atmega2560.
I used this crystal as the generic crystals do not work till -30 degree Celsius according to the datasheets.
My question is, although it is working right now, should I be worried and should I change it in the next revision to another Oscillator? Or is it normal?
Can the difference be related to the capacitance C1 and C2 of the xtal circuit?
The load capacitance of the crystal I used is around 8pF, whereas the generic crystals have load capacitance around 18pF. But I have used the same 22pF caps as in other standard designs. Can it contribute to this issue?
(The cleaner clock is the one from Arduino Mega board)
It can be an issue with the crystal. Capacitors can contribute to the problem but not so significantly. Capacitors can more affect the frequency. I would use recommended value.
You have just crystal and capacitors on the XTAL pins, rigth?
It can be also in soldering like cold junction or long/unsuitable paths.
Maybe you could post the schematics and the board picture.
There is a fuse to set the "full swing". That helps in a noisy environment.
As far as I know, the capacitors are not very critical, but the grounding is.
Sometimes a mistake is made with the ground-return of the capacitors. They should not be connected to just any ground, but to a ground that goes directly to the ATmega2560 chip.
The MCU seems to be soldered nice. I cannot say it about C6-C8 but the photograph is not so sharp. Soldering the crystal is not so trivial. Make sure it is soldered good.
Paths are short enough, schematics seems to be correct.
Check the GND as @Koepel wrote and make sure the measuring you did correctly.
At this moment, I would try to replace the XTAL e.g. with the big one with the legs. The signal should be at least approximately square, yours is not even close.
@Budvar10, the low power oscillator mode is not square. I tried to find scope screendumps, but I could not find it.
@mohitsingh2806, do you have just one Arduino board ? You should test a few cheap clones to see how good or bad they are. With the low power oscillator mode, the signal is influenced by the probe of the scope.
Thanks Budvar10 and Koepel.
As suggested my plan is to first try the "Full Swing" mode. Then I will probably try to change the capacitor values and check. I trust the soldering to be correct as it was done by a professional assembly house.
In the end I may replace the crystal if nothing works, but still I hope I can find out the reason for this behavior before changing the part. I will study some more and some experiments and check.
I will update here if I find something useful.
As suggested my plan is to first try the "Full Swing" mode.
Just an update. Doing this did not change anything except the DC bias of the clock
Another Update:
I referred this to calculate C1, C2 values for my crystal.
A better rule of thumb is: C1, C2 = 2CL – 2Cstray
With CL = 8pF, and stray capacitance of around 5pF(assumed), C1 and C2 come out to be 6pF.
I was using 22pF. So, I removed the capacitors altogether just as an experiment as there will be some capacitance anyways due to stray capacitance of the PCB.
But, after removing C1 and C2 my problem did get solved. So it was afterall, a problem of wrong selection of capacitors. I will put 6pF capacitors as soon as I get them. I have ordered them already.
Check out the clockout after removing the capacitors.