Clock in every device we use???!!!

Thread Starter

Nathan Hale

Joined Oct 28, 2011
159
Hello Folks! hope all is well.
I started learning about digital electronics. its pretty cool stuff.
i also have a really old and big function generator.
i learnt that a clock is nothing but a square wave function generator.
Every circuit i see needs a clock for it to do whatever it is supposed to do.
My question to you guys is ....do all the devices that need a clock have a function generator in them? ( i am sure my microwave has a clock but not a function generator in it) or do manufacturers put in a clock that spits out only one frequency? where can i find circuits and diagrams of these single frequency clocks.

thank you
 

WBahn

Joined Mar 31, 2012
30,077
Hello Folks! hope all is well.
I started learning about digital electronics. its pretty cool stuff.
i also have a really old and big function generator.
i learnt that a clock is nothing but a square wave function generator.
Every circuit i see needs a clock for it to do whatever it is supposed to do.
My question to you guys is ....do all the devices that need a clock have a function generator in them? ( i am sure my microwave has a clock but not a function generator in it) or do manufacturers put in a clock that spits out only one frequency? where can i find circuits and diagrams of these single frequency clocks.

thank you
Not all digital circuits need a clock. The general distinction (and it's a crude one) is that combinatorial circuits do not need a clock while sequential circuits do. But there are plenty of sequential circuits that do not use a clock signal -- these generally fall into the category known as "asynchronous" circuits.

When a clock signal is needed, it can be obtained from a variety of sources or produced in a variety of ways. If it is generated internally, then some type of oscillator is needed. There are many, many types of oscillator circuits that can be chosen from, depending on the constraints of the design.
 

WBahn

Joined Mar 31, 2012
30,077
In order to generate square waves to use as a system clock, look up 555 astable timer circuits and crystal oscillators.
Those are but two of the possibilities. You can also use an off number of inverters to form a ring oscillator. You can also use a transistor and a few resistors and capacitors to make an oscillator. Lots of options.
 

#12

Joined Nov 30, 2010
18,224
Some counting chips and a lot of microprocessor chips come with oscillators in them, only awaiting instructions about how and when to run.
 

MrChips

Joined Oct 2, 2009
30,824
The CLOCK in a digital circuit is a generalized name for the signal that triggers the transition from one state to another state. It is not limited to continuous sequence of square waves. It can also be a single transition from low to high or from high to low.

Hence your concept of a CLOCK being a function generator is only one type of clock.

The purpose of a function generator is usually to provide a signal for testing any variety of electronic circuits.

We do not use the term "function generator" when describing function blocks in a circuit. The term "oscillator" is the correct term.
 

Reloadron

Joined Jan 15, 2015
7,523
My question to you guys is ....do all the devices that need a clock have a function generator in them? ( i am sure my microwave has a clock but not a function generator in it) or do manufacturers put in a clock that spits out only one frequency? where can i find circuits and diagrams of these single frequency clocks.
Well, as mentioned, no all digital devices have a clock in them or function generator in them. Actually "function generator" is a pretty broad term. I have function generators that output a wide range of signal types like sine, square, and triangular waves. As to clock circuits or oscillators as used in circuits or found on circuit cards? They can be a single package like these in a variety of fixed frequencies from a variety of manufacturers or they may consist of a crystal on a board with a few supporting components forming an oscillator or clock circuit as mentioned. Here are some examples and note that many do not even use a crystal.

So as you see a Clock or CLK for a circuit can have many names and flavors so to speak. :)

Ron
 

BillB3857

Joined Feb 28, 2009
2,571
Sometimes even a simple pushbutton switch can be used as a CLOCK source. As an example, a reset button on a stopwatch. For a digital alarm clock, the line frequency (50/60 Hz) can be used as a CLOCK signal to drive the clock (pun intended)
 

Thread Starter

Nathan Hale

Joined Oct 28, 2011
159
OK. I get it now. But all the oscillators and clocks out there are producing frequencies in millions of hertz. How or where can I find a clock that has a frequency of one hertz? I am making a up counter from the all about circuits book and if I use a clock with more than twenty hertz frequency the 7 digit display will keep showing the number eight always. Where can I get a one hertz clock or how can I make one myself? Thanks
 

Reloadron

Joined Jan 15, 2015
7,523
I would just do as WBahn suggest depending on how accurate you want your clock frequency to be. It can be as simple as a 555 timer or more elaborate for accuracy. If mains frequency is accurate enough I could use a pair of for example 4017 Decade Counter Dividers and divide my 50 or 60 Hz mains frequency by 50 or 60 to get 1 Hz. There are hundreds of circuits out there using the 4060 12-Stage Ripple Carry Binary Counters as another example. A Google of 1 Hz Clock Circuits will bring up a hundred example of 1 Hz clocks. Just a matter of what you want and how accurate you want it to be.

Ron
 

ErnieM

Joined Apr 24, 2011
8,377
If all you wish is a slow clock with limited accuracy then a '555 may be the cheapest and easiest way to go.

Should you wish for more accuracy (to say make a clock to keep time) you need more accuracy. One common way to get this is to use a crystal as the timeing element, as crystals can be made very accurately. However, the lower the frequency the larger the crystal, and the highher the frequency the more current to run it is needed. Thus an establshed compromise is to use a 32.768KHz crystal, also known as a "watch crystal." This is fairly simple to divide by 15 flip flops to get a 1 Hz (once per second) output.

This guy has a nice write up on this. I am sure you can google other solutions.
 

alfacliff

Joined Dec 13, 2013
2,458
"all the clocks are producing frequencies in millions of hertz"? how about the 32.768 hz crystal oscilators in watches and clocks? the clocks are designed to synchronize the operations of the circuits they are used in. dynamic logic circuits require clocks to work, static circuits do not. dynamic RAM chips will probably be bad if the clock quits, static RAM chips will be ok.
 

MrChips

Joined Oct 2, 2009
30,824
Slight typo error. You mean 32.768kHz or 32768Hz.

Why this particular frequency? All quartz crystal oscillators vibrate at relatively high frequencies.
So the challenge is - what this the lowest reliable frequency of oscillation that is easily divisible by simple logic circuits?
The answer is a frequency that is a power of 2.

2^15 is 32768

Hence 32768Hz is your common watch quartz crystal.
 

WBahn

Joined Mar 31, 2012
30,077
There are three huge advantages to the 32.768 kHz crystal. Because it is used in nearly every watch on the market, it is extremely cheap. Because it is used for long-term time keeping, it is extremely accurate. Because it is used in power-sensitive devices, it is extremely low power (this is due to the relatively low frequency, of course).
 

ErnieM

Joined Apr 24, 2011
8,377
I wouldn't go as far as to say the average 32.768 KHz crystal is "extremely" accurate. It is decent enough over the short haul, but give it a year and watch the minutes tick by in error (or not tick by in case it runs slow). They are dependent on temperature and loading capacitance.

The better ones come in sealed packages with the oscillator built inside.

The best ones come with a complete curcuit that monitors the temperature and provides correction. Accumulated errors as perhaps a second or two over a year (from memory, they might actually be better than this).

Not bad in a chip you can buy for a couple of bucks in single quantities.
 

WBahn

Joined Mar 31, 2012
30,077
I wouldn't go as far as to say the average 32.768 KHz crystal is "extremely" accurate. It is decent enough over the short haul, but give it a year and watch the minutes tick by in error (or not tick by in case it runs slow). They are dependent on temperature and loading capacitance.

The better ones come in sealed packages with the oscillator built inside.

The best ones come with a complete curcuit that monitors the temperature and provides correction. Accumulated errors as perhaps a second or two over a year (from memory, they might actually be better than this).

Not bad in a chip you can buy for a couple of bucks in single quantities.
Fair enough. I should have established the scope in which I was talking -- namely basic crystals for non-compensated circuits. I certainly wasn't claiming that a 32.768 kHz watch crystal is going to be as accurate as a self-contained, temperature compensated (or even oven-controlled) oscillator costing many times (often ten to fifty times) as much. A 32.768 kHz watch crystal can be bought in single units of 42 cents with a tolerance of 10 ppm from DigiKey and 20ppm crystals in quantity for under 17 cents each. On the other hand, they have lots of crystals in the MHz range that are well over a dollar for 100 ppm frequency tolerances.

Having said that, like so many things in the electronics world, the availability of tight tolerance parts at low cost has exploded over the last couple decades. It used to be that there were a handful of crystal frequencies that had low-cost, tight-tolerance parts due to extremely high volume for TV tuners and other high volume consumer electronics. You can now get 10 MHz, 10 ppm crystals in onezies for under 50 cents.

The watch that I currently wear (a basic Seiko watch that I've now worn for coming up on 25 years) typically gains about two minutes by the time it's ready for a new battery every couple years. I can't remember the last time that I adjusted the minutes except when changing a battery. Since 10 ppm is about 5 minutes a year, I'm pretty impressed. My prior watch, also a basic Seiko, actually did a bit better than this. Now, that's great average performance; I don't know what the stability has been like when I'm outside in subzero temperatures or in the summer heat.

FWIW: Digikey has two 10 MHz, 0.1 ppb (yes, ppb) oscillators available for only $1800 each. To get into the 1 sec/year range (30 ppb) you are looking at about $42 each.
 

ErnieM

Joined Apr 24, 2011
8,377
Oops... I should have either done the math or looked up what part I was talking about: PCF2129AT, $3.08 single quantity, rated ±3 ppm from -15°C to +60°C. So substuitute "minutes" when I said "seconds".

The accuracy of those 17 cent crystals is still amazing.
 

WBahn

Joined Mar 31, 2012
30,077
That's why I've always loved using the line frequency. Things have changed, for the worse, over the last couple decades but you used to be able to count on a clock that used the powerline frequency always being within 2 sec of the correct time (if originally set to the correct time, of course) as long as you didn't suffer any power outages. In places with good power lines you might lose power one or twice a decade (we used to lose it once or twice a month, but it has gotten a LOT better in the last couple years).
 
Top