Author Topic: Crystal Oscillator Circuit  (Read 17441 times)

0 Members and 1 Guest are viewing this topic.

Offline pietergoosTopic starter

  • Newbie
  • Posts: 4
  • Country: za
Crystal Oscillator Circuit
« on: September 28, 2017, 05:54:43 pm »
Hi everyone,
I'm currently working on a project for my university but we're being restricted in components. For the last section that I have yet to complete I need to make an oscillating circuit based off of a 75kHz tuning fork crystal.
I have some other components to use, A 74HCT04 NOT Gate (Buffered I think), an MCP602 (opamp) and TL82CP (opamp). Any caps and resistors are available as well.
The circuit must output a 5V peak to peak square wave with a 2.5V DC offset (so basically 0 to 5V square wave).
The Crystal I have, I measured to have a frequency of 74997Hz, ESR of 33775 Ohm, Cp = 1.5pF, Cs = 1fF and L = 4503H. The series capacitance value was recommended by my lecturer.
Does anyone have any recommendations for what I can try, as I've struggled to build anything let alone simulate it in LT SPICE.  :-//


PS: I've tried to use the NOT gate, but it's not working as I think it is buffered (from what I can understand from the Data Sheet). Our lecturer recommended putting an LP filter between 2 op-amps in an inverting and non-inverting config; the crystal is then connected between the other ends of the op-amps. The problem is I have no idea of how to get this to work  |O

Regardless,
If anyone has any advice for me, as I can't find much on low frequency oscillators, please do let me know.
Thanks in advance!
 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5121
  • Country: nl
Re: Crystal Oscillator Circuit
« Reply #1 on: September 28, 2017, 06:13:27 pm »
Normally you'd want an unbuffered HC04 for that, but I'm not sure it can't be done with a HCT04. For sure these guys suggest it can be done:



Maybe increase the value of the cap because this uses a 3MHz crystal.
Keyboard error: Press F1 to continue.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Crystal Oscillator Circuit
« Reply #2 on: September 28, 2017, 06:30:39 pm »
Normally you'd want an unbuffered HC04 for that, but I'm not sure it can't be done with a HCT04. For sure these guys suggest it can be done:



Maybe increase the value of the cap because this uses a 3MHz crystal.

That won't fly, power levels are far too high for tuning-fork crystals, they are very easily overdriven.

