16. Digital Electronics

advertisement
ENGR 12L
Experiment 16 DIGITAL ELECTRONICS – CLOCKS and COUNTERS
Step 1: Wire the 555 timer circuit with an LED as shown. It should flash about 5 times per second.
Step 2: Send the Clock Signal to the 74HC192 wire the outputs thru the resistor chip and then to the LED bar
Step 3: Displaying Count as a Numeral:
Wire in the 7 segment Decoder and the Display
REFERENCE
http://www.hobbyprojects.com/digital_circuits.html#digital_circuits
http://electronics.howstuffworks.com/gadgets/clocks-watches/digital-clock5.htm
http://www.drtireman.com/Phy%20CS330/lab/cs330_lab5.pdf
http://online.physics.uiuc.edu/courses/phys405/fall05/P405_Labs/Lab2_TTL_Logic/Lab2_TTL_Logic.pdf
http://mysite.du.edu/~etuttle/electron/elect46.htm
DIP Switch: schematic
555 Timer: http://www.fairchildsemi.com/ds/LM%2FLM555.pdf
Resistors: http://www.bourns.com/data/global/PDFs/4100R.pdf
LED Bar: http://media.digikey.com/pdf/Data%20Sheets/Lite-On%20PDFs/LTA-1000HR.pdf
74HC192E: http://focus.ti.com/lit/ds/symlink/cd74hc192.pdf
7490 Pinout
Let's look at the 7490 briefly to see how it works. Here is the pinout:
The 7490 is a decade counter, meaning it is able to count from 0 to 9 cyclically, and that is its natural mode.
That is, QA, QB, QC and QD are 4 bits in a binary number, and these pins cycle through 0 to 9, like this:
QD QC QB QA
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
You can also set the chip up to count up to other maximum numbers and then return to zero. You "set it up" by
changing the wiring of the R01, R02, R91 and R92 lines. If both R01 and R02 are 1 (5 volts) and either R91 or
R92 are 0 (ground), then the chip will reset QA, QB, QC and QD to 0. If both R91 and R92 are 1 (5 volts), then
the count on QA, QB, QC and QD goes to 1001 (5). So:


To create a divide-by-10 counter, you first connect pin 5 to +5 volts and pin 10 to ground to power the
chip. Then you connect pin 12 to pin 1 and ground pins 2, 3, 6, and 7. You run the input clock signal
(from the timebase or a previous counter) in on pin 14. The output appears on QA, QB, QC and QD. Use
the output on pin 11 to connect to the next stage.
To create a divide-by-6 counter, you first connect pin 5 to +5 volts and pin 10 to ground to power the
chip. Then you connect pin 12 to pin 1 and ground pins 6 and 7. Connect pin 2 to pin 9 and pin 3 to pin
8. Run the input clock signal (from the timebase or a previous counter) in on pin 14. The output appears
on QA, QB and QC. Use pin 8 to connect to the next stage.
Displaying the Time as Numerals
If you want to display the time as numerals, you need to use the 7447s. Here is the pinout of a 7447, as well as the
segment labeling for a 7-segment LED:
You connect a 7447 to a 7490 like this:




Provide +5 volts on pin 16 and ground on pin 8 to power the 7447 chip.
Connect QA, QB, QC and QD from a 7490 to pins 7, 1, 2 and 6 of the 7447, respectively.
Connect 330-ohm resistors to pins 13, 12, 11, 10, 9, 15 and 14 of the 7447, and connect those resistors to the a,
b, c, d, e, f, and g segments of the 7-segment LED.
Connect the common anode of the 7-segment LED to +5 volts.
You will need to have the pinout for the specific LED display that you use so that you know how to wire the
outputs of the 7447 to the LEDs in the 7-segment device. (Also, note that the 7448 is equivalent to the 7447
except that it drives common-cathode displays. Ground the common cathode of the LED in that case.)
You can see that by extending the circuit, we can easily create a complete clock. To create the "minute hand"
section of the clock, all that you need to do is duplicate the "second hand" portion. To create the "hour hand"
portion, you are going to want to be creative. Probably the easiest solution is to create a clock that displays
military time. Then you will want to use an AND gate (or the R inputs of the 7490) to recognize the binary
number 24 and use the output of the recognizer to reset the hour counters to zero.
7447 and 7448 Pinouts
7490 and 7492 Pinouts
http://www.datasheetcatalog.org/datasheets/270/499700_DS.pdf
Experiments
The LED 7-segment display is the easiest to work with, and is a good introduction to
7-segment displays in general. The pinout of a typical display is shown at the right.
The segments are usually labelled a-g as shown. The pins are the same as for a 14pin DIP, and it can be oriented by the missing pins. This represents a common-anode
display, in which the anodes of all eight internal LED's are connected together and
brought out at the pins labelled "A." One or both A pins can be used. The light from
each LED is spread optically to illuminate its segment. There is usually only one
decimal point, to the right or the left of the digit. The pin for the missing decimal
point is not connected.
To test the display, connect an anode pin to +5 V, and then connect the pin corresponding to any segment to
ground through a 470Ω resistor, which will give a current of about 7 mA. This should give satisfactory
illumination. The smallest current that is satisfactory should be used, since the displays use a lot of current.
Don't forget that something has to limit the current through the diode! In a display connected to a computer, the
7-segment displays are usually scanned for economy. Corresponding segments are all connected together and
activated simultaneously, but 5 V is only applied to one anode, so that only that display lights. The displays are
activated one by one in sequence, each one displaying its segments for a short time. If 7 mA gives sufficient
illumination, and there are 4 displays, then the cathode resistors are chosen to give a current of 4 x 7 = 28 mA.
Up to 60 mA is permissible, if it is applied intermittently. To the eye, all the displays will appear to be
illuminated.
7-segment displays are often used with BCD (binary-coded decimal) decoder chips that
take a 4-bit input and have 7 outputs, one for each segment. If 0110 is input, for
example, the segments to display a "6" are illuminated. The pinout of a popular BCD-to7-segment decoder, the 74LS47A, is shown at the left. The BCD input is DCBA, and the
corresponding output goes low. To use this chip, simply connect each output with the
corresponding segment of the display through a 470Ω resistor, with +5 V on the
common anode. The decimal point is lighted by separate circuitry, which can simply be
a resistor connected to ground to light it, or leaving the pin unconnected to hide it. The
chip will work as you want it to with the three control inputs left unconnected. If you
ground "test" all 7 segments will light. If you ground BI, all the outputs will be high, and
the display will be blank. If you ground RBI, a zero will be blanked (this is for blanking
leading zeros). RBI and RBO are used for a series of digits. We will not use these
functions here, but they are there if you need them.
The decoder chip steals some flexibility from you. In particular, inputs greater than hex 9 give funny outputs.
They could as well have displayed A - F, as hex digits, but they do not. You can find out what happens by
experiment, or in the data sheet for the chip. If you control each segment separately and explicitly, you can
display anything, and I think it is best to do this if you have computer control. Without a computer, the decoder
chip makes things a little easier, however. Remember that it is not necessary to use a BCD to 7-segment
decoder with the display.
Download