Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

4060 Oscillator Problem

Status
Not open for further replies.

oliverb

Member
I am building a digital clock using 7 segment displays with various slave outputs.
I have used a 32.768Mhz crystal as the time standard. This is fed into a 74HC4026 using the Q14 O/P to divide by 16384 to give 2Khz.

This then goes into a 4024 O/P through Q1 to divide by 2 giving 1Khz.

I then use 3 4017s to to divide by 10 each stage to give 100, 10 and finally 1hz O/P.

My problem is the 1hz O/P is 4 secs out every min and small adjustments of the trimmer capcitor cause quite large changes in the O/P.

I would have thought the trimmer would only change the crystal frequency by a few PPM.

The values for R5 & R6 were 10M & 470k as per topics on this forum and a previous project I had built using 32.268Khx crystal.

I have tried changing the values to 500K and 2k2 as per 4060 data sheet although as the cct was oscillating this was prob not the problem.

The sheet for the crystal says the cap value should be 22pF.

Can anyone see an error in the cct design I have missed?

Is it worth trying a smaller Cap as I think the O/P is in parrallel to the crystal so the value would never actually be 22pF?

I do not have anything smaller but I could put a 47pF in series with C1 and see what happens.

Thanks.
Brett.
 

Attachments

  • 1sec.jpg
    1sec.jpg
    20.2 KB · Views: 4,494
If you are shure that clock error is 4sec every minute then the precision of your oscillator is about 0.06666. You can not pull crystal so much by selecting wrong elements in oscillator. Usually pulling is about few kHz and you have over 2MHz.
Crystal may be wrong or oscillator oscillates on parasitics resonances.
Check the frequency at 2Khz output if it has the same error percentage.
 
Post edited by k7elp60.
Oliverb, I was wrong on my last post.
Your crystal frequency of 32.768Mhz was correct and the output from the
74HC4060 of 2 Khz is correct.
I did some reasearch and found the following: According to a publication I have from Sieko Epson corp on crystals they had some recommendations on oscillator design. They recommended the for the crystals in the 5.5 to 30 Mhz range that the resistor in parallel with the crystal be 1M and the resistor in series with the crystal be 0.5K. The series resistor in my opinion would depend a lot on the drive requirements of the crystal. Perhaps the crystals supplied by Epson already take this into account.
From the CMOS cookbook by Don Lancaster, he recommends power supply bypass capacitors.
If you are measuring the output of the 4060 with a scope you will not be able to read the frequency accurately enough, unless the scope has a digital readout of the frequency or period.
On lower frequencies than you are using I have hooked a frequency counter to pin 9 (oscillator out) thru a x10 scope probe and been able to adjust the frequency of the crystal to exact amounts.
 
Thanks for the replies.

I do want exactly 1Hz.
I am using a 74HC4060 as this should work at 32MHz.
The Q14 O/P from the 4060 should divide this 32M by 16384 and give 2KHz. The same way as 32.768KHz would give you 2Hz.

Or are my calculations wrong?
I must admit I have never used anything greater than a 32.768KHz crystal before.

Bloki
Is this the same as harmonics?
Are the caps there to "tune" the crystal ie if you get them wrong you end up with double or half frequency.

Brett.
 
In general, ensure the power supplies are bypassed at the ICs, 0.1uf ceramics are good for this.

Is the oscillator running fast or slow?
If it is fast, you will need to add capacitance to the oscillator circuit, if it is slow, reduce the capacitance.

You say: "The sheet for the crystal says the cap value should be 22pF".
This is a rather vague statement, what does the crystal (data)sheet say exactly?
You have a 22pF fixed and a 22pf variable capacitor in series, that is a load of 11pF on the crystal (plus the wiring strays), this sounds too low to me.
Try increasing your 22pF fixed to 100pF as shown on the Phillips data sheet for the 74HCT4060.

JimB
 
The crystal Cap value is from here under Tech Data **broken link removed**