Something like this will work (you'll need to reduce the capacitances a bit):

« Last Edit: September 28, 2017, 06:33:10 pm by Benta »
 
The following users thanked this post: pietergoos

Online edavid

  • Super Contributor
  • ***
  • Posts: 3381
  • Country: us
Re: Crystal Oscillator Circuit
« Reply #3 on: September 28, 2017, 06:36:40 pm »
Look up any common 32kHz crystal oscillator circuit using an unbuffered CMOS inverter (4069, 74C04, 74HC04, etc.).  Now replace the CMOS inverter and its feedback resistor with an MCP602 op amp circuit with a gain of -10 (or try a different gain if that doesn't work).  Use the 74HCT04 to buffer the op amp's output.

ETA: The circuit posted by Benta is fine, but as I said, replace the inverter that's used as an amplifier, with an op amp amplifier.
« Last Edit: September 28, 2017, 06:38:25 pm by edavid »
 
The following users thanked this post: pietergoos

Offline pietergoosTopic starter

  • Newbie
  • Posts: 4
  • Country: za
Re: Crystal Oscillator Circuit
« Reply #4 on: September 29, 2017, 08:09:52 am »
I'll give that a try, but unfortunately, I have no access to the labs here over the weekend, so it'll have to wait until Monday, for testing at least. Thanks for your advice, and everyone else's!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: Crystal Oscillator Circuit
« Reply #5 on: September 29, 2017, 08:34:24 am »
+1 for the MCP602 dual OPAMP.  Use one half as the inverting gain stage of a Pierce oscillator and the other as a comparator to square up the output.   N.B. use high value resistors for the input and feedback resistor round the OPAMP to minimise the load on the crystal.
« Last Edit: September 29, 2017, 08:37:44 am by Ian.M »
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Crystal Oscillator Circuit
« Reply #7 on: September 29, 2017, 12:08:53 pm »
I like the 74LVC1GX04 because it's compact, but the 74LVC1404 should be better, because it has a Schmitt trigger buffer and a disable option to save power, when it's not needed.
http://www.ti.com/lit/ds/symlink/sn74lvc1gx04-ep.pdf
http://www.ti.com/lit/ds/symlink/sn74lvc1404.pdf
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Crystal Oscillator Circuit
« Reply #8 on: September 29, 2017, 02:17:02 pm »
Finding optimised parts is of course wonderful, but from reading the OP, this is not an option, the ICs are given.
« Last Edit: September 29, 2017, 02:18:35 pm by Benta »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Crystal Oscillator Circuit
« Reply #9 on: September 29, 2017, 08:00:48 pm »
Finding optimised parts is of course wonderful, but from reading the OP, this is not an option, the ICs are given.
Yes that's annoying. I hate having to make do with parts which are not designed for the purpose, but I suppose that's the whole point of a university project.

I agree with edavid's suggestion of using the MCP602 op-amp. The rise/fall times, nearly 2µs (page 9 on the data sheet), may not be fast enough to drive a digital circuit but that might not matter, if all that's required is answering the assignment question.
http://ww1.microchip.com/downloads/en/DeviceDoc/21314g.pdf
 

Online edavid

  • Super Contributor
  • ***
  • Posts: 3381
  • Country: us
Re: Crystal Oscillator Circuit
« Reply #10 on: September 29, 2017, 08:02:59 pm »
I agree with edavid's suggestion of using the MCP602 op-amp. The rise/fall times, nearly 2µs (page 9 on the data sheet), may not be fast enough to drive a digital circuit but that might not matter, if all that's required is answering the assignment question.

He can use his 74HCT04 to clean that up (perhaps even making it into a Schmitt trigger).
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: Crystal Oscillator Circuit
« Reply #11 on: September 29, 2017, 09:31:20 pm »
Just for fun, I tried to simulate an op amp Pierce oscillator for this crystal. Pierce needs lots of gain, and the gain limit for a single inverting TL082 stage at 75kHz is about -50. I think it's a good idea to buffer the inverting amplifier, so the resistors don't have to get too big. The power dissipated at the crystal is about 1.2uW, a little over the 1uW typical level. The oscillator takes about to 250ms to get to clipping oscillation, and outputs a ~5.3Vpp square wave.

I don't have a 75kHz crystal around, so I can't test if this would work in reality. Maybe the circuit is overcomplicated, but at least it's an starting point if you want to try Pierce with op amps.

 
The following users thanked this post: Zero999, edavid

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Crystal Oscillator Circuit
« Reply #12 on: September 29, 2017, 09:48:56 pm »
Just for fun, I tried to simulate an op amp Pierce oscillator for this crystal. Pierce needs lots of gain, and the gain limit for a single inverting TL082 stage at 75kHz is about -50. I think it's a good idea to buffer the inverting amplifier, so the resistors don't have to get too big. The power dissipated at the crystal is about 1.2uW, a little over the 1uW typical level. The oscillator takes about to 250ms to get to clipping oscillation, and outputs a ~5.3Vpp square wave.

I don't have a 75kHz crystal around, so I can't test if this would work in reality. Maybe the circuit is overcomplicated, but at least it's an starting point if you want to try Pierce with op amps.
Very good.

Unfortunately the TL072 model isn't part of the default LTSpice install, so many people won't be able to view the file you attached. What's odd is I do have TL072.sub and TL072.asy but the op-amp symbols appeared in the wrong place. Fortunately, it's possible to embed the model in the .asc file and use opamp2.asy for the symbol.

The oscillation will start sooner if LTSpice is set to start the simulation with the power supply at 0V, then turn it on, which is more representative of real life.
 
The following users thanked this post: orolo

Offline BaconAndEggs

  • Newbie
  • Posts: 2
  • Country: za
Re: Crystal Oscillator Circuit
« Reply #13 on: October 01, 2017, 01:45:54 pm »
Hi all. Sorry if I'm late to the party.

I'm also doing the same assignment as what OP is doing and from the awesome advice in this thread I designed an oscillator with a 77.5kHz resonant frequency. I got the design from this link: http://endorphino.de/projects/electronics/timemanipulator/index_en.html.

Please can you let me know if there is anything that I can change in the design to get a more clean output. Thanks!

Also the spice model that was linked above has a VCC of 9V. We only have access to rails of 5V and 0V respectively with a "virtual ground" of 2.5V.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Crystal Oscillator Circuit
« Reply #14 on: October 01, 2017, 01:51:05 pm »
Give U3 positive feedback to make it into a Schmitt trigger.
Also, I think 33 pF is a bit high for the crystal load caps. I'd think something like 10 pF would be closer to the mark.
 

Offline BaconAndEggs

  • Newbie
  • Posts: 2
  • Country: za
Re: Crystal Oscillator Circuit
« Reply #15 on: October 01, 2017, 01:53:17 pm »
With regards to the positive feedback. What resistors would you recommend?

Thanks

EDIT: added an attachment to show the output of U2 during oscillation.
« Last Edit: October 01, 2017, 02:00:03 pm by BaconAndEggs »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: Crystal Oscillator Circuit
« Reply #16 on: October 01, 2017, 02:05:15 pm »
The issue is probably the limited slew rate of the OPAMP.   It probably needs a hybrid solution - Try using the 74HCT04 on the output to square up the signal.   It will be very tricky to get a good 50% duty cycle though.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Crystal Oscillator Circuit
« Reply #17 on: October 01, 2017, 05:47:38 pm »
Try this. The hysteresis voltage is equal to RIN/RF×VCC and will be centred around the middle of the logic gate's threshold.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Crystal Oscillator Circuit
« Reply #18 on: October 01, 2017, 06:28:27 pm »
Try this. The hysteresis voltage is equal to RIN/RF×VCC and will be centred around the middle of the logic gate's threshold.


Yeah, that'll work if you use two 'HC04 gates. If you stick with the opamp for U3, try with 1 Mohm feedback and 10 kohm input resistor.

 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: Crystal Oscillator Circuit
« Reply #19 on: October 01, 2017, 06:31:54 pm »
If you are allowed only a 5V rail, it's no use giving you a TL082  ??? . This op amp is specified from 8V upwards. You can use a MCP602 with the same circuit from a 5V rail, though this op amp has much less slew rate.

With logic circuits like buffered inverters you might try the classic two inverter oscillator mentioned above. I have found a spice model for a 74HC04 down to the transistor level, and it works quite well. Following Hero999's idea, for compatibility I put the spice model for the inverter into the asc file, and used the universal opamp symbol for the inverter: the noninverting input of the opamp symbol is connected to ground. The important detailk about this circuit is that resistor R3 should be a bit smaller than the crystal resistance.

The spice model used is an HC04, not an HCT04, but with luck the idea is the same, just with the 1.4V transition. The first model I tried was in fact for a 74HCT04 from the Nexperia webpage, but I had to cannibalize several spice files in order to insert them into the asc file, so I don't know if it's reliable. With that model I got lots of parasitics, both in the Pierce circuit (too much gain for an unbuffered inverter, the same happens with this HC04 model), but also in the two inverter circuit. The Nexperia model includes package parasitics and likes to self oscillate in the 10-20MHz range.

« Last Edit: October 01, 2017, 06:33:42 pm by orolo »
 
The following users thanked this post: pietergoos

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9410
  • Country: gb
Re: Crystal Oscillator Circuit
« Reply #20 on: October 01, 2017, 06:35:55 pm »
Is there no possibility of you being able to us a 74HCU04?
Best Regards, Chris
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Crystal Oscillator Circuit
« Reply #21 on: October 01, 2017, 07:10:31 pm »
orolo, please read Reply #2 again.
Your proposed circuit has waaaaay to much drive power for a tuning fork crystal, limit is around 1 uW. Yes, you read correctly: one microwatt.

Here's a link for enlightenment: https://www.maximintegrated.com/en/app-notes/index.mvp/id/58
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: Crystal Oscillator Circuit
« Reply #22 on: October 01, 2017, 07:17:37 pm »
orolo, please read Reply #2 again.
Your proposed circuit has waaaaay to much drive power for a tuning fork crystal, limit is around 1 uW. Yes, you read correctly: one microwatt.

Here's a link for enlightenment: https://www.maximintegrated.com/en/app-notes/index.mvp/id/58
I'm aware of the 1uW limit, see post #11 above. However, this is the only circuit I have managed to get to work (in simulation) with logic ICs for now, after many tries with the Pierce + inverter. BTW, using a Pierce + 74HCU works fine, but 74HC(T) fails for me. And yes, it's easy to see that the two inverter circuit drives the crystal into the tens of microwatts; I've just simulated the circuit.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: Crystal Oscillator Circuit
« Reply #23 on: October 01, 2017, 07:22:11 pm »
So why post it if it doesn't work?
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: Crystal Oscillator Circuit
« Reply #24 on: October 01, 2017, 07:42:05 pm »
So why post it if it doesn't work?
Depends of your definition of doesn't work: and overdriven crystal may fail earlier, age badly or fail instantly. The first two cases are good enough for experimentation, a quick demonstration or a beginner's exercise. It's certainly not advisable for a finished product. That this topology is relevant, even if overdriven, can be attested in the biblography (just review the ubiquitous Matthys book, where this circuit is suggested for up to 200-400kHz or so).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf