by NickH » Thu Jul 16, 2009 11:37 am
Well the trouble is, the correct circuit will vary from one crystal to another. Refer to the crystal manufacturer's datasheet. Also 40MHz is quite a high frequency (which I don't have experience with). But I'll tell you what I know about the standard "parallel resonant" circuit, and maybe with some experimentation you can get it to work...
Start with a CMOS gate such as 74HCU04. Decouple its power supply with a bypass capacitor.
Connect the crystal across the input and output of an inverter, with capacitors "C1, C2" from each terminal to ground. Their value should be specified in the crystal's datasheet; but try 15pF. Also, in parallel with the crystal, put a feedback resistor "Rf" of 1Mohm.
With some crystals you need a resistor "R1" between the output of the inverter and the crystal-capacitor circuit. (The idea is that R1,C1 form a low-pass filter, to reduce clipping and reject overtones.) But for 40MHz I think you don't need R1.
Finally, connect the inverter output to the input of another inverter, and use the second inverter to drive the FPGA: this will amplify and clean up the output signal.
Nick