Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / Measurement and Acceptance

Why can a 12 MHz crystal lose edges without raising the controller's clock-failure flag?

A board uses a 12 MHz passive crystal as its main clock. A capture shows missing edges, yet the fault register has no matching event. Another time the controller changes to a backup clock and the handler finds the bus still running. Before comparing a capture with register data, determine how the controller qualifies a failure, what clears the event, and when fallback takes effect.

Determine how many edges the window requires

Some Microchip controllers with a PMC describe a specific rule for main oscillator failure detection. In the cited online manual, the detector counts crystal periods during the high portion of a 32 kHz signal generated from a nominal 64 kHz RC source. It reports a fault if the window contains fewer than eight periods. Confirm the relevant device and documentation revision for production. Other controllers can have different rules.

Assume the monitor signal is precisely 32 kHz and high for half a cycle. Its window lasts about 15.625 microseconds. A 12 MHz passive crystal provides about 187.5 periods, with endpoint alignment affecting the edge count. Losing one microsecond drops roughly twelve periods. Around 175 periods can remain, comfortably above eight. An observable short gap can therefore coexist with no reported fault.

Longer gaps depend on where they land relative to the monitor. The same duration may almost fill a high window or fall largely between windows. The RC frequency varies with conditions, and low-power modes can affect detector operation. Record thresholds, cadence, and enable state for the device. Repeat a controlled fault at several alignments. One measured delay does not determine a fixed alarm time.

Keep the first event on an independent time record

Choose a probe point representing the main source or a documented output stage. For a 12 MHz passive crystal, avoid using a heavily capacitive probe directly across oscillator pins as the primary evidence. Use a buffered output or the device's recommended measurement method. Record an independent time marker that survives loss of the main clock, along with fallback transitions, external reset, and the relevant operational timing. A healthy system clock under fallback does not prove the primary oscillator remained active.

Register reads can have side effects. In the cited controller, CFDEV indicates the failure event. Reading PMC_SR ends the corresponding interrupt, and CFDS reports detector status. If a debugger polls the register, it can change event visibility for firmware. A single authorized reader can log the raw register value with an independent timestamp. Disable competing debugger polling and pair the firmware log with a hardware marker to distinguish missed detection, late reading, and fallback without a retained log.

For controlled validation, use a permitted external clock interface or test mode to present a known-length gap and verify the detector and logging chain. Test the passive crystal's actual behavior separately under specified loading, power, and connections. A synthetic gap cannot establish physical crystal damage. If loss of oscillation coincides with power-domain changes, excess temperature, or a firmware source change, check those conditions first.

Report the acceptance definition used for substitution

Compare original and candidate crystals on the same reproducible board. Record valid edges from the main source, maximum gap, fallback, event status, and timing of the critical system action. Zero alarms is evidence for the detector's rule. An application that cannot tolerate a brief gap needs independent edge verification. If the requirement is safe fallback after loss, measure within the system time budget and establish which mechanism reselects the main source afterward.

Keep a reproducible pass and failure, the fixture, clock settings, supply and temperature, and the logging revision. Startup and steady operation may need separate qualification. If a lot behaves differently near the switching condition, compare startup and sustain behavior under the same load and temperature. A single register bit gives insufficient evidence for incoming acceptance.

There is another ambiguity in this example. Fallback can select an internal RC oscillator nominally at 12 MHz. The original crystal is also 12 MHz, so an approximately twelve-megahertz counter result cannot identify the source. Save the source status, clock selection settings, and external events. If bus or peripheral delay matters, examine the pulse spacing during handover and confirm the divider settings after recovery.

Test allowed fault events during steady operation, before sleep, and after wake, and record whether monitoring is enabled in each state. A controller reset can change relevant status. A normal flag after reboot cannot substitute for the pre-reset record. When status is only accessible after power-up, capture reset, clock edges, and the backup path externally and add firmware logging after reproducing the sequence. If the test requires bypass mode, verify whether the device supports fault detection in that mode. A disabled detector cannot validate its alarm threshold.

References

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.