Академический Документы
Профессиональный Документы
Культура Документы
Lab 10
Optical Loading of a Shift Register, and Packet Identification
Name:
_______________________________
Student Number:
_______________________________
Lab Section:
_______________________________
Instructor:
_______________________________
Date:
_______________________________
_________________________
TA signature
_________________________
TA signature
Page 1
You may want to divide your group into 2, with each sub-group building one of the 2
parts. You have 2 projects boards available to enable you to do this.
Part A:
You will use an 8-bit shift register today as a memory storage element. You will transmit the
data to the shift register optically. This concept is similar to a fibre optic communication system.
The shift register you will use to day is the 74HC164 serial in - parallel out shift register. The
term serial in means it has 1 input wire to load the data. The term parallel out means it has 8
output lines (one for each bit in the register), allowing you to easily see the value of each of the 8
bits. The pin-out for the 74HC164 shift register is shown in Figure 1.
Figure 1: Pin-out schematic for the 8-bit 74HC164 serial in - parallel out shift register chip.
Make the following connections to wire the shift register. ** Neat wiring is very important. **
Pin 1 is the data input (A input) and is used to input data to the shift register.
Pin 8 is the clock (CLK). It is used to synchronize data movement in the shift register,
and between the registers various memory bits QA to QH .
Page 2
The data input enters at pin 1 (A input): 0 V for binary 0, and 5 V for binary 1.
When the clock is pressed (i.e. CLK goes from 0 V to 5 V) the following happens:
o The value of A (pin 1) is transferred to QA .
o The value of QA is transferred to QB .
o The value of QB is transferred to QC .
o The value of QC is transferred to QD .
o The value of QD is transferred to QE .
o The value of QE is transferred to QF .
o The value of QF is transferred to QG .
o The value of QG is transferred to QH .
VCLK = ______________ V
VCLK = ______________ V
Page 3
See figure 3. Identify pin 1 from the triangular notch on one of the corners of the 8 LED
package. All pins on this side are the current inputs to the LEDs. The pins on the other
side of the package are the LED current outputs. Connect them to a current limiting
resistor R, then to ground. R should be such that the current is limited to around 25 mA.
A value of R between 200 - 500 should be ok.
Page 4
Press the clock button to load the data into QA of the shift register. LED#1 should be on
or off, as appropriate, depending on if the input A is binary 0 or 1.
Press the clock button again to load the data into QA . The data already in QA should shift
to QB . LEDs 1 and 2 should light as expected.
Play around with this for a while until you become familiar with how the shift register
works.
Note: If you want to clear the shift register, set the input A to 0, and press the clock 8 times.
**** Show the TA that your shift register works before you proceed any further. ****
Optical Data Transmission System:
You will need to put your optical light system in a dark box, so that the lights in the room dont
interfere with the optical data transmission, as shown in Figure 4.
For the pulsing light source, use a 12 V light bulb controlled by a switch.
Use a photoresistor as a light sensor. Implement the photoresistor in the shown voltage
divider circuit. Select a resistor R1 (in series with the photoresistor) such that when the
light is off Vout is a low voltage (close to 0 V), and when the light is on Vout is a high
voltage (close to 5 V). If you make R1 around 50 k probably it should work ok.
Page 5
3. After you construct your dark box and light system, measure Vout when the light is on and off
to verify that everything is working ok.
Light off:
Vout = ______________ V
Light on:
Vout = ______________ V
Set the input A to be either binary 0 or 1 using your light input circuit (i.e. light on / off).
Press the clock button to load the data into QA of the shift register. LED#1 should be on
or off, as appropriate, depending on if the input A is binary 0 or 1.
Change the input A to another binary value by turning the light on / off as needed.
Press the clock button again to load the data into QA . The data already in QA should shift
to QB . LEDs 1 and 2 should light as expected.
Continue loading data into the shift register to verify that everything is working ok.
Page 6
Part B:
The 8 data pins in the 8-bit shift register are designated QA to QH , as shown in Figure 1. Let us
assume this data has 2 parts:
The first 4 bits (QA to QD) are for a 4-bit address packet. The address packet can be used
to identify which person/system on a network information is to be sent to, or was
received from.
The second 4 bits (QE to QH) are for a 4-bit data packet.
In todays lab, we will assume this addressing system is being used in a car, and so the 16
separate addresses identify which sensor in the car is sending data. These are shown in table 1.
We want to identify when the Battery voltage reaches a Too low level. Therefore, we need
to identify address packet 1001.
Table 2 is the battery voltage data table. We want to identify the data packet 1100, which
occurs when the battery voltage is Too low. Therefore, you need to build two logic circuits.
One to recognize the binary value 1001 and the other to recognize the binary value 1100.
Table #1: Address packets identifying sensors
Address Packet (QA to QD)
Sensor
0000
0001
0010
0011
0100
Oxygen sensor
0101
Inlet pressure
0110
Exhaust pressure
0111
Engine RPM
1000
Throttle position
1001
Battery voltage
1010
Oil pressure
1011
Oil temperature
1100
Fuel level
1101
1110
1111
Page 7
Battery Voltage
0000
unused
0001
14 V
0010
13.5 V
0011
13 V
0100
12.5 V
0101
12 V
0110
11.5 V
0111
11 V
1000
10.5 V
1001
10 V
1010
9.5 V
1011
9V
1100
Too low
1101
unused
1110
unused
1111
unused
Figure 5 shows the pin-outs for AND and NOT logic gate chips which you will use.
Figure 5: Pin-outs of the 7408 quad AND gate chip, and the 7404 hex NOT gate chip.
Page 8
Figure 6 shows the logic gate circuit you will need to identify the binary value 1001. For the
other circuit, you will have to design it yourself. Each circuit should have a red colour LED at
the output, which should light up when the logic circuit shows a True value.
5. Build the circuit of figure 6 to identify when the Battery voltage is addressed, the binary
value 1001. Test your circuit with the following voltages directly connected for inputs QA
to QD to test your circuit.
QA = 5 V, QB = 0 V, QC = 0 V, QD = 5 V.
Does your circuit light up for binary value 1001 ? (Yes / No) ______________
6. Build the circuit to identify the data is Too low, binary value 1100. Test your circuit
with the following voltages directly connected for inputs QE to QH to test your circuit.
QE = 5 V, QF = 5 V, QG = 0 V, QH = 0 V.
Does your circuit light up for binary value 1100 ? (Yes / No) ______________
Page 9
Page 10