I have played around with various cap values for the fixed capacitor but not as high as 100pF as per the Phillips sheet. I think I will try a larger variable capacitor as well as some sheets say 39pF variable.

My device is made by ST their datasheet does not show any values for components and in fact omits the power limiting resistor.

I presume these devices are identicle?

I have not fitted any decoupling capacitors as yet do you think this could be my problem?

Thanks.
Brett.
 

Attachments

  • phillips.jpg
    phillips.jpg
    17.8 KB · Views: 1,921
  • st_309.jpg
    st_309.jpg
    10.5 KB · Views: 1,554
I must repeat myself. Generally there is nothing wrong with components in your oscillator. If timing error is 4sec every minute then the frequency of oscillator is about 2MHz out of specs. The oscillation frequency can not be wrong for 2MHZ if you choose 22pF or 100pF caps, but only few kHz. It is something wrong with the crystal. To check frequency of oscillator measure 2kHz output frequency from 4060 divider. It looks like your crystal is about 30MHz or 35MHz.
 
Bloki
Thanks.
My fequency meter is playing up but I may be able to borrow a scope from work.

By playing around with the caps I have managed to get a bit closer to 1Hz. It was running slow by 4 sec a min but by increasing the caps it now runs a bit fast I just cannot get it locked on frequency.

I agree with what you say the crystal should run at 32.768 MHz with the trimmer only changing the frequency by a few Hz.

I must admit I don't understand how this part of the cct works the data sheets have little or no detail.

I have noticed something when I touch the crystal case the O/P pulses at around 2Hz so it does seem a bit unstable.

Brett.
 
Crystal case must be grounded. It is normal that frequency changes if you touch it. You will be more successful and faster if you measure frequency instead of time error.
 
Success

I have managed to get the cct working at last!

See corrected diagram.

It seems the power limiting resistor was too high. It worked fine for a 10MHz crystal but I found I had to reduce it to 1.1K to get the cct to oscillator correctly with a 32.768MHz crystal.

I presume this was why I was unable to get a stable reading.

I will have to run the thing for a while to make sure the capcitor values allow me to adjust the fequency faster and slower than 1Hz.

I will update this post if I have to change anything.

Thanks for all your comments.
Brett.
 

Attachments

  • 1hz.jpg
    1hz.jpg
    19.6 KB · Views: 2,379
oliverb,

please understand that you are making the assumption that each counter just counts endlessly from 0 to 2 ^ (however many output bits) with the clock running.

I have a gut feeling that as soon as all bits are high (counter reached the end), they stay that way until the counter is reset.

to start, connect pin 11 of IC 5 to pin 2 of IC 5. This will produce the same effect, but you know that you will be guaranteed a pulse every time, because the output will work like this: ....00, .....01, .....00, .....01.
It will go to ....00 after ....01, because the moment ....10 is reached, it will only occur for just microseconds, and because bit 2 is connected to reset, it activates reset. Once reset is activated, all bits are 0, and the process starts over.

You should be able to knock off the 4060 and get a crystal at 1/2 speed.

I suggest replacing those 4017's with binary counters, and connecting 74LS47's and 7-segment displays to the outputs, because you could end up using more chips than necessary to decode the 4017's outputs to that compatible with a 7-segment display.
and to detect the number 10 in a binary counter, use an AND gate and connect bits Q3 and Q1 to the inputs. When the output is "1", then those bits are set. As soon as 10 is reached, the output is 1.

If the output names don't begin with Q, someone tell me the right names.
I'm trying to express bit #3 and bit #1 if the outputs are bit 0, bit 1, bit 2, and bit 3.
 
I have a gut feeling that as soon as all bits are high (counter reached the end), they stay that way until the counter is reset.
Your feeling is wrong. Counter count endlessly.
 
Brett,
Glad to hear you got it working like to wanted.
Ned
 
mstechca
I have built the cct and I can confirm it works. The only problem I had was with the oscillator.

The idea for this cct was to use as fast a crystal as possible and get a 1 Hz output using the least amount of dividing ICs.

I could have used a 32.368KHz crystal and only used the 1st 2 chips to get 1Hz output. I decided on the 32.768 MHz chip as it is 1000 times faster and only requires 3 extra ICs and a very small amout of wiring.

I am going to use 4026B ICs x 6 to drive the 7 segment displays possibly at 5volts if not at 12volts to get a bit more brightness from the displays.

Brett.
 
oliverb said:
The idea for this cct was to use as fast a crystal as possible and get a 1 Hz output using the least amount of dividing ICs.

I could have used a 32.368KHz crystal and only used the 1st 2 chips to get 1Hz output. I decided on the 32.768 MHz chip as it is 1000 times faster and only requires 3 extra ICs and a very small amout of wiring.

Why did you want to use as fast a crystal as possible?.
 
oliverb said:
I want to get the clock to run as long as possible without correction.

So why choose a higher frequency crystal?, I see no reason for a 32MHz one being better than a 32KHz one, in fact I would imagine the opposite is true?, the 32KHz crystals are designed specifically for keeping good time. A 32MHz crystal is way up at the top end of crystal viability, and probably not likely to be as stable? - in fact most crystals at those sorts of frequencies are likely to be overtone ones, rather than fundamental ones.
 
Any errors in the oscillation stage have a 1000 times more effect in a 32.678KHz crystal. Or put another way when you adjust the trimmer you have a 1000 time more sensitivity as it is divided 1000 times more.

In a year the 1Hz Output will pulse 1893456000 times in just a week it will pulse 2530080 times. 32KHz starts to look a bit slow.

The first quartz clocks ran at 8192Hz if slower is better why are most watches today running at 32KHz?



Brett.
 
oliverb said:
Any errors in the oscillation stage have a 1000 times more effect in a 32.678KHz crystal. Or put another way when you adjust the trimmer you have a 1000 time more sensitivity as it is divided 1000 times more.

Any similar FREQUENCY change will be 1000 times as much, but this relies on the 32MHz crystal being a 1000 times better quality than the 32KHz crystal - a similar PERCENTAGE change on either crystal will have exactly the same effect. There's no way the 32KHz crystal is going to be 1000 times better (if it's any better at all?), so I would expect the 32KHz crystal to most probably out perform the 32MHz crystal?.

In a year the 1Hz Output will pulse 1893456000 times in just a week it will pulse 2530080 times. 32KHz starts to look a bit slow.

Why would that be a problem?, all you want is an accurate 1 pulse per second.

Your figures also appear incorrect?, from memory there's 31,557,600 seconds in an average year (365.25 days) - I worked it out back in 1972 at college, on the first TTL based calculators - I can still remember the result (hopefully!) 33 years later. :lol:

The first quartz clocks ran at 8192Hz if slower is better why are most watches today running at 32KHz?

Because 32KHz is the most appropriate frequency, it divides easily to 1Hz, and is low power and accurate. An accurately trimmed 32KHz crystal should manage 5 to 10 seconds accuracy over a year.
 
Sorry my mistake I added an extra 60 x in my calculation. My point being that any errors are compounded the longer the clock runs.

32KHz crystals are used in quartz clocks/watches as thay have an acceptable accuracy for everyday use in batery powered devices.

8192Hz and 16384 are also powers of 2 and divide exactly into 1Hz. Double 16384 and you get the next generation 32.768KHz crystals in use today. Although they presumably used less power than the 32.368Kz crystals they were not as accurate. Remember the cheap digital watches around when you got your calculator? Thats why they increased the crystal frequency. If you are correct then the old 8192Hz watches would outperform anything around today.

32.678MHz is hardly the top end of crystals its around the middle of commonly available types.

Brett.
 
Status
Not open for further replies.

Latest threads

Back
Top