5. Clock Generator Circuits

Description:

In this experiment we are going to design a circuit that generates an automatic clock signal, which we can use to drive our digital circuits. So far, we have 'clocked' our circuits manually, but an automatic solution would be preferred if we wish to clock many times in a row. Also, one limitation is that we need a clock signal that is slow enough to see what is happening in the circuit - if we were to have a clock signal of 1 MHz, we would not be able to observe the changes in the circuit as they would occur at the rate of 1,000,000 times per second. We will examine the use of the 555 Timer to output a very low frequency rectangular clock pulse of approximately 1Hz, which we can use to drive our TTL circuits.

Note: The full set of videos is presented on the YouTube channel: DerekMolloyDCU

Table of Contents:

Introduction

As we have discussed with flip-flops in the course notes, they have two stable states; therefore, they are bistable multivibrators. There is also a type of circuit that has no stable stages - we call this an astable multivibrator and the 555 timer can be used in this way.

Video

The 555 Timer as an Astable Multivibrator

The 555 Timer is a TTL compatible IC that operates in three modes: Monostable, Bistable and Astable. The astable mode allows the timer to operate as an oscillator that outputs a continuous rectangular pulse of a designed frequency. This is a very popular chip that is used widely in electronic circuits because of its stability and its low cost. Please see the Make:Electronics book or here for more detailed information on this timer IC.

Background

The 555 Timer can be used to generate clock signals of a very high frequency, but we will use the timer to output a very low frequency rectangular clock pulse of approximately 1Hz, i.e. 1 cycle per second. This will allow us to see the effects of the clock pulse on our circuit.

Figure 1. The 555 Timer (NE555P) Pin Layout

Figure 1 illustrates the pin layout of the 555 timer that is in your kit, the NE555P. The 555 timer is a versatile device that can be used in several different configurations. For this experiment we don't need to be overly concerned with the function of each pin as we are choosing only one configuration -- astable mode.

In the astable mode configuration we need two resistors (R1, R2) and two capacitors (C1, C2) to design a circuit that will operate at the frequency required. The frequency and duty cycle (explained below) are controlled with these two resistors and the first capacitor. The threshold level is usually 2/3 of Vcc and the trigger levels is usually 1/3 of Vcc. Through some clever circuitry, these levels cause an internal flip-flop to be set and reset. This IC can operate in the range of 5V to 15V, but if we use a 5V supply then it is compatible with our TTL circuitry.

Figure 2. The 555 Timer used in Astable Mode

Figure 2 illustrates a 555 timer configuration for astable mode operation. The capacitor C2 is optional and is dependent on the application, but decoupling CONT to GND through a capacitor can improve operation. We will use a value of 10nF for C2. Now, we must choose values for the other three components - in astable mode the frequency (f) of the clock signal can be designed by choosing appropriate values of R1, R2 (in Ω (ohms)) and C1 (in farads) as follows:

Where the high pulse time is given by:

And the low pulse time is given by:

These equations describe how we can choose these 3 values to decide on the frequency of our signal and the high and low times of our signal. The ratio of high to low time in a single period of our signal is called the duty-cycle, or more particularly the fraction of the time that the signal is high. With the 555 timer the minimum value of R1 in this configuration is typically 1kΩ and this means that we cannot get a perfect 50% duty cycle - If we make R2 >> R1 then we can get close. If we set R1 < 1kΩ it will draw excessive current and could damage the 555 IC.

Figure 3. The Clock Cycle and the Duty Cycle

Figure 3 illustrates the clock signal that we wish to generate. Our signal has a period T, and therefore a frequency of f=1/T. In our case we wish to have a frequency of approximately 1 second, with thigh = tlow = 0.5 sec. The duty cycle:

which in our case = 0.5sec/1sec = 0.5 or 50%.

Our Circuit Calculations

We wish to have a frequency of approx. 1 Hz, so we can have to pick values for R1, R2 and C1 that are readily available from our kit.

We wish to have a duty cycle of approx. 50% so we will choose R1 to have the value of 1kΩ.

We wish to have a frequency of approx. 1Hz, so f = 1Hz

So, lets substitute these values in to the first equation:

giving,

therefore by cross-multiplying,

and dividing by ln(2).C1,

We now have R2 in terms of C1, so we can choose an appropriate value for R2 based on the values of C1 that are available to us:

If we plot R2 against C1 in this expression using Wolfram Alpha - we get a graph like:

Figure 4. Assistive plot of resistance is on the y-axis(Ω) and the capacitance value is on the x-axis(Farads)

So, if we choose a value of C1 of 47µF we get a value of R2 of 14.6kΩ - we can get this resistor value by putting a 10kΩ and 4.7kΩ resistor in series.

Our Circuit Implementation

So, we will implement our circuit as follows:

Figure 5. The 555 Timer implementation from the side view.

Figure 6. The 555 Timer implementation from the top view.

Use the wiring diagram from Figure 2 to get a circuit like that in Figure 5/6. Once you have the circuit fully wired then connect the power and you should see the LED on the right flash approximately once per second. Note in Figure 6 that the value of R2 is made up using a 10kΩ and 4.7kΩ resistor in series, giving us a value of approx. 14.6kΩ.

To finish off we will tidy it up a little and include a small green LED to indicate when the high part of our clock cycle takes place. Please make this circuit as neatly as possible on your breadboard as we will use this circuit over and over in the next few experiments.

Experiments for you to try!

Experiment 1:Add a new red LED to the circuit that flashes when the clock cycle is low. Use whatever logic is required and take care to use a suitable resistor for the rating of the red LED.

Answer:

Experiment 2: Add a seven-segment display to the circuit that alternates between the number '1' when the clock is low and '2' when the clock is high.

Figure 7. The 7 Segment Display that is in your kits. It is a common cathode display where you will need to connect either cathode in the same way as you would with a typical LED.

Video 3. The 555-Timer and 7-Segment Question Example

Solution Video:

Video 4. The 555-Timer and 7-Segment Display Solution

Conclusions

This experiment has provided us with a useful tool for future experiments. Rather than manually clocking our flip-flop or counter circuits, we will be able to automatically clock our circuits. The 555 timer also works at much higher frequencies and is a useful timer for small circuits that you may wish to build - which explains why up to a billion of these timers are sold annually. Whether you wish to design the next McDonald's Happy Meal toy, or (aiming a little higher) the next alarm sensor!

Discussion

In this experiment we needed a clock cycle that was of a low enough frequency that would allow us to observe the changes in our circuit. However, for general use there are better alternatives to the use of the 555 timer. For example, crystal-controlled clock generators use an accurate and stable quartz crystal that is cut to an exact shape to vibrate at an exact frequency. These crystal oscillators typically deliver frequencies from 10kHz to >200MHz and are not affected by aging or temperature. This is the clock generator that is used in microprocessor based systems, including your own PC.

Again, do not disassemble this clock circuit as you will need it in the next experiments.