555 Timer 1
555 Timer 1
Overview
As part of the National Instruments Introduction to NI ELVIS II, NI Multisim, and NI LabVIEW courseware, the labs introduces students to the capabilities of the NI ELVIS II educational design and prototyping platform. Students can explore how NI ELVIS II allows for an easy transition from design, simulation to prototype as it interfaces with both NI Multisim and LabVIEW software. The courseware includes 11 lab experiments starting with the an introduction to the NI ELVIS environment and steps you through AC circuits to communications. The labs are designed as a starting point for your own curriculum design, demonstrations in the classroom, and method to inspire students to be imaginative and creative in their design projects. View all of the labs for the Introduction to NI ELVIS II, NI Multisim and NI LabVIEW courseware.
Table of Contents
Goal
Digital electronics is the heart and soul of modern computers. The ability to set and read digital lines is essential to digital circuit diagnostics. This lab focuses on NI ELVIS II digital tools, such as a digital clock, digital counter, and a logic state analyzer, to study digital circuits.
Table of Contents
1. Required Components 2. Exercise 5.1: Visualizing Digital Byte Patterns 3. Exercise 5.2: 555 Digital Clock Circuit 4. Exercise 5.3: Building a 4-Bit Digital Counter 5. Exercise 5.4: LabVIEW Logic State Analyzer 6. Multisim Challenge: Designan 8-bit Digital Counter Circuit 7. Related Links
Required Components
Filenames: lab5_digital_io_jas_edition.pdf lab5_ms11.zip Download the files above to access the courseware pertaining to this lesson that illustrate how the NI ELVIS II can be used with NI Multisim and NI LabVIEW covering a range of tools from introductory level exercises to design challenges.
http://www.ni.com/example/31517/en/
1/12
22/2/2014
Figure 5.0. Four bit Digital Counter Circuit on NI ELVIS II Protoboard Required Soft Front Panels (SFPs) Digital writer (DigOut) Digital reader (DigIn) FGEN (TTL outputs) Oscilloscope (Scope) Required Components 10 kW resistor RA (brown, black, orange) 100 kW resistor RB (brown, black, yellow) 1 mF capacitor C 555 timer chip 7493 4-bit binary counter
22/2/2014
Note: The digital I/O lines are located on the right side of the protoboard. 2. Launch the NI ELVIS II Instrument Launcher strip. 3. Select the Digital Writer (DigOut) icon. A new digital logic diagnostic window opens, so you can set/reset any of the digital lines to a HI or LO state. By default, the digital I/O lines <0..7> are selected from the three 8-bit ports in the Lines to Write box.
Figure 5.1. Dig Out front panel window The digital output lines are labeled 0 to 7 reading right to left in the Manual Pattern box. You can set/reset (HI/LO) any bit by clicking on the top or bottom portion of the virtual switch. Collectively, these 8 bits constitute a byte that can be read in a binary, octal, hexadecimal, or decimal format, or in an SI notation in the display box above the switches. By clicking on the grayed-out portion, you can set the radix (format) of this indicator.
22/2/2014
4. After you have set a digital pattern, turn on the power to the protoboard and click Run (green arrow) to send the pattern to the parallel output digital I/O lines <0 .. 7>, which in turn are passed on to the green LEDs. Note: You can set the Generation Mode to output a single pattern or to continuously output the pattern. In continuous operation, the hardware is updated continuously with the current pattern. The set pattern is echoed on the line states (blue LED indicators) of the Bus State on the SFP. Also, with the Action buttons of the SFP, you can toggle, rotate, or shift the bit pattern right or left. 5. Press the Stop button (red box) to cease updating the port. In testing a digital circuit , you can select from several commonly used patterns for diagnostic checks. 6. Click the Pattern selector on the SFP to view the options available. Manual Ramp (0 255) Alternating 1/0s Walking 1s 7. Try to output each bit pattern. 8. Close the Digital Writer window. End of Exercise 5.1 Load any 8-bit pattern Computer Instruction INC Computer Instruction INVERT Computer Instruction SHIFT LEFT LOGIC
Figure 5.3. 555 Digital Clock Circuit Complete the following steps to build and perform measurements on a 555 digital clock circuit: 1. Using the DMM[W] and DMM[C], measure the component values and complete the following table.
http://www.ni.com/example/31517/en/ 4/12
22/2/2014
RA RB C
Figure 5.4. 555 Timer chip Configured as a Digital Oscillator Power (+5 V) goes to pins 8 and 4, and GROUND goes to pin 1. The timing chain of RA, RB, and C straddles the power supply. It has a connection between the resistors going to pin 7 and a connection between RB and C going to pins 2 and 6. 3. Wire the 555 output pin 3 to one of the port pin sockets, DIO <0>. 4. From the NI ELVIS II Instrument Launcher strip, select the Digital Reader (DigIn) icon. By default the second 8-bit port is set to input (Lines to Read 8-15). 5. Configure Lines to Read to (0-7), enable power to the protoboard, and click Run.
http://www.ni.com/example/31517/en/
5/12
22/2/2014
Figure 5.5. Digital Writer reading bit 0, line DIO <0> The Digital Reader allows the current state of a parallel input port to be read on demand (single shot) or continuously. You should see the state of line 0 flashing. If not, click on the Stop button and use the DMM[V] to check voltage levels on the 555 pins (stop the Digital Reader first). With the clock circuit running, you can now make some useful digital circuit measurements. The 555 timer oscillator circuit has a Period T of T = 0.695 (RA + 2 RB) C (seconds) The 555 timer oscillator frequency is related to the period by F = 1/T (Hz) The 555 timer oscillator circuit has an On time of T = 0.695 (RA + RB) C (seconds) The 555 timer oscillator circuit has a Duty Cycle (On time/period) of DC = (RA+ RB) / (RA + 2 RB) 6. Close all SFPs and launch the Oscilloscope (Scope) icon. 7. Connect the front panel BNC CH 0 input leads to pin 3 of the 555 timer chip and any ground. Click Run. You should now be observing the digital waveform on Channel 0 of the oscilloscope. 8. Select Trigger Type: Edge, Source: Chan 0 Source and Level (V) to 1.0. Your signal should be a TTL signal with an amplitude of 4 V or more, and the signal should be steady.
http://www.ni.com/example/31517/en/ 6/12
22/2/2014
9. Observe the frequency in the scope window for CH 0. 10. Click the box Cursors On box and note that C1 and C2 are set to CH 0. 11. By clicking and dragging the cursors, measure the period, the on time, and the duty cycle. Calculate the frequency from the period measurement. 12. Fill in the following table: T Ton DC F = __________________ = __________________ = __________________ = __________________ (Hz) (seconds) (seconds)
13. Compare your measurements with the previous theoretical predictions. 14. Close any SFPs. End of Exercise 5.2
Figure 5.6. Schematic Diagram 4-bit Binary Counter 3. On the 7493 binary counter chip, connect +5 V power to pin 5 and ground to pin 10. 4. Ensure that 0set inputs pins 2 and 3 are grounded. 5. Connect the outputs Q1, Q2, Q4, and Q8 to the LED and digital input ports of the NI ELVIS II protoboard using the following mapping scheme:
to to to to
DIO<0> and LED<0> DIO<1> and LED<1> DIO<2> and LED<2> DIO<3> and LED<3>
7/12
22/2/2014
555 pin 3
to
6. Connect the 555 digital clock output (pin 3) to the 7493 Clock 1 (C1) input (pin 14). 7. Power the protoboard and watch the binary counts accumulate on the LEDs. 8. Launch the NI-ELVISmx Digital Reader (DigIN) icon. Monitor the binary states on the computer screen, and, at the same time, see the states on the green LEDs on the protoboard. 9. Close the NI ELVIS II Instrument Launcher strip. End of Exercise 5.3
Figure 5.7. Timing Diagram of a four bit Binary Counter Using the LabVIEW APIs for the digital I/O, you can build a simple 4-bit logic state analyzer. The Digital I/O palette is located in FunctionsProgrammingMeasurement I/ONI ELVISmxNI ELVISmx Digital Reader.
http://www.ni.com/example/31517/en/
8/12
22/2/2014
Figure 5.8. Location of NI ELVISmx Digital Reader Launch LabVIEW and then open Binary CounterMx.vi from the Hands-On-NI ELVIS II library folder. In the Block Diagram, the NI-ELVISmx Digital Reader has been initialized to use lines 0 to 7 (blue ring constant) for input from the protoboard. Note: In this example, the NI ELVIS USB communication port is Device 3. Depending on how many DAQ cards you have in you computer, it could be Device 1, 2, or 3. With only the NI ELVIS USB port available, it would be Device 1. Change the Dev # to match your NI ELVIS II.
http://www.ni.com/example/31517/en/
9/12
22/2/2014
Figure 5.9. Block Diagram for the program Binary CounterMx.vi The 4-bit logic state analyzer samples NI ELVIS lines <0..7> and presents the line states as a Boolean array (thick green line). The index arrays extract bits <0..3> (Q1, Q2, Q3, Q4) to the respective trace indicators and then into a numeric value (0 or 1) for bundling with the other traces for the timing diagram plot. With the many LabVIEW chart format options, you can present the data in a timing diagram format. A copy of the data also goes to the AND gate, where bits <4..7> are set to zero. The resultant data is converted to a numeric (0 to 15) and presented on the front panel. End of Exercise 5.4
http://www.ni.com/example/31517/en/
10/12
22/2/2014
Figure 5.10. Multisim schmatic of the visualization of a 4-bit Binary Counter 2. Double-click on the scope icon XSC2. A 4-channel oscilloscope display appears. 3. Run this simulation by clicking on the green arrow. Observe that the 4-channel display is similar to the real circuit built on an NI ELVIS II protoboard. Stop the simulation by clicking on the red square. 4. Open a second program called Decimal Counter. This program replaces the binary counter with a decimal counter (7490N), adds a 7-segment driver (7447N) IC, and adds a 7-segment display. Note that the current limiting resistors for the 7-segment LEDs are found in the resistor pack. 5. Run this program to see a single-digit counter with a 7-segment display.
Figure 5.11. Decimal Reading of a 4-bit Binary Counter 6. Stop the simulation and add a second 7490N, a 7448N, a Resistor pack 330 W, and a 7-segment display to the Multisim circuit. You can implement this with a simple copy and paste of the components already on the circuit diagram. Alternatively, you can find a list of components by browsing to PlaceComponent. 7. Connect the output QD of the first counter chip (7490N) to the input INA of the second counter chip (7448N). Together these chips form a two-digit counter counting from 00 to 99. This is shown in the file, Decimal CounterX2.
http://www.ni.com/example/31517/en/ 11/12
22/2/2014
8. Connect the other virtual wires to the added chips to build a two-digit decimal counter. 9. Run the simulation.
Related Links
1. Go back to Lesson 1 - NI ELVIS II Workspace Environment, part of the Introduction to NI ELVIS II, NI Multisim, and NI Labview Courseware 2. Go on to Lesson 6: Magnetic Field Sensors, part of the Introduction to NI ELVIS II, NI Multisim and NI LabVIEW Courseware 3. Back to the Introduction to NI ELVIS II, NI Multisim, and NI LabVIEW courseware 4. Watch this introductory NI ELVIS II video to learn more about the education design and prototyping platform 5. Find more courseware on NI ELVIS II, NI LabVIEW, and NI Multisim
http://www.ni.com/example/31517/en/
12/12