Ceramic Resonator testing - Page 1
Forum section: electronics / beginners

author: MrAureliusR
author_rank: Unknown
timestamp: July 07, 2013, 08:43:27 pm
content: Hi there everyone. I'm relatively new to these forums but I've been watching EEVBlog for a long time. I'm off to college in the fall for EE so I will be on these forums more and more to ask questions and get help with homeworkAnyway, my question is, I will hopefully have an oscilloscope soon, and the first thing I want to use it for is to test the waveforms of ceramic resonators vs. crystals. I'm a little confused on how these are powered. I know that the 14.7456MHz and 20MHz crystals I have should be connected, to an ATmega324A for example, like this: (Q1 in my original schematic is 14.7456, and the original ATmega32 only goes to 16, but my 324A goes to 20)Sorry if the image is huge... it's also my first time using EAGLE to actually make a schematic... it's much easier than I thought! Anyway, that's how I was taught to hook up a 20MHz crystal to an ATmega324A. Now, if I had an oscillator, which pin would I hook the output up to? On a Z80 for example, it's really obvious because there's only one pin for CLK anyway! This is where my confusion comes in -- the ATmega makes it easy to hook up a crystal because there's two pins, OSC1 and OSC2, but if you didn't have the full crystal oscillator with your Z80 for example, how would you hook it up?And back to my original question, which is related: ceramic resonators have the same thing, two oscillator pins and a ground. So to use one with an ATmega (which I'm getting conflicting advice on whether or not is a good idea/will work properly) it seems really obvious, you'd wire it up in a (similar, I'd imagine) circuit like the image above. But again, if you were to use one with something that only has one input for clock, how would you go about that?Also, are the waveforms from a ceramic resonator nice and square, or are they not as stable and clean as a crystal? I'd really love to see the visual difference (which I will do once I get my hands on an oscilloscope) to help me understand it better. Anyone who has a few minutes, could you possibly upload an image/video of the waveforms? I hope that's not too much to ask, I'm just an eager learner!I've been trying to find this info online (especially how to hook up a 2-pin crystal to a 1-pin CLK inout, and vice versa with a 1-pin output oscillator and a 2-pin OSC input) but I literally cannot find a nice, simple explanation on how to hook it up, how to determine cap values (which I'm guessing at in my schematic above), etc etc.Thanks!

author: c4757p
author_rank: Super Contributor
timestamp: July 07, 2013, 08:47:42 pm
content: The waveform depends on the oscillator driving it. Startherefor information on how to build a crystal/ceramic oscillator. I suggest something like a 74HC04 for the inverter; don't try to get fancy with transistors.Double-check how you have the crystal hooked up in your schematic - you have groundedeverything.Edit: Does EaglereallyuseQfor crystals?? That's supposed to be for transistors!

author: MrAureliusR
author_rank: Unknown
timestamp: July 07, 2013, 08:54:35 pm
content: D'oh! Meant to look like this: [EDIT: fixed awful EAGLE work I did]Thanks for the link, I'll read that right now!

author: c4757p
author_rank: Super Contributor
timestamp: July 07, 2013, 08:57:17 pm
content: Paycloseattention when you're making your connections, especially until you get familiar with the software. It's still not right, because you've drawn the lines straight through the capacitors to the other side!And I'm not familiar with Eagle, but I suspect that pins (30, 10) and (31, 11) may not actually be connected, because there's no junction dot at the point where the wires meet. This is important if you're going to do a PCB, because the software won't know those pins are supposed to be joined together, even if to your eye they look like they are. (Of course, I could be wrong, since I never use Eagle.)

author: MrAureliusR
author_rank: Unknown
timestamp: July 07, 2013, 08:59:56 pm
content: Thanks for the tips! I was editing the capacitor rotation in a hurry to upload my response, and afterwards I noticed that the wire went straight through!Also, you're right -- I forgot the junctions. However, for my first time ever, with absolutely no instruction, I think I did alright for diagramming my questionBut yes, I will continue to practice with EAGLE and get better! Thanks for the quick response by the way.Do you know anything about the clarity/shape of the waveforms of ceramic vs crystal oscillators?

author: c4757p
author_rank: Super Contributor
timestamp: July 07, 2013, 09:00:02 pm
content: Quote from: MrAureliusR on July 07, 2013, 08:54:35 pmThere isn't really much information in that article, but hopefully you'll pick up a few keywords to jump start your Google journey.I know of a very good application note with info on calculating the ideal values for all of the components in the oscillator; I'll see if I can dig it up. (I'mwaytoo stupid to have any sort of folder on my computer where I keep things like that.....)Edit: Not the one I was thinking of, butthishas some good information and a full calculation of all values.

author: c4757p
author_rank: Super Contributor
timestamp: July 07, 2013, 09:05:33 pm
content: Quote from: MrAureliusR on July 07, 2013, 08:59:56 pmThe waveforms will be almost identical: output depending on the oscillator type (square, if you use an inverter-based oscillator), and semi-sinusoidal at the other side of the crystal. The only really important differences are that ceramic resonators are significantly lower in accuracy, and the three-pin ones usually don't need external capacitors.If you use an inverter to build your oscillator, you should buffer the signal through a second inverter to isolate the crystal/resonator from the rest of the circuit and clean up the waveform. Note that if you stick a scope probe anywhereinsidethe oscillator circuit, you will drastically shift the frequency and perhaps waveform, so don't be surprised if it doesn't behave when you go waving a probe around.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 07, 2013, 09:16:08 pm
content: Waveforms will be fairly sinusoidal. A 'happy' oscillator has a similar amplitude on both sides (bear in mind a x10 scope probe will significantly load it so you need to either use a x100 probe or a series resistor.There is no reason to use external caps - pick a resonator that has internal caps.

author: lgbeno
author_rank: Frequent Contributor
timestamp: July 07, 2013, 09:42:39 pm
content: Quote from: mikeselectricstuff on July 07, 2013, 09:16:08 pmHowever external load capacitors for crystals are typically required.I think in general a resonator and crystal waveforms will look the same at any given time, it is their accuracy and stability over temp, time, etc that will vary.I never dug deep into why this happened but I inherited a design once that used a resonator with a pic24 uC, about half of the Proto units had issues after running for awhile due to failure of the resonator. In the next spin I switched to a crystal and it worked great. I tend to use crystals exclusively as a result but I understand that they are cheaper so maybe they have a place...

author: senso
author_rank: Frequent Contributor
timestamp: July 07, 2013, 09:52:11 pm
content: Dont forget to connect AVCC and the adjacent GND or the chip will not work correctly.

author: MrAureliusR
author_rank: Unknown
timestamp: July 07, 2013, 10:22:25 pm
content: Yeah, in the actual full schematic I have AVCC and GND hooked up... just for the demo purposes I did it very basically.Thanks for the good info everyone! However I'm still wondering about how to wire up my 14.7456 MHz crystals to an IC with only 1 CLK pin... any suggestions?[EDIT: After re-reading the above posts, I take it you just pick one or the other pins and pull the wave from tbere?]

author: c4757p
author_rank: Super Contributor
timestamp: July 07, 2013, 10:50:24 pm
content: Crystals don't oscillate, they regulate oscillators. If it has just a single clock pin, it wants a proper clock, not the ass end of a crystal. You'll need to provide an oscillator circuit.

author: KJDS
author_rank: Super Contributor
timestamp: July 08, 2013, 07:38:00 am
content: Never ever spend 30 seconds googling when six months of carefully considered experimentation could provide half the information.http://www.freescale.com/files/netcomm/doc/app_note/AN2049.pdf

author: MrAureliusR
author_rank: Unknown
timestamp: July 08, 2013, 07:46:58 am
content: Oh man! Thanks so much for that PDF - its exactly what I've been looking for! I've only glanced it over because its 4 in the morning here but I'll give it a proper read later on today.Thanks everyone! I can see I'm going to like this community!EDIT: that PDF is extremely informative but maybe I should rephrase what I'm after: if you take a two-pin crystal, a breadboard and an oscilloscope, what would you need to get the crystal to oscillate an oscillator (assuming as someone stated crystal control the frequency of a separate oscillator)? I'm just trying to understand the theory. I see those 2 pin crystals on PCBs all the time but I'm assuming, like the ATmega32, the chips contain the oscillator and the crystal just regulates the frequency.Hmm, I think I'm starting to understand this a bit better as I type this out. Still, more info would help! Thanks to everyone who contributed so far, I appreciate the patience it takes to work with a beginner