I have been made my first digital clock circuit, but it still not working. After I test many ways, I find the problem on the crystal.

The waveform graph of XTAL from my pcb enter image description here

And this is the correct waveform. enter image description here

This is my designed circuit enter image description here

This is my pcb layout enter image description here

I use Kicadv4.07 IDE to develop my project. Can anybody can solve this? I will appreciate your kindness.

  • 1
    \$\begingroup\$ You should be using ground pours. Using long traces for ground, especially on your crystal, will introduce a lot of noise \$\endgroup\$ – DerStrom8 May 15 '18 at 14:47
  • \$\begingroup\$ Can it totally fix this error without any side effect? \$\endgroup\$ – JK.Chen May 15 '18 at 14:54
  • \$\begingroup\$ I can't say for sure, but it definitely needs to be fixed regardless. \$\endgroup\$ – DerStrom8 May 15 '18 at 14:55
  • 4
    \$\begingroup\$ The first thing to do is to set the oscilloscope properly - in the first picture you have the scope set to 2 milliseconds per division - 50kHz sampling rate (20ns/500Ms/s in the second). You are greatly under sampling the signal resulting in aliasing. You will not get the correct waveform shown until you correct that. \$\endgroup\$ – Kevin White May 15 '18 at 15:51
  • 1
    \$\begingroup\$ Don't use the auto-scale button. You need to be smarter than the machine. \$\endgroup\$ – DerStrom8 May 15 '18 at 16:06

You should be using ground pours. Using long traces for ground, especially on your crystal, will introduce a lot of noise. I'm betting that's a large part of your problem.

See the following app note for PCB routing of a crystal oscillator:


Internal planes are highly preferred in designs such as this. These allow you to drop a couple of vias straight down to ground through a relatively low-impedance connection. This will minimize any noise and ensure your oscillator behaves as expected. If you absolutely cannot use internal layers (you are restricted to a 2-layer board) then basic polygon ground pours will suffice, but you must ensure they have low-impedance paths to the supply. If your pour necks down in areas or has long, roundabout paths to get back to the supply, then you'll still have issues with noise.

| improve this answer | |
  • \$\begingroup\$ I keep ground path shortest as far as possible? \$\endgroup\$ – JK.Chen May 15 '18 at 15:17
  • \$\begingroup\$ I don't understand what you are asking. You must keep your connections to ground as short as possible. \$\endgroup\$ – DerStrom8 May 15 '18 at 15:22
  • \$\begingroup\$ you mean the ground paths to get back to supply should be shortest? \$\endgroup\$ – JK.Chen May 15 '18 at 15:30
  • \$\begingroup\$ Yes, though the main concern is inductance. Short, narrow tracks have high inductance, whereas if you have an internal ground plane, that is much lower inductance. I HIGHLY recommend switching to a 4-layer board with internal planes. \$\endgroup\$ – DerStrom8 May 15 '18 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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