Fail Of The Week: Never Assume All Crystals Are Born Equal

You should be used to our posting the hacks that didn’t quite go according to plan under our Fail Of The Week heading, things that should have worked, but due to unexpected factors, didn’t. They are the fault, if that’s not too strong a term, of the person making whatever the project is, and we feature them not in a spirit of mockery but one of commiseration and enlightenment.

This FOTW is a little different, because it reveals itself to have nothing to do with its originator. [Grogster] was using the widely-available HC-12 serial wireless modules, or clones or even possibly fakes thereof, and found that the modules would not talk to each other. Closer inspection found that the modules with the lack of intercommunication came from different batches, and possibly different manufacturers. Their circuits and components appeared identical, so what could possibly be up?

The problem was traced to the two batches of modules having different frequencies, one being 37 kHz ahead of the other. This was in turn traced to the crystal on board the off-frequency module, the 30 MHz component providing the frequency reference for the Si4463 radio chip was significantly out of spec. The manufacturer had used a cheap source of the component, resulting in modules which would talk to each other but not to the rest of the world’s HC-12s.

If there is a lesson to be extracted from this, it is to be reminded that even when cheap components or modules look as they should, and indeed even when they appear to work as they should, there can still be unexpected ways in which they can let you down. It has given us an interesting opportunity to learn about the HC-12, with its onboard STM8 CPU and one of the always-fascinating Silicon Labs radio chips. If you want to know more about the HC-12 module, we linked to a more in-depth look at it a couple of years ago.

Thanks [Manuka] for the tip.

