Lab Manual Spring 2004
Lab Manual Spring 2004
Lab Manual Spring 2004
Laboratory Manual
Contents
1. 2. 3. 4. 5. 6. 7. Lab Kit Description Suggestions on Project Management IC Descriptions Instructions for Drawing Circuit Schematics Circuit Breadboarding and Wiring Lab Kit Familiarization Project Grading Guide
Revised January 2004 Please send any comments and corrections to Dr. N. J. Davis IV, ndavis@vt.edu
4. 5.
TIMELINE: Failure to manage your available time is the single biggest problem in completing your projects How many days or hours until the due date? Start your projects early. Expect problems to occur and allow time to resolve them. Do you have other concurrent projects or tests that impact the completion of this project? Budget your time so as to get the project done at least 2 days before the due date to allow for unexpected events. Many projects take 4 times the amount of time that you have budgeted. In half the budgeted time, have you finished more than half the project? Check to see if there is a list of names, waiting for validation, on the CEL whiteboard. CRITICAL ITEMS Do you understand the assignment? If you are stuck on a question or concept, ask someone NOW! Fill out your validation sheet items with a pen, not a pencil. The CEL supports multiple sections of 5 courses and over 700 students. Plan for crowds. The validation queue in the CEL increases as due dates approach. Most classes validate the same week, then skip a week. Logon and test your project BEFORE requesting that a TA come to you for a validation. What if one of your chips is bad? Before turning in the project deliverables, make sure you have included everything. All items you turn in must be well documented and referenced in the body of your report. LAST MINUTE THINKING What works? What doesnt work? Am I using the same old technique that has failed? What about a fresh approach? Can I get partial credit on the validation? How can I improve this process so I dont end up here again? When should I cut my losses and stop wasting time and CEL resources? TROUBLESHOOTING SUGGESTIONS Check for chips installed backwards (i.e., is pin 1 of the chip where you think it is on the breadboard)! Check ALL of your power and ground pins on ALL of your chips. Compare signal by signal with your simulation. If you wired something incorrectly, it will probably look right to you repeatedly. Have someone else check your circuit. Don't plan to do your project design and construction the night before it is due, run to the CEL to get it validated on the way to class, and somewhere along the way write the project report. If everyone does this, there will be a crowd in the lab, and you may not get your project validated in a timely fashion. Learn how to use the chip tester in the CEL. Make sure that all enable, clear, set pins are properly connected. Never leave input pins open.
3. IC Descriptions
Much more information on the ECE 2504 Integrated Circuit chips can be found on the CEL Web Page under Data Sheets. Your chip set should contain the following parts: Qty 3 2 2 1 1 1 5 # 7400 7404 74153 74175 74283 TIL321A Description 2-input NAND Gates Hex Inverters Dual 4-input Multiplexers Quad Positive-Edge Triggered D Flip-Flops 4-bit Adder 7-Segment LED Display 330 Ohm Resistors
Note: Parts labeled 74xx and 74LSxx are functionally identical. The LS parts are faster components (lower propagation delays). Refer to Figures 1-4 for pin assignments of the ICs used in this course.
7400
7404
Figure 1: Pin Assignments for 7400 and 7404.
H denotes high (logic level 1) L denotes low (logic level 0) X denotes dont care Figure 2: Pin Assignments and Function Table for 74153
Vcc
16
Q4
15
Q4
14
D4
13
D3
12
Q3
11
Q3 CLOCK
10 9
74LS175
7 8
CLEAR
Q1
Q1
D1
D2
Q2
Q2
GND
Vcc
16
B3
15
A3
14
S3
13
A4
12
B4
11
S4
10
C4
9
b a ci FA co s
a b ci FA co s
s co FA ci b a 1 2 3 4
co ci a FA b 5 6 7 8
74LS283
B1 C0 GND
S2
B2
A2
S1
A1
Display Elements t y u z w v
Example connection: Segment w lights when Nand gate output equals logic 0 (0 volts). logic 1 (+5v) A
xwA v d
A - anode d - decimal point
330
0
1 2 3 4
b d c b d c b d c b d c b d c b d c b d
a 5 6 7 a 8 9 a
Figure 4: Pin Assignments for the TIL321A.
Figure 5. Example Logic Diagram In addition to gate-level logic diagrams, students will generally be required to submit a final IC device-level wiring diagram as part of their lab report. This diagram may also be reviewed by the GTAs as part of the lab validation process. The IC device-level diagram shows the complete, final circuit that is to be implemented on the Pencilbox using the individual IC devices such as the 7400 NAND gate chips. Each chip should be positioned in the diagram along a straight line in such a way as to match its relative position on the Pencilbox breadboard. This should clearly show the position of every component used in the circuit. An example is shown in Figure 6. In addition to the placement of each IC, all interconnecting wires between gates on chips should be included in the diagram. Thus, the IC device-level diagram can be used as an aid when wiring the circuit on the Pencilbox and when troubleshooting the circuit. As each wire is inserted into the Pencilbox, the corresponding wire in a printed copy of the diagram should be checked off. The wiring process is completed when all of the wires on the diagram have been checked off. Use the following guidelines when preparing your wiring diagrams: 1. In your logic diagrams such as Figure 5, use the library of primitive gates (AND, OR, etc.) rather than 7400-series chips. IC device-level diagrams depict parts placement on the breadboard and should use the chip components from the parts library. Every input signal and every output signal to the circuit should be clearly labeled. Inputs are labeled by the switch (S0 - S7) or pushbutton number (PB1, /PB1, PB2, /PB2), and outputs are labeled by the LED indicator number (L0 - L7) or are connected to a display chip. In Logic Works, do not use the LED for LED indicators (since the logic is negative), but use a Binary Probe instead. See L3 in Figure 5. Each logic element should be labeled by an identifier. As shown in Figure 5, it is a good idea to use different letters to represent different ICs and different numbers to designate individual gates within each package. For example, a 7400 package contains 4 NAND gates; these might be labeled as N1, N2, N3, and N4. Pin numbers should be shown for every IC connection used in the circuit. All pin numbers should be placed outside the schematic elements. For higher-level components, such as multiplexers or flip-flops, mnemonic labels should also be given for every signal. For example, J, K, and CLEAR (etc.) will greatly help in the understanding of a logic circuit containing a JK flip-flop. These labels should be placed inside the schematic elements.
2.
3.
4. 5.
S1 +5V
14 13 12 11 10
PB1 +5V
13 12 11 10 14
+5V
16 15 14 13 11 12 10
DISP
9
D3
Vcc
Vcc
Vcc
Q3
D2
Q2
Q3
Q2
CP
330 330
dot g
04
00
175
Gnd MR Gnd Q0 Q1 D0 Q0 D1
1 2 3 4 5 6 7
7 Gnd
Q1
330 a 330
+5V S5 S3
This section describes the procedure for wiring logic circuits with any general-purpose white prototype board for your breadboard. One of these is contained in each lab kit. 1. 2. Before wiring any circuit, generate a neat, complete logic diagram and simulate it so you know the circuit functions properly. An inexpensive tool kit for wiring your project boards is sold through the University bookstore. The kit contains a wire cutter/stripper, small screwdriver, and forceps. If you are not sure how to cut wires and strip insulation from them safely, see you instructor or GTAs for assistance. Every time you add a wire or component to the physical circuit, mark off the corresponding part of the wiring diagram with a colored pencil or marker. This makes it easy to see what parts of the circuit have been built so far. If you make any circuit changes, draw these on your wiring diagram. (For lab reports, hand in a final logic diagram that is clean and unmarked.) Insert IC packages into the appropriate breadboard area before inserting any wires. You will usually need to bend the IC leads (pins) slightly inward so that the spacing closely matches the spacing of sockets on the breadboard. Be careful to check that all IC leads actually make it into the correct sockets. Also make sure that pin 1 of the IC is in the correct position. To remove an IC, use an extraction tool, screwdriver, pliers or tweezers to avoid bending or breaking IC leads, or personal injury. Use only solid-conductor wire in the size range of AWG 20 to AWG 26 (available for free in the Computer Engineering Lab, 368 Durham). Wire with larger diameter may damage the socket spring clips of the
10
3.
4.
5. 6.
breadboard. Wire strippers should be used to cut wires to appropriate lengths and to check wires that are suspected of having a larger diameter than permitted. Trim and re-strip the end of any jumper wire that appears badly nicked or overly flexed. 7. It is possible to insert most wires by hand. In tight places, using the forceps from the tool kit can make the job much easier. In either case, wires are easier to insert if they have been cut at an angle of approximately 45 degrees with respect to the axis of the wire. When removing wires, be sure to pull at a right angle to the socket to avoid damage. Route wires around IC packages, not over them. Occasionally an IC turns out to be defective. If wires have been placed over the IC, you will have to remove them so that the IC can be replaced. It is best to wire a circuit in stages, beginning with power and ground connections. Add wires with the power switch OFF. Before turning power ON, remove all hand jewelry and make sure that no foreign metal objects are near the circuit. Check every IC to make sure it is not overheating. If any IC is too hot to touch immediately shut the power off and check all leads. (Be careful because shorted Ics can become very hot and leave a brand on your finger!) Also make sure that no IC has been inserted backwards. IC devices can be damaged if the power level exceeds 5.5V. Damage may also occur if the supply voltage connection is removed from the IC pin while power is still being applied to the circuit. To debug a circuit, use a logic indicator (L0 L7) to check logic levels. Start at a position in the circuit where the logic level is known to be correct and work outward from there. If an IC does not appear to produce the correct signal, check that power and ground are correctly connected to the IC; also check all inputs to the component. Finally, check that the output of the IC is not incorrectly connected to some other signal. If you can not get your circuit to work, bring it and a current circuit diagram or schematic to the CEL GTAs for help.
8. 9. 10.
11. 12.
13.
B. Wiring guidelines 1. Use new wire. A box of new wire is available in the CEL in 368 Durham. a. Old wire can break inside the insulation, causing incorrect circuit behavior that is difficult to troubleshoot. b. Old wire should be recycled; place old wires in the wire recycling box next to the new wire box in 368 Durham. Strip 4 breadboard squares worth of insulation off the ends of a wire when using it in the pencilbox. This is approximately 5/16 inch or 8 mm. a. If you strip too much, the wires in adjacent breadboard columns can touch, causing a short circuit and most likely incorrect behavior. b. If you dont strip enough, the insulation can prevent the spring clips in the breadboard holes from closing properly around the non-insulated part of the wire that is inserted into the hole. c. An inexpensive tool set is available at the University Bookstore in the computer section. Use the wire stripper in the kit to cut and strip your wires.
2.
11
Figure 8: Wire inserts into breadboard contact. 3. Create power and ground busses at the top and bottom of your breadboard. a. The connection pattern used in the breadboard is shown in Figures 9 and 10. b. The top and bottom rows can be used to distribute +5VDC and ground to the Ics, see Figure 11. Note that the top and bottom bus rows have a break in the very middle! If you want a power or ground bus to run the length of the breadboard, you must insert a jumper in the middle of the row to join the two half rows together. This makes your wiring less crowded, and makes it easy to see power and ground connections.
12
4.
Run all power signals in red wire and all ground signals in black wire. a. Do not use red or black wire for any other signals. This makes it easy to tell which wires are power and ground wires, and which are actual signal wires. b. Use a single power or ground wire from the bus to the chip. Do not daisy chain power or ground connections. Think parallel, not serial. See Figure 12. c. You may wire from the bus to the breadboard hole next to the chip. This makes it easy to see that the power and ground wires are connected to the correct pin. d. You may wire from the bus to the breadboard column that connects to the chip. This allows more room for signal wires, without covering the power and ground wires.
Figure 12: Power and ground wired from bus to chip. 5. Color code your wiring in some way. Here are some suggestions that are meant to make it easier to trace your wiring: a. Use the same color for all the wires of a signal that runs to multiple gates. b. Use different colors for different inputs of a gate. c. If you have a bus, make all the wires of the bus the same color. However, if you have long runs of parallel wires that are the same color, it will be more difficult to trace individual bits of the bus. Be creative. Wires should be routed no more than (12 mm) above the breadboard. a. If the wires are too high, your pencilbox will not close and it will be difficult to trace signals through your circuit. b. If the wires are low, be sure the stripped wire ends are seated firmly in the breadboard. Careful routing is essential for efficient troubleshooting. Tight wiring can create sharp bends, which can cause trouble. Avoid sharp bends in the wires. Sharp bends in the wire can cause the wire to break inside the insulation. Run wires around or between chips rather than over them. a. Your chips may be defective or be damaged while in use, and it is much easier to remove chips for testing/replacement if you do not have to remove your wiring in order to remove your chips. b. When possible, leave 2 or 3 rows of the breadboard between chips, to allow signals to pass from one side of the IC to the other. Make short wire lengths from source to destination. a. Route wires point to point, rather than squaring corners. b. Do not daisy chain power and ground wires. Think parallel, not serial. c. Do not daisy chain signal lines from a switch input to several gates. Think parallel, not serial.
6.
7. 8.
9.
13
10. 11.
Wire from a complete schematic diagram. The chips pin numbers should match the pin numbers in the Logicworks diagram. Finally, we can compare good wiring in Figure 13 to poor wiring in Figure 14.
3.
4.
14
5.
Look on the Control Strip for the LOGIC INDICATOR connections labeled L0, L1, , L7. When a 5-volt signal is present at one of these connections, one of the 8 LEDs (V) is illuminated. Check out all of the LEDs in your kit by inserting a wire from one of LOGIC 1 power connectors to each of the LOGIC INDICATOR connectors in turn. Each LED should glow. It is a good idea to make this check each time you work with a kit; it could save you a lot of unnecessary effort if one of your LEDs is burned out. Except for simple, careful connections such as this, you should always turn the power switch S1 OFF before inserting wires into the kit. Find the connections labeled LOGIC SWITCHES on the Control Strip: S0, S1, , S7. These are connections to 8 switches near the top of the kit (VI). (Be careful there are two sets of labels near the switches!) Connect switch S0 to an LED through the connection L0, and turn the switch ON and OFF a few times. Note which setting corresponds to a logic level 1 (the LED is on) and which corresponds to a logic level 0 (the LED is off). Make sure that all of the switches are functioning by testing each one in turn. Find the connectors on the Control Strip that are labeled PB1, /PB1, PB2, and /PB2. (/PB1 means PB1 with a line over it.) These connect to the two push-button PULSERS (VII). Connect a wire from each of these 4 connections to a different LED (through the Control Panel!) and watch what happens as you push the PULSER buttons. PB1 and /PB1 should produce pulses that look like this:
6.
7.
8.
Notice that the Breadboard is divided into two halves, by a central channel. Perpendicular to this channel are many columns of five holes each. The five holes of each column are electrically connected together. They are not connected to any other part of the lab kit. A single column will be used to provide access to one pin of an IC. Power switch S1 should ALWAYS be OFF when inserting or removing ICs to prevent damage to the chips. Turn the power off and place one of the 7400 ICs near the center of the Breadboard area. Insert the chip as shown in Figure 16. The two rows of pins of the IC should be on different sides of the central channel of the Breadboard. Push the IC so that each pin of the IC is inserted into a separate hole. There should now be four unused holes for each pin along the sides of the IC. Connections can be made to the IC through any of these exposed holes. Check the pin definitions in the ECE 2504 Lab Manual, and connect LOGIC 1 of the Control Panel to the VCC pin and LOGIC 0 to the GND pin. Again using the Control Panel, connect two Logic Switches to the input pins of one NAND gate. Connect the output of this NAND gate to one Logic Indicator. Verify that the NAND gate works properly by turning power ON and trying all four possible switch settings and observing the LED. Now turn power OFF, leave the 7400 where it is, and insert a 7404 IC into the Breadboard. Connect power and ground to this new IC, and attach the input and output of one inverter (part of the 7404) to a Logic Switch and Logic Indicator, respectively. Turn power ON, and observe the LED brightness as the switch position is changed. Is this what you expected? Experiment by making connections to various NAND gates and inverters. You should now feel comfortable with the basic operation of the kit. If not, or if the kit seems to be defective, see a GTA or the instructor. After this brief introduction, you should feel ready to build something more ambitious.
9.
10.
11.
15
16
Figure 16: Inserting an IC into the lab kit. The two rows of IC pins should be on opposite sides of the central channel of the breadboard area.
17
Ambiguous wire colors a. All wires are one color (minus 1) b. Can't tell which wires are power or ground (minus 1) Daisy chain wiring a. Series power distribution (minus 1) b. Series signal distribution (minus 1) Wire length a. Can't close box (minus 1) b. Random wire lengths (minus 1) Physical chip pin numbers don't match Logicworks schematic (minus 1)
19
1. Inspect the unit for missing parts, improper parts orientation, etc. Correct any obvious problems before starting. 2. POWER SUPPLY OPERATION Connect wall power supply 1/8 phone plug to J1. Turn switch to ON. Connect wire between Logic 1(+5) and Logic indicator L0(A). D0 LED should light up, turn power switch OFF and back ON to verify this. 3. LOGIC INDICATORS a) Repeat step 2 for all LEDs. b) Test L1(B)L7(H) 4. CLOCK SECTION Connect wire from L0(A) to CLOCK OUT, D0 LED should light up, (some trainers have a slow clock, therefore the LED will be blinking at a slow rate (~1/sec). 5. PULSERS a) Connect a wire from L0(A) to PB1 (signal HIGH in figure). b) D0 LED should light when PB1 is depressed. c) Move wire to PB1 (signal LOW in figure). d) D0 LED should go out when PB1 is depressed. e) Checkout PB2, PB2 in like fashion. 6. LOGIC SWITCHES (Note : Do NOT use a GRAPHITE PENCIL TO MOVE SWITCHES !!!) a) Connect a wire from L0(A) to S0(A). b) Set switch 0 so that D0 LED is lit. This is defined as the OPEN position. (LOGIC 1 position). c) Set all 8 switches to OPEN. d) Connect a wire to all 8 indicators, L0(A) thru L7(H) to corresponding switches S0(A) thru S7(H). Each LED should light up when it is connected. e) Move each switch to NOT OPEN then to OPEN, noting that only the corresponding LED went out. 9. Turn POWER switch off. This concludes test. I have performed the above procedure and am satisfied the kit is working properly. Comments : Signature : ____________________ Date : __________