Generating a simple sine wave 



I needed a sine wave carrier for a magnetic transponder system I am working on. Various types of crystal based oscillator are available such as the Pierce, but these can be tricky to design and ensure they work correctly. Rich suggested using a square wave oscillator with a filter to turn it into a sine wave. The filter attenuates all frequencies
except the fundamental frequency, which should remove much of the square wave. Over a couple of nights I tested this in ltspice then built it on a breadboard and checked the real life results. The filter used is a simple LC low pass, called a pi filter due to the shape. ltspice can easily be used to test a filter and produce an FFT to visualise the response. The circuit used for testing is shown below and uses nothing more than a pulsed voltage source (to generate a square wave) and the filter. The value of 3. 6864Mhz was chosen as it is a commonly available oscillator that divides very nicely into serial baud rates, making it excellent for serial communication. Simulating a few cycles of this provides the waveforms shown below, which verify the square wave and the resulting "sine", which looks a little triangular at a first glance. The FFT shows that the first harmonic is around 30dB, others are far below 40dB. The sine wave is not perfect in the simulation but looks quite reasonable, so it is time to build a real circuit to test. Whilst the simulator is perfect, real life is not. The circuit was built on a breadboard with an AEL crystal, Murata inductor and ordinary ceramic capacitors. Using my Rigol DS1052E I captured data from the "post filter" node at 250Msa/sec for 1Meg worth of samples, using the "long memory" option. The graphic below shows the slightly rough sine wave, the frequency counter at the top right...
characters left: