# Curious about the 4060 integrated circuit

Discussion in 'Circuit Help' started by kong, Jan 9, 2013.

1. ### kong

Joined:
Sep 26, 2010
Messages:
122
2
The 4060 seems like a very versatile and significant IC.

I followed a schematic that used it to divide down a freq, and now I'm curious about what else it can do.

Does anybody have any experience with it?

I was wondering how to calculate R/C values for it

Thanks for any replies

kong, Jan 9, 2013

2. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

Joined:
Jan 21, 2010
Messages:
22,862
1,985
Location:
Mid way between Beijing and the Ronne Ice Shelf
Check out the datasheet (which should be your first stop if you have a question about a device) -- specifically the bottom of page 5.

Last edited: Jan 9, 2013
(*steve*), Jan 9, 2013

3. ### KrisBlueNZSadly passed away in 2015

Joined:
Nov 28, 2011
Messages:
8,393
1,261
Location:
Wellington, New Zealand
That's about all you can use it for!

It's just a ripple carry counter with some gates for making an oscillator with.
You can make it divide by a specific number, rather than just powers of two, by ANDing several outputs together and feeding the AND gate output into the reset pin. When the count reaches the desired value and all outputs are high simultaneously, the counter resets to all zeros and starts counting again. You don't get a square wave out of it though; if you want 50% duty cycle, you can divide by half the number you want, then feed the output through a toggle flip-flop.

The 4060 has lots of stages, but not all the outputs are brought out. This can mean that you don't have access to a frequency you want, although it's being generated inside the device.

You can use the gates with a crystal, such as a 32768 Hz "watch crystal", so you can obtain a 1 Hz clock. (I think you need one or two extra divide-by-two stages to get the frequency down to 1 Hz.)

You can use the inverters with a resistor and a capacitor as an oscillator. There are only two inverters, so you have to use the two-gate version of the oscillator that (apparently) has some issues. (I've used it a lot in experiments, and not had problems, but YMMV and I wouldn't use it in a design for manufacture.)

There is a standard formula for calculating frequency from R and C for a two-gate CMOS oscillator. If it's not in the 4060 data sheet, try data sheets from other manufacturers, or try the data sheets for other CMOS gates such as the 4069 or the 4049. You should be able to find it somewhere.

Last edited: Jan 9, 2013
KrisBlueNZ, Jan 9, 2013
4. ### kong

Joined:
Sep 26, 2010
Messages:
122
2
Thanks guys,

yeah I used it to divide down a 32768 crystal to 1hz using another flip flop chip (4027) although I'm fairly certain any flip flop will work, to 1hz then down to 0.5hz. I thought that was pretty neat and it offers a pretty accurate clock signal for counters and such.

Any reason why the 4060 doesn't bring out all the outputs? Just out of curiosity.

I'll search for the formula and try out an RC configuration since I've already experimented with a crystal.

Have you ever worked with a crystal in your experiments with the 4060?

If so, what cap values did you use for the crystal you were using?

kong, Jan 9, 2013
5. ### KrisBlueNZSadly passed away in 2015

Joined:
Nov 28, 2011
Messages:
8,393
1,261
Location:
Wellington, New Zealand
Yes it's a convenient timebase.

Yes, it doesn't have all the outputs brought out because there aren't enough pins! The designers decided that it was important to have 14 division stages, and they only had 10 pins available for outputs on the 16-pin package (after allocating VDD, VSS, reset, and three pins for the oscillator). At the time the 4060 was designed, few ICs had more than 16 pins. They chose the outputs they thought were most important or useful, I guess.

The CD4020 is similar, without the oscillator. It also has several outputs missing. The CD4040 is a 12-stage counter with all outputs brought out. It doesn't have an oscillator, just VDD, VSS, clock in, and reset, so there are 12 pins available for outputs. There's also the CD4024.

Any flip-flop that can be configured as a T flip-flop ("toggle"), i.e. a divide-by-two stage, will work. You can use a 4027, or a 4013 with its D input tied to its Q-bar output.

Yes I have used a 32768 Hz crystal with the 4060. The capacitor values are calculated in the normal way for a Pierce oscillator using an inverter. Take the specified load capacitance of the crystal (usually 6 pF or 12.5 pF for these crystals), double it, and subtract a few pF to cover stray capacitance and gate input capacitance, and use the resulting value for both capacitors. For example if the load capacitance is specified as 6 pF, I would use two 10 pF or 8.2 pF capacitors.

You also have to be careful with the resistor values. Watch crystals have to be driven at quite a low power. The resistor from the gate output to the crystal needs to be quite high. I think I used 100k. The gate bias resistor (across the crystal) should be as high as possible; 10M is good.

KrisBlueNZ, Jan 9, 2013
6. ### kong

Joined:
Sep 26, 2010
Messages:
122
2
Mmm. That's interesting about the 4060. Good background.

The circuit I was using with the watch crystal (32.768kHz) used 33pf caps. On the datasheet for the crystal, it specified 12.5pf...doubling it comes to 25...so 33 seems a little high...more like 22 or something. When you say stray capacitance are you referring to board capacitance and wire length and things like that?

I also had another question regarding the 4060 outputs...I read somewhere that since there is a delay (albeit very slight, but significant in the digital logic world) in a ripple counter like the 4060 that there can be glitches when a ripple counter is connected to another logic IC? What exactly does that mean and why is it avoided?

Also is there a difference between bistables (like a 555) and flip flops?

And finally yeah the circuit I used used two 6.8M resistors in series for a total of 13.6M for the bias resistor (which does what? haha) and a 330K for the current limiting one.

If I'm asking too many questions just let me know haha

kong, Jan 9, 2013
7. ### KrisBlueNZSadly passed away in 2015

Joined:
Nov 28, 2011
Messages:
8,393
1,261
Location:
Wellington, New Zealand
Yes, stray capacitance is capacitance between PCB traces. If you have a groundplane, keep it away from the crystal oscillator. There's also the capacitance of the gate input on the 4060 which is a few pF.

Right, with a crystal specified for 12.5 pF loading I would use 22 pF or 18 pF caps.

Re delays. The 4000 CMOS devices are not exactly FAST. And you can imagine from the name "ripple carry" that changes "ripple through" the cascaded divider chain. Q1 is the first to change, then Q2, then Q3, and so on. This happens more or less on every transition of Q0 from high to low, when Q1 changes. The worst case is the full 14-bit wraparound from 11111111111111 to 00000000000000. At that time, if you watch the outputs in slow motion, you'll see the following sequence of output values:

Q14 . . . . . . Q1
11111111111111
11111111111110
11111111111100
11111111111000
...
11000000000000
10000000000000
00000000000000

So if you were using the 14-bit count, or parts of it, as an actual number, and your connected device happened to sample those outputs while they were rippling, it would read the wrong value.

If you're just using the outputs for different frequencies, there shouldn't be a problem.

The 555 is not a bistable. You can connect it as an astable (oscillator) or monostable (one-shot) but it is not a latch, and it is not a flip-flop, although it contains one internally. It is not designed to provide divide-by-two operation like a T (toggle) flip flop.

The resistor across the crystal provides bias to the input of the gate that is being used as the oscillator. It biases the gate into its linear region, so it operates as an amplifier rather than a logical gate or switch. Google some of those keywords for more information.

Last edited: Jan 9, 2013
KrisBlueNZ, Jan 9, 2013
8. ### kong

Joined:
Sep 26, 2010
Messages:
122
2
Mm okay, neat.

So for the 4060/4027 clock generator it probably wouldn't work well on a breadboard (at least over time) because there has to be quite a bit of stray capacitance there. heehee. In terms of temperature stability when dealing with crystals, specifically watch crystals, I read that at least on wristwatches, your body heat actually helps keep the time accurate by providing a steady, temperate environment for the crystal.

Knowing that, it seems battery powered analog clocks would be slightly less accurate because they rely on room temperature, rather than body temp.

I've also heard that some clocks use 'crystal ovens', or even Styrofoam surrounding the crystal to prevent against temperatures changing too quickly and throwing off the oscillations.

As for the 4060,

if you were trying to display information from the 4060 outputs....say on a 7 segment or in binary using individual LEDs, it would glitch, because of the delay, is that what you're saying? (it wouldn't read the correct number)

Doesn't the 74HCT combine the low power characteristics of the 4000 series with the speed of TTL 7400? It was either that or 74HC....

kong, Jan 9, 2013
9. ### kong

Joined:
Sep 26, 2010
Messages:
122
2
But if you just connect a transistor switch to a 4060 output there wouldn't be a glitch? It's only when it's interfacing with logic gates (OR NOT AND etc?)

kong, Jan 9, 2013
10. ### BobK

Joined:
Jan 5, 2010
Messages:
6,579
1,308
Location:
Worcester, MA
No, it is only when looking at multiple outputs at the same time and expecting them to be consistent. It has nothing to do with what you are using to look at them. There is no glitch in a single output, the glitch is in the fact that multiple outputs do not all change at the same time.

Bob

BobK, Jan 9, 2013
11. ### KrisBlueNZSadly passed away in 2015

Joined:
Nov 28, 2011
Messages:
8,393
1,261
Location:
Wellington, New Zealand
Right, I wouldn't put a crystal oscillator on breadboard. For experimenting, you can just bend the IC leads up and solder the crystal, capacitors and resistors directly onto them.

I don't know if crystal-based clocks would be less accurate than wristwatches. I haven't done any testing.

Yes, high accuracy oscillators use crystal ovens where the crystal is kept at a constant temperature. You will find these in bench frequency counters, and radio equipment I think. Their purpose is not to prevent rapid frequency changes; it is simply to keep the crystal at a specific constant temperature, so the frequency won't drift over time as the ambient temperature varies.

Right. For example, if you passed four adjacent bits from the 4060 to a binary-to-seven-segment decoder and to a seven segment display, you would see the number count from 0 to F and round to 0 again. There would be tiny glitches, but nothing long enough to be visible. We're talking about propagation delays less than a microsecond.

The 74HCT series is the same as 74HC apart from the input voltage thresholds, which are chosen to be compatible with TTL and LSTTL so they can be mixed. I don't think there's any speed difference. Download some data sheets and check. I would be interested to know.

If you're concerned about the temporary incorrect output values on a ripple carry counter, you can synchronise the outputs with a latch such as 74HC374. The 4060 increments and ripples on the falling edge of the final clock input, and the HC374 clocks data on the rising edge, so if you clock the HC374 from the 4060's final oscillator pin, all its outputs will change at once. But this isn't needed in most applications.

KrisBlueNZ, Jan 9, 2013
12. ### kong

Joined:
Sep 26, 2010
Messages:
122
2
http://www.nxp.com/documents/data_sheet/74HC_HCT154.pdf

Here is a datasheet for the 74HC154/74HCT154....on the first page it says they are both high speed CMOS devices.

Here is another site which I work from quite regularly and is very informative and easy to understand.

http://www.kpsec.freeuk.com/index.htm

I think they have a chart on the different families that compares them.

So for Flip Flop ICs, you said that the 4027 and one other can be configured to divide the frequency on the CLK input, but are there other types too?

I read somewhere that they also store information....and apparently they are very simple. But I'm not sure exactly what makes them so valuable in digital electronics and the other things they can do.

kong, Jan 9, 2013
13. ### KrisBlueNZSadly passed away in 2015

Joined:
Nov 28, 2011
Messages:
8,393
1,261
Location:
Wellington, New Zealand
A flip-flop can store one bit of information. It is like a memory location with one bit of storage. http://en.wikipedia.org/wiki/Flip_flop_(electronics)

There are several types of flip-flops and latches. D-type (CD4013, dual, 74HC374, octal), JK (CD4027, dual), SR (set-reset) and transparent (74HC373, octal) are the main types. A T flip-flop (toggle) divides the input frequency by two and can be made from a D-type or a JK flip-flop.

Look at data sheets first. If they don't really explain the behaviour of the flip-flop or latch, try Wikipedia or Google the part number or other keywords. They are all described somewhere on the net.

Last edited: Jan 9, 2013
KrisBlueNZ, Jan 9, 2013
14. ### kong

Joined:
Sep 26, 2010
Messages:
122
2
Awesome!

Thanks for all your help & time man!

kong, Jan 9, 2013

Joined:
Nov 28, 2011
Messages:
8,393