23 thoughts on “Fail Of The Week: Never Assume All Crystals Are Born Equal

    1. It gets even worse when you are sent two identical ICs that appear at first glance to be the same until you actually physically disassemble them or do things like x-ray type diagnostic work and realize that they actually functionally differ in all sorts of strange ways. Typically because corners have been cut, ranging from slightly to completely egregiously and everything in between.

      A home based maker could theoretically do this work but it’s certainly not very common to be able to do so.

  1. Nice write-up, the forum is a bit of a long read. I’m sure this would have had me stumped for a while too.

    37kHz at 433MHz is about 85ppm, while many crystals are often specified as 10/20/30ppm (even the cheap ones on Farnell). Obviously, 85ppm is out of spec for those, but if we don’t know the exact make and model of the crystal, we don’t have a datasheet so can’t determine if it fails. For most applications, 85ppm would probably be acceptable, just not this one.

    I wonder if those chips have a trimming function? Maybe they do, and the new ones simply aren’t trimmed properly?

    I guess this proves, once again, that you shouldn’t get your parts “cheap from China” if you want them to be reliable. Of course, I also get parts from eBay/Aliexpress etc. for hobby projects, and this happens once in a while.

        1. Because RC oscillators are generally specified as +/- 1% accurate (example: STM32F0), which is 1000ppm, or about 12 times worse than these crappy crystals. Also, they tend to drift a lot more over temperature than even the crappiest crystals you can find.

          1. Many USB devices these days can derive an accurate timing signal from the USB host and use that to calibrate its on-board oscillator to high accuracy, so you don’t need an accurate crystal in these applications.

          2. I believe that RC oscillators also have much worse phase noise than even the cheapest crystals, which is not a desirable property when you’re multiplying the frequency up and then using it as the reference for any kind of RF receiver or transmitter.

  2. Publishing fails is indeed of great merit. The book, “the Art of Electronics” had a “bad circuits” section at the end of each chapter in the older editions. Removing this (along with the examples of good circuits) in the current edition can only be viewed as a sort of crime against humanity. There is as much or more to be learned from studying mistakes as from studying successes.

    1. I can see why they took it out. It was just a bunch of circuits and you were left on your own. The editors probably said “for each bad one, add a good one so to help guide readers along the right path” and then H&H were like — “too much work, just ditch the whole section, it was just a cute afterthought anyway”.

      But… a whole book with bad circuits / good circuits would be a great idea for like a college engineering lab workbook or something. It’d be fun to build up all of the bad circuits and see where they go wrong first-hand. I guess you could sim it too, if your tastes run in that direction.

      1. Rudolf Graf seemed to make a living out of writing books by stuffing them with circuit diagrams and no descriptions other than titles. The annoying part was… they were seldom validated and some were just bad… it was just left up to you to figure it out. A missed book idea… “These don’t work… and here is why”.

        1. Lee De Forest apparently would assemble “circuits” with random parts and quickly patent them in the event that someone would find one useful and De Forest could claim royalties.

    1. +1

      An improperly loaded crystal will exhibit both an off frequency as well as an off amplitude. Simply changing the loading capacitance (did I read this can be done in software?) may bring the frequency back into spec. This is an easy mistake to make, even for professional designers.

  3. I wouldn’t assume that it is a crystal. We are talking about “Made in China” here.

    It makes no economic sense to make a crystal oscillator with this level of inaccuracy and yet maintain such a level of consistency.

    [Grogster] has not only demonstrated that “what ever it is” is inaccurate. He has also demonstrated that even with inaccuracy, the devices still need a level of consistency to work.

    In manufacturing the cost of accuracy is far greater than the cost of consistency.

    For example, if you look at an Arduino Uno, you will see that a crystal is used for the USB to serial bridge. If you look at the footprint for the MCU (ATmega328) oscillator you will see the markings and pads for a crystal but the component is much smaller than you would expect. It’s not actually a crystal as many assume. It’s a ceramic resonator which is much cheaper to manufacture than a crystal but not as accurate.

    On a side note this is important if you build custom Arduino circuits and use a crystal as the config settings are different for a crystal compared to a ceramic resonator.

    From a manufacturing point of view, if some level of inaccuracy is acceptable and some level of consistency is required then the obvious economic choice by far would be a ceramic resonator. Ceramic resonators also require less drive current and that would make even more sense for an oscillator block as ceramic resonators require less drive current making the associated drive circuit cheaper as well.

    I wouldn’t be surprised if you were to open up the so called “crystal oscillator” that you would find a “ceramic resonator” in there as a substitute for a more expensive “crystal”.

    1. That’s actually a problem that exists with the Mega. Using them as a telescope command system, they and ramps look ideal initially, but The lack of a crystal is a hidden issue in most arduino programs. Usually, you can also sync in some way with the sensor/motor you are controlling.

      “We often need to address the Mega2560 resonator clock’s poor accuracy (add a PPS pulse-per-second source). There are two solutions for this: Add an RTC the DS3234 RTC (a bit more expensive), and the DS3231 (cheap). The former has support in versions 1.1.f and later. The latter is supported in version 1.3.a and later. Another option is to find a Mega2560 with a crystal oscillator (such as the MKS Gen-L all in one board).”

  4. This may have been a problem for me 12 years ago when using two sets of ‘identical’ Tmotes from the defunct Moteiv that wouldn’t reliably talk to each other. Never solved it.

  5. 5.5. Crystal Oscillator
    The Si446x includes an integrated crystal oscillator with a fast start-up time of less than 250 µs. The design is
    differential with the required crystal load capacitance integrated on-chip to minimize the number of external
    components. By default, all that is required off-chip is the crystal. The default crystal is 30 MHz, but the circuit is
    designed to handle any XTAL from 25 to 32 MHz. If a crystal different than 30 MHz is used, the POWER_UP API
    boot command must be modified. The WDS calculator crystal frequency field must also be changed to reflect the
    frequency being used. The crystal load capacitance can be digitally programmed to accommodate crystals with
    various load capacitance requirements and to adjust the frequency of the crystal oscillator. The tuning of the crystal
    load capacitance is programmed through the GLOBAL_XO_TUNE API property. The total internal capacitance is
    11 pF and is adjustable in 127 steps (70 fF/step). The crystal frequency adjustment can be used to compensate for
    crystal production tolerances. The frequency offset characteristics of the capacitor bank are demonstrated in
    Figure 15

  6. Back in the early days of internet, we had a production run of Ethernet boards fail conformance testing at a customer (IIRC, they WORKED, they just failed testing) because someone had ordered “series resonant” instead of “parallel resonant” crystals, or something like that. There’s also a wide variety of different load capacitances available for many crystal frequencies, even in identical-looking packages. I think it’s more likely that there was a mismatch between the expected crystal and actual crystal parameters (in SW, apparently!) than that the crystals were all 85ppm off-spec.

  7. Same issue with CC1101 modules I have, though they have a programmable frequency offset that solves the problem. One module has an offset of -23 units while another is +2, relative to my “base station”.

  8. Crystals also come in series or parallel capacitanceloading and it you use a series capacitance crystal in a parallel capacitance circuit ( or vice versa) you are going to have a significant change in the rated frequency.

    Sounds like a case of Beancounter Engineering where some business degree Beancounter made a decision based on cost rather than engineering knowledge and bought the wrong crystals

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.