Back to Basics: Crystals, Oscillators and Resonators

You see crystals on most circuits out there to provide accurate timing functionality to a microcontroller. Some people mistake them for devices which provide square wave “clocks” to uCs. That is not true. Quartz crystals are piezoelectric materials which can exhibit mechanical resonance. The frequency of the vibration of the crystals can be fine-tuned to a range of values out there by altering the mechanical shape and size of the crystals. Think of them like tuning forks which can be varied in size to create their desired tuning frequency. They are just passive devices which can vibrate when energy is given to them. The electrical equivalent circuit of a crystal consists of an RLC circuit with 2 resonance frequencies.

In most uCs, you have the option to connect these crystals next to the chip and these pins feed to a feedback amplifier. External Crystal + Internal Amplifier together gives you a Pierce oscillator generating an accurate waveform which is further fed to subsystems for generating your square wave clocks for timing. In most cases, you would have to add a couple of load capacitances to ground for these crystals to get the accurate freq. Do refer to the datasheets of devices to calculate these ones. Atmel has an excellent tech note on it. Startup is another consideration. It’s the time needed for an oscillator to start producing the freq at the correct amplitude after power-on. Think of it as a feedback amplifier initially taking noise as input and taking a few milliseconds to get to its steady state of actual output freq. This has high implications in low-power circuits where you want to conserve every bit of power during turn ON.

You also get oscillators as standalone chips which can be used to directly connect to your micro bypassing the internal amplifier by changing software fuse settings in the uCs. You also have something known as ceramic resonators. These are similar to quartz crystals but made of ceramic material and can also be tuned to a range of frequencies. It’s cheaper but poor Freq accuracy. Deviation of 10-50ppm for quartz & 5000ppm for ceramic.

If you liked the post, Share it with your friends!

PCB Calculators

While designing PCBs there are a lot of parameters one needs to account for. That’s where standalone calculators(and some online ones) really shine. One of the best ones out there in the freeware domain is PCB Toolkit by SaturnPCB. I have been using this for years now. It’s a stunning bit of software which contains so many calculators rolled into one. You have an impedance calculator for figuring out the width of trace in PCB for the desired impedance profile, you have a differential pair calculator to fine-tune your target impedances for differential high-speed traces. Via & Current rating calculators to size out your current tracks based on thermal and current carrying capabilities. Beyond that, they have lots of smaller measurements which makes it a one-stop option rather than Googling each time. Try it out, there are too many to explain in detail.

How accurate are these calculators? There are usually able to give you a near good enough value as it’s mostly coded up based on equations. You will see definitely slight variations in real life. It won’t probably give the accuracy of very expensive simulators out there but it’s good enough.

BTW KICAD PCB software also has a few built-in PCB calculators, it’s not that extensive though.

Would love to hear about any other PCB/EE calculators that you use in your workflow.

If you liked the post, Share it with your friends!
1 26 27 28 29 30 58