Electronic – In-Circuit Crystal Frequency Measurement

analogembeddedmicrocontrolleroscillatorsignal processing

I am designing a small testing unit to automate production testing for my company's main boards. One of the tests to be done is to verify that an 8MHz external crystal oscillator for a PIC MCU is running. Is there a recommended way to do this in a cheap and reliable way?

My thinking at the moment is to sample above 16 Msps (Nyquist frequency = 8MHz x 2 = 16MHz). This would give me enough information to reconstruct the wave and determine the frequency. The problems I see with this is the ADC I am currently using is only 500ksps. I would need to alot extra cost for a higher performance ADC as well as board space for an anti-aliasing filter to get rid of any higher harmonics that might be picked up. This solution feels bulky just for testing if a sine wave is present or not. Any suggestion appreciated.

Best Answer

Since you have an external crystal, not an external crystal oscillator, it is extremely sensitive for connecting any measurement equipment to it. External crystal oscillator outputs logic level square wave and it would be much easier to measure.

The frequency is too high to measure with your DAQ directly, it would be necessary to write a test program to PIC that outputs a divided down logic level signal based on the crystal frequency.

It still would not tell how good the crystal circuitry is. It might still be barely oscillating or have startup issues due to some manufacturing error like missing or wrong parts in the crystal circuitry.

Related Topic