Running a crystal as a signal generator
metron9
Posts: 1,100
Supose I want to put a 31.25 KBD crystal on a board to drive an input pin on a Uc. How do you power the crystal to turn it on and keep it going?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Comments
I have come up with a CD4049UB chip from my old box of chips a Hex inverter, Logic 1 in logic 0 out very basic and simple to use
http://www.datasheets.org.uk/search.php?q=CD4049UBE&sType=part
The web site I have found that has a few schematics of crystal oscilator Circuits is here:
http://www.z80.info/uexosc.htm
I tried making it but it did not work. Looking at the scope I can see why. The blue line is a square wave from another microcontroller running at about 1.8 Mhz frequency between pulses, you can see the initial drop of the inverted output is pretty good but the time it takes to get back to a full 5V is about 350ns. One billion divided by 350 is 2.8mhz so indeed this hex inverter is way to slow for a 20mhz crystal.
The next time I buy some parts from digikey I will order some of the 6ns parts and try it again. Not sure though where the power goes on that last circuit he shows, I think it's called a GATE circuit, and I guess there are 5 more typical circuits named Pirce, Colpitts, Clapp, Butler and a modified butler. Rumaging through the bin I also found a PLL and that was fun to learn about as well tonight.
Anyone know why I get the -1.6 volt spike on the scope when the pin goes LOW?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
They can be really sensitive - sometimes all it takes is just a few pf of capacitance to make or break a circuit. Even the 6 or so pf per socket of those plug-in breadboard units can make a difference here - you might want to solder a wirewrap socket over a copper ground-plane, bending the signal legs out and soldering componentes in the air, as a low-capacitance way to experiment with building a higher-speed oscillator.
So all I can suggest is to keep reading the literature and trying new circuits. Those circuits at http://www.z80.info/uexosc.htm look like a fine way to get started.
Some literature assumes that you've bought a crystal, and so you know the crystal cut, recommended capacitance, and the serial or parallel resonance specification, etc. But if you're using junkbox crystals pulled off discarded circuitry, and you don't know any of that except the frequency printed on the can, you're more on your own.
At these high speeds, even a short length of cable to your scope can be enough to build up signal reflections that can bounce negative - maybe that's what's making the negative spike.
Keep at it, though, usually it's not that difficult to get them to oscillate.
David
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
I tried to use the CLKO clock output with a prescale divide by 32 but the HIGH signal had the 1MHZ signal bouncing up and down from 5V to 2.5V, don't know why yet.
First picture 1MHZ clock driving tiny45 BLUE, My output on pin1 is in red at 15.625KHZ cycle times 2 = 31.25 baud signal.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Post Edited (metron9) : 8/25/2006 1:52:58 AM GMT
Thanks in advance,
kenjj
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!