13
\$\begingroup\$

I have 2 quartz crystal resonators in my pcb board: 32.768 kHz & 20 MHz. They are connected to a Freescale MC12311 transceiver IC, which has an HCS08 micro-controller embedded in it. I want to test if these crystals are working properly or not.

Available tools: Oscilloscope, Frequency-Meter (Digital Counter), Digital Multimeter.

How should I use these tools to test the crystals in board?

  • Note: The capacitive load-effect of probes should probably be considered. If not, the measurement would not be accurate, or even worse, the crystals would not work at all.

Edit1: I used both the oscilloscope and the frequency-meter (with x10 probes), but unfortunately there was nothing monitored at all.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ What kind of probes are you using? Bandwidth of probes and instruments are needed. You could check Atmel application note AVR4100 for some tips about the 32kHz crystal. \$\endgroup\$
    – Dejvid_no1
    Commented Mar 29, 2014 at 10:55
  • 1
    \$\begingroup\$ You probably won't break anything if you put the oscilloscope probe to the resonator output. What's the scope make and model? \$\endgroup\$
    – Dejvid_no1
    Commented Mar 29, 2014 at 14:12
  • 1
    \$\begingroup\$ It's an analog oscilloscope of Tektronix. By the way, the capacitive load of the oscilloscope probe would affect the measurement. Anyway, isn't the frequency-meter a better choice? \$\endgroup\$
    – Omid1989
    Commented Mar 29, 2014 at 15:28
  • 1
    \$\begingroup\$ I'm pretty sure that you should be able to program the MCU without external clocks, so that's a separate problem from whether or not the crystals are OK. After hardware reset, the MCU starts up on its internal oscillator. \$\endgroup\$
    – Dave Tweed
    Commented Mar 29, 2014 at 15:33
  • 1
    \$\begingroup\$ I'd just use the oscope. If there was some effect of the probes, it would simply cause the frequency to differ slightly. But you'd still see a clock signal. Make sure you reference to your pcb's ground, not just the other side of the crystal! \$\endgroup\$
    – bitsmack
    Commented Mar 30, 2014 at 2:57

4 Answers 4

10
\$\begingroup\$

As I see, no answer was accepted. Let me offer another answer.

Most modern ICs use so-called Pierce Oscillator to generate stable clocks using crystals. Here is the main circuit configuration:

enter image description here

As one can see, the circuit is not symmetrical: the right side is output of some driver (usually designated as XO), and the left side is input to an inverting amplifier (usually designated as XI). Therefore it is relatively safe to probe the XO (output) end, provided that the probe has a relatively high impedance. An usual 1:10 passive probe with 1M input impedance should do the job. In practice, the output driver in circuit amplifier is made intentionally weak, typically no more than 1mA load capability, to prevent Xtal from being overddriven, but 1mA should be well enough to drive a 1M scope probe.

The probe tip capacitance may shift the frequency of oscillation by 20-50ppm, since it will change the circuit tune-up (Xtal load, C1 in series with C2). However, the probe load on XO should not break oscillations, unless the entire circuit is too marginal and does not meet the stability criteria (negative impedance of amplifier should be 3-5 times more than Xtal ESR). If the probe does this, consider the Xtal test as fail.

One should never try to probe the XI input, maybe only with a 100 MOhm probe, and only for curioucity. The reason is not in the tip capacitance (2-8-12pF or wahtever), but in inflicting a DC shift on XI pin due to finite probe impedance. The Pierce oscillator is a very delicate non-linear circuit, and it has a very important DC feedback component R1, which effectively adjusts the input DC level to the point of maximum amplification, usually about half way from ground to Vcc. The component R1 is usually 1MOhm and above, and the oscillations become centered at self-selected DC point. Attaching even a 10MOhm probe shifs this point down, amplification drops, and oscillations die.

And, of course, the best way to test for oscillations is not to touch it with probes, but to have an internal buffer with output to some otherGPIO test pin.

\$\endgroup\$
8
\$\begingroup\$

I had a similar debugging issue once with my Atmel ATMEGA328P controllers, the 8Mhz ceramic resonators were not seemingly working. I had a Rigol dual channel cheapo oscilloscope, and had scoped a working board I made previously and the nice 8Mhz signal was easily seen, with no problem due to loading by the probes. You should not worry about the probe's effect on the crystal.

The main issue I found was my controller that was meant to drive the crystal did not have it's fuses set correctly to use the external crystal. Once I had burned the fuses to select external crystal, the resonators showed life signs!

So it's actually a good point to ensure your microcontroller that is connected to the crystal has been set to use the crystal, otherwise there is nothing to drive power into it to make it oscillate. Once you have made sure that is the case, you can then start to see if it's PCB or other trace issues, grounding problems, wrong pins etc.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks Kyran for your answer. I'm using Codewarrior 10.4 as IDE. Do you know how to set the fuse bits in this IDE? \$\endgroup\$
    – Omid1989
    Commented Mar 30, 2014 at 5:43
  • 1
    \$\begingroup\$ Sorry @Omid1989 i am not familiar with that IDE. I have really only used AVRdude and Arduino, and Atmel Studio for small microcontrollers, and Code Composer Studio for an ARM A8. It might have a seperate utility to read, and then write, the fuses in similar tabs/areas to programming/flashing target chips. Look around in those options for the fuse settings. Datasheets may also tell what the fuse/register options are to select external crystal inputs. \$\endgroup\$
    – KyranF
    Commented Mar 30, 2014 at 5:52
  • \$\begingroup\$ I second this. I used a cheapo 10x probe, on a cheapo 13.598mhz crystal output, with a cheapo IC pierce oscillator type circuit and everything worked fine. I just probed the crystal and it was oscillating at 13.5mhz which is as quick as my oscilloscope calculates frequency. \$\endgroup\$
    – Leroy105
    Commented Aug 25, 2017 at 22:01
8
\$\begingroup\$

The external components make the oscillator look symmetrical, but there is an amplifier on the chip that is anything but. The oscillator pin that is on the output side will have a lower impedance and putting the scope probe there will not affect it nearly as much as probing the input pin.

If it's oscillating, the output will have a larger amplitude than the input; it may also not be a very good sinewave. The input side will be lower and should be a sine wave (having been filtered by the crystal).

If it is not oscillating, the input will be noisier and should be something like half the supply voltage. The output pin will be cleaner looking and may be at VDD or ground. Some of this will vary with the design of the chip (and the configuration).

\$\endgroup\$
6
  • 1
    \$\begingroup\$ BTW, you didn't say if you wanted to measure the frequency accurately or just see if it's oscillating. \$\endgroup\$
    – gbarry
    Commented Mar 30, 2014 at 3:52
  • \$\begingroup\$ I want to see just it's oscillating or not! BTW, what do you mean by input and output here? \$\endgroup\$
    – Omid1989
    Commented Mar 30, 2014 at 4:38
  • 2
    \$\begingroup\$ some crystals have an Xin and Xout pin, with a load capacitor on each to ground. The signal will be slightly different but for practical purposes not really. The driver inside a microcontroller or other device that utilizes a crystal or resonator is basically a oscillator circuit (with opamps, etc). That is why you have to actually activate the external crystal input for the micro to turn on these peripherals. \$\endgroup\$
    – KyranF
    Commented Mar 30, 2014 at 4:47
  • 2
    \$\begingroup\$ I believe KyranF meant to say "some crystal oscillators", as the crystal itself is symmetrical. These pins are on the microprocessor. Even if the pins aren't labelled Xin and Xout (or OscIn and OscOut), they are still very likely to act as though they were. \$\endgroup\$
    – gbarry
    Commented Mar 30, 2014 at 5:17
  • \$\begingroup\$ So if I measure a slightly higher frequency at the XO terminal, I should trust that measurement over the more "correct" frequency at the XI terminal? \$\endgroup\$
    – endolith
    Commented Apr 5, 2017 at 14:10
0
\$\begingroup\$

If you have a sensitive communications receiver, like those used in amateur radio, hooking a wire between the receiver antenna input, and the other end an inch away from the oscillator circiut , without even touching the circuit, tuning the receiver around the crystal frequency, you should hear a beat. And, spot on the exact frequency.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.