You also need a capacitor that stops dc current flow i.e. your circuit uses less current. The resistor matches the end of the transmission line so that reflections are absorbed and your clock signal works correctly.
Read on to find out how you can tell if you have this problem and find help on how to solve it.
Note: problems that you may encounter are - the circuit does not work at all or seems to operate randomly.
The PC revolution using faster computer processors has highlighted transmission line effects which, previously, were only really associated with radio cabling. It causes generally unreliable operation in digital circuits because it changes the voltage value and shape at the input to a gate.
Any wire pair (signal and ground path) can be a transmission line but it is not noticeable if the frequencies involved are low and the distance that the signal travels is short.
With the combination of higher frequencies and longer distances between components on a board, transmission line effects may cause problems.
You may think that you don't have to worry about it for your circuit operating at 1kHz but the problem is not the fundamental frequency but the total frequency. For a square wave it is the edges that are at high frequency. Edges are also used to clock data into digital circuits - so you may have a problem - depending on edge frequency and the distance that the signal travels.
Transmission line theory is a result of complex theory developed by Maxwell, Kelvin and Heviside which predicted the poor performance of a trans-Atlantic submarine able in 1858. The equations involve degree level mathematics which I won't go into (even if I could remember them). You only need the practical results.
Even if you did learn all about the equations the practicalities of applying them to hundreds of signals on a production board are too difficult. This is why you can buy a tool costing $3,000-$50,000 (plus $2,000 yearly maintenance!) that does the job for you - if you have the money! - just let your boss buy it. It's called Hyperlynx - and works extremely well - its simulations of PCBs produce results that are virtually identical to storage scope measurements and it even does cross talk calculations.
A rule of thumb for figuring out if you have a transmission line and not just a wire is:
You have a transmission line if...
The length of the wire is > (period of the signal / 10)
This is saying that the distortion caused by a transmission line effect does not matter if your signal is low frequency (high period) and the distance is short.
Another rule of thumb is that if your previously working prototype system just stops working when you plug it together (without the debugging cable between modules) - you may have a transmission line problem. This happened to me once and at the time I did not have any idea why - solving this involves adding damping resistors to the clock lines about 50ohms (absorbing reflections) - try experimenting with the value.
As an example of the first rule of thumb if you think of a 300MHz (sinewave) signal feeding into a wire...
The period of the signal is found from the equation (v=fL) L should be the greek letter Lambda (the period of the signal).
v - velocity
f - frequency
For this example assume that the signal travels at the speed of light - for a real signal it is impeded by traveling through a material and will be 0.6 to 0.88 times the speed of light.
L=v/f so L = 3e8/300e6 = 1 metres ~ 3ft.
So for this signal the only time you need to think of the wire it travels through it as a transmission line is if your wire length is longer than 1m/10 ie greater than 10cm (~4in). If you use a factor of 0.6 for a PCB then have a distance of 6cm.
So having got here you then say "well my signal is not going at 300MHz so I don't need to worry about it"
This would be true if you were using sinewaves but you are using square waves. Which brings us to Mr. Fourier and fourier analysis which like Maxwell's equations I wont look at. Lets just use his results.
Mr. Fourier's mathematical analysis shows that any signal is made up of sine waves added together. The important point is that the sharper the edges of the square wave the faster the sinewaves needed to make up the square wave.
This is why even for slow signals the rise/fall time of the signals edgedetermines whether or not you will see transmission line effects.
Unfortunately using the clock edge is the way that data is loaded into digital circuits so the signal quality at the clock edge is vital.
Incidentally this is why you can make a frequency double tripler etc. If you look at a square wave on a spectrum analyzer you will see sinewaves composed of the fundamental frequency with odd multiples of the fundamental. Filtering out one of these harmonics gives you a sine wave the higher frequency.
For a typical digital chip e.g. 74LS373 the typical slew rate is approximately 1ns per volt. A voltage swing of 3V takes 3ns.
So what frequency is the edge...
f=1/Period = 1/3E-9 = 333MHz
Note: This edge frequency is independent of the signal frequency. So you can not get rid of transmission line effects by reducing the signal's frequency e.g. you may have a signal going at 1kHz but the edges will cause the effect of a 300MHZ transition! Also you can not reduce the slew rate to the gate (by adding a large capacitor) as the gate will oscillate.
When the high frequency edge reaches the input gate - without correct termination - the signal is reflected back down the wire. Amazingly this reflection adds to the signal that is still traveling up the wire! This action is similar to a wave traveling through water - when it hits a wall it is reflected (violently) - equivalent to an open circuit. If you imagine a beach - the wave is gently lost - a short circuit. If you put a sponge instead of a wall then the wave would be absorbed - correctly terminated.
The reflection can be negative voltage (depending on the signal frequency, the characteristic impedance and the input impedance of the gate).
So over a short period of time you will see a range of voltages at the input to the gate causing the 'edge' to be ragged - this then clocks your circuit in the wrong way.
The solution to the problem is to terminate the transmission line. If you investigate transmission line theory you find out that a transmission line has what is known as a characteristic impedance.
If you add a termination resistor that is the same value as the characteristic impedance then instead of the signal being reflected back down the wire it is absorbed.
When done correctly the circuit will behave exactly as you expect. Magically all the problems disappear and your circuit will be clocked correctly.
There are about eight different termination schemes e.g. Thevenin, serial, parallel, parallel ac, parallel dc etc. but you only need to worry about this one: the parallel ac termination.
This termination scheme is easy since...
Here's what you do
Add a capacitor and series resistor as shown in the diagram - change the resistance depending on where you are working i.e. 50, 100 or 300 Ohms - you don't have to be exact - You can find published information on-line for the characteristic impedance that your connection needs - use 56Ohm for pcb, 120ohm for twisted pair (read parallel cable or serial cable). If you work with RF circuits the values do have to be exact.
For the capacitance on PCB use 33pF, twisted pair (cables) use 470pF. Note you may have to fiddle with these values to find the best one (using a good scope of course).
Note place the terminator at the end of the cable/track as close as possible to the input of the gate you are driving.
Jump from Transmission
Best-Microcontroller-Projects Home Page
The Essential Guide to the 74HC595; What it is and how you can easily use one in any of your projects.
Which pic programmer do you need? This page discusses PIC programmers and gives some essential information on choosing or building your own programmer.
learn how to use Arduino pulseIn and pulseInLong to get the most accurate pulse measurement on an Arduino.
How to use Arduino millis() for deylays but still make the processor do work - Stop using delay()
This MCP23017 Interrupt tutorial shows you how to connect interrupt outputs from several MCP23017s to a single microcontroller interrupt pin.
Arduino Delay() is a useful function but not for large programs - Find Out Why Here...