Measuring Crystal Oscilator, So Confused - Page 1
Forum section: electronics / beginners

author: meltbox360
author_rank: Contributor
timestamp: June 14, 2013, 12:19:01 am
content: So I just got my DSO oscilloscope yesterday and I've been playing around with a few of my circuits. This is the first thing that has really got me confused out of my mind. When I attempt to measure either pin of the crystal going into the ATMega 328 I have the signal is just nonsense. I get some sort of random discharge type wave and nothing steady. When I measure across the pins I get something that makes more sense but is WAAAAY too low of a frequency. Now here is what stumps me. When I measure ground to the top of the crystal which appears to not be connected to either leg of the crystal I get the correct 14.7..... MHZ that I should. Now maybe I'm missing something but that doesn't seem like it should happen. Are there other oscillators which have a third pin that behaves like this? If the frequency observed at either pin is not the correct frequency then how does the MCU operate at the correct frequency. I know that everything works its just the measurements don't make any sense to me.

author: c4757p
author_rank: Super Contributor
timestamp: June 14, 2013, 12:34:15 am
content: Switch to a 10X probe. You're loading the circuit down too much. When you probe the top of the crystal you're just picking up RF emissions from the case.

author: mikes
author_rank: Regular Contributor
timestamp: June 14, 2013, 01:22:52 am
content: Even a 10x probe will introduce trouble. You're loading the crystal, and adding capacitance which will change the frequency. You need a high impedance (100x or even better FET) probe to even try to measure the crystal directly with decent results. And that will _still_ pull the frequency a bit.Focus on the oscillator output, instead.

author: olsenn
author_rank: Frequent Contributor
timestamp: June 14, 2013, 01:27:56 am
content: There's a fuse setting for the atmega328 to output the buffered clock frequency on one of its pins. You can give this a try if you need to figure out what frequency it's running on. If you're using a DSO though and not a frequency counter, don't expect much in terms of accuracy/precision.

author: meltbox360
author_rank: Contributor
timestamp: June 14, 2013, 02:55:46 am
content: 10x reads it perfectly. In fact if you read the datasheet Atmel recommends adding small caps between each leg of the crystal and ground for noisy environments. I figured it out and immediately smacked myself in the face. Thanks everyone. Interesting bit about the case, didn't think of that.

author: c4757p
author_rank: Super Contributor
timestamp: June 14, 2013, 02:59:43 am
content: Quote from: meltbox360 on June 14, 2013, 02:55:46 amItisaffecting the frequency, so don't use it for a precise measurement. The frequency of a crystal oscillatoralwaysdepends on its capacitive loading - in precision applications they are even adjusted with a variable capacitor. Even 1pF will put it out measurably. For minimal effect, try measuring the frequency by picking up emitted RF near the crystal, or using an auxiliary clock output as olsenn suggested.

author: meltbox360
author_rank: Contributor
timestamp: June 14, 2013, 03:04:45 am
content: Oh that is probably true. I was going just for some verification that it was functioning. It reads very close to what is written on the crystal.

author: c4757p
author_rank: Super Contributor
timestamp: June 14, 2013, 03:09:21 am
content: Yep. 1X probes destroy oscillators. In general, just don't use them, unless you know otherwise that you need one.