{"docs":[{"id":126,"title":"Clocks and Crystals: Getting Oscillators Right on Embedded Boards","heading":"Clocks and Crystals: Getting Oscillators Right on Embedded Boards","subheading":null,"category":"Hardware Design","body":{"root":{"type":"root","children":[{"type":"heading","tag":"h3","version":1,"children":[{"type":"text","text":"Getting the numbers right","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"With two equal load capacitors, the crystal sees them in series plus the stray capacitance of the pins and traces: CL = C/2 + Cs. Rearranged, each capacitor is 2(CL - Cs). Stray capacitance is commonly a few picofarads; the microcontroller datasheet often gives its pin capacitance.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"For margin, oscillator application notes commonly recommend that the oscillator’s negative resistance be at least about five times the crystal’s maximum ESR. Also check that the crystal’s ESR and drive level are within the limits stated for the microcontroller’s oscillator.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"tags":"Embedded Hardware, Clocks, Oscillators","cardCta":{"label":null,"link":null},"pageCta":{"label":"Talk to AAVICO engineering","link":"/contact"},"excerpt":"A crystal that starts reliably on the bench and fails in the cold is a classic field problem. Load capacitance, oscillator margin and layout prevent it.","featuredImage":null,"type":"Blog","readTime":"3 min read","publishedAt":"2026-11-15T22:25:00.000Z","heroImage":null,"introText":"Almost every embedded board has at least one crystal, and most work first time. The ones that do not are hard to diagnose: a clock that runs slightly fast, a radio that will not hold a link, or a board that occasionally fails to start at low temperature. These problems come from a small set of causes, chiefly load capacitance, oscillator margin and layout. This article covers each, with the arithmetic needed to get them right.","metrics":[{"id":"clocks-and-crystals-getting-oscillators-right-on-metric-1","value":"32.768 kHz","label":"Equal to 2^15 Hz, so fifteen divide-by-two stages give exactly one pulse per second.","icon":null},{"id":"clocks-and-crystals-getting-oscillators-right-on-metric-2","value":"±20 ppm","label":"A common crystal frequency tolerance at 25 °C; tighter grades are available.","icon":null},{"id":"clocks-and-crystals-getting-oscillators-right-on-metric-3","value":"1.73 s/day","label":"The timekeeping error from a constant 20 ppm offset: 86,400 seconds times 20 ppm.","icon":null},{"id":"clocks-and-crystals-getting-oscillators-right-on-metric-4","value":"2(CL - Cs)","label":"The value of each of two equal load capacitors for a crystal with load capacitance CL.","icon":null}],"gallery":[],"challenge":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"A crystal is specified at a particular load capacitance. If the board presents a different load, the crystal still oscillates but away from its nominal frequency. For a real-time clock that means drift; for a radio or USB interface it can mean a link that fails at the edge of its tolerance.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Oscillator margin is the less visible risk. The oscillator must supply enough gain to overcome the crystal’s resistance with plenty to spare, or start-up becomes slow and unreliable, usually worst at temperature extremes.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"blockquote":{"quote":"Treat the crystal and its capacitors as one tuned circuit, and size the capacitors from the arithmetic, not from the last board.","author":"","role":"AAVICO Engineering"},"supportImage1":null,"deliverables":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Pick the crystal from the microcontroller vendor’s recommendations, or check its ESR, load capacitance and drive level against the oscillator specification.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Calculate the load capacitors from CL and an estimated stray capacitance, and record the assumption.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Place the crystal close to the pins with short traces, a ground guard and no signals routed underneath, then measure the frequency on the first boards.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"results":[{"id":"clocks-and-crystals-getting-oscillators-right-on-result-1","title":"Accurate Timekeeping","description":"Correct loading keeps the frequency near its nominal value."},{"id":"clocks-and-crystals-getting-oscillators-right-on-result-2","title":"Reliable Start-Up","description":"Adequate margin starts the oscillator at every temperature."},{"id":"clocks-and-crystals-getting-oscillators-right-on-result-3","title":"Interface Compliance","description":"USB, CAN and radio links stay within their clock tolerances."},{"id":"clocks-and-crystals-getting-oscillators-right-on-result-4","title":"Lower Noise","description":"A compact, guarded layout keeps the oscillator quiet and immune."}],"lookingAhead":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Consider whether a crystal is needed at all. Many microcontrollers can trim an internal oscillator to the host’s frame timing for full-speed USB, and internal oscillators suit many control tasks.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Where tight accuracy over temperature matters, a temperature-compensated oscillator module may be simpler than trimming a crystal circuit.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"supportImage2":null,"testimonial":{"quote":null,"author":null,"role":null,"photo":null},"challengesSolved":[{"id":"clocks-and-crystals-getting-oscillators-right-on-challenge-1","title":"Clocks drifting from wrong load capacitors","description":null,"icon":null},{"id":"clocks-and-crystals-getting-oscillators-right-on-challenge-2","title":"Boards that fail to start in the cold","description":null,"icon":null},{"id":"clocks-and-crystals-getting-oscillators-right-on-challenge-3","title":"Crystals driven beyond their rated drive level","description":null,"icon":null},{"id":"clocks-and-crystals-getting-oscillators-right-on-challenge-4","title":"Noisy signals routed under the oscillator","description":null,"icon":null}],"relatedPosts":[],"contactUs":{"show":true},"updatedAt":"2026-11-15T17:32:32.682Z","createdAt":"2026-11-15T17:32:32.682Z"}],"hasNextPage":false,"hasPrevPage":false,"limit":10,"nextPage":null,"page":1,"pagingCounter":1,"prevPage":null,"totalDocs":1,"totalPages":1}