Difference between revisions of "CSC270 Lab 9"
(→Step 1) |
(→Step 3) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
===Step 1=== | ===Step 1=== | ||
− | The basic design. Complete the '''address decoding''' part of the schematics below. | + | |
+ | The basic design. Complete the '''address decoding''' part of the schematics below, adding the design we did in class this morning. | ||
+ | |||
<CENTER> | <CENTER> | ||
[[Image:6811_input_incomplete.png | 700 px]] | [[Image:6811_input_incomplete.png | 700 px]] | ||
Line 20: | Line 22: | ||
What Yi output is activated by this address? _________ | What Yi output is activated by this address? _________ | ||
− | |||
This is the same address we will use for your 1-bit input. We can use '''both''' | This is the same address we will use for your 1-bit input. We can use '''both''' | ||
− | addresses because the output | + | addresses because in the new design the output port (flipflop) is energized only when R/W is low |
− | (the processor writes the bit to the flipflop), and the input | + | (the processor writes the bit to the flipflop), and the input port you are |
building tonight will be energized only when R/W is high (the processor will read | building tonight will be energized only when R/W is high (the processor will read | ||
the bit generated by the switch). | the bit generated by the switch). | ||
+ | |||
+ | Draw the timing diagrams for a STAA XXXX and a LDAA XXXX instruction, where XXXX is the address you the I/O port. Make sure you show E, the Address bus, R/W, D0, the clock input of the flipflop, and the active-low enable of the tri-state driver. | ||
===Step 2=== | ===Step 2=== | ||
+ | Rewire your kit so that it matches your design. HOWEVER, DO NOT CONNECT THE OUTPUT OF THE TRI-STATE DRIVER TO D0. We will do this only when we are sure your circuit is wired correctly. You have several tri-state drivers available to you tonight: | ||
+ | |||
+ | [[Image:74240.png ]] | ||
+ | [[Image:74244.png ]] | ||
+ | [[Image:74541.png ]] | ||
+ | |||
+ | Pick the one that works best for your design. | ||
+ | |||
+ | ===Step 3=== | ||
Write an endless loop that will constantly read a byte at the address | Write an endless loop that will constantly read a byte at the address | ||
corresponding to your 1-bit input device, and write it back at the same | corresponding to your 1-bit input device, and write it back at the same | ||
Line 46: | Line 58: | ||
</CENTER> | </CENTER> | ||
+ | ::'''Note:''' ''Make sure that when you write your lab report you indicate the scale on the diagram, or next to the pictures you take. A timing diagram for which the time scale is not available is of no great use!'' | ||
Monitor the R/W signal as well, and watch both the Yi output and R/W. | Monitor the R/W signal as well, and watch both the Yi output and R/W. | ||
Line 55: | Line 68: | ||
</CENTER> | </CENTER> | ||
− | Report your observations on the grid below. | + | Report your observations on the grid below. Explain why you see a R/W |
pulse only every other Yi pulse. Make sure you record the scales, and indicate | pulse only every other Yi pulse. Make sure you record the scales, and indicate | ||
which signal is which! | which signal is which! | ||
− | < | + | <center> |
− | + | [[Image:CSC270 ScopeWindow.gif|350 px]][[Image:CSC270 ScopeWindow.gif| 350px]] | |
− | + | </center> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[Image: | ||
− | [[Image: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Step 4=== | ===Step 4=== | ||
− | |||
'''Do not connect the output of the driver to D0 yet!''' | '''Do not connect the output of the driver to D0 yet!''' | ||
− | Connect the | + | Connect the enable input(s) of your driver to the oscilloscope and |
− | observe it/them along with R/W and your Yi signal ( | + | observe it/them along with R/W and your Yi signal (use 3 probes). |
− | + | Verify that your driver is turned | |
− | ON '''only when R/W is high and Yi is low'''. You shouldn't connect the output | + | ON '''only when R/W is high and Yi is low'''. You shouldn't connect the data output |
− | of your driver to the data bus until you are sure that the gate is activated | + | of your driver to the data bus (bit D0) until you are sure that the gate is activated |
− | at the | + | at the correct time, under correct conditions. Failure to do this will result in the destruction of |
some chips (either the ones on your breadboard, or the ones inside the kit). | some chips (either the ones on your breadboard, or the ones inside the kit). | ||
Line 110: | Line 100: | ||
the LED turns ON or OFF according to the position of the switch, as we should | the LED turns ON or OFF according to the position of the switch, as we should | ||
expect. | expect. | ||
− | |||
===Step 6=== | ===Step 6=== | ||
− | A bit of programming: | + | A bit of programming: Write a program that makes the LED blink (choose |
whatever blinking frequency you wish) when the switch is in one position, | whatever blinking frequency you wish) when the switch is in one position, | ||
− | and the LED | + | and that turns the LED OFF when the switch is in the opposite position. |
Again, demonstrate the correct operation of your program, please! | Again, demonstrate the correct operation of your program, please! |
Latest revision as of 22:19, 18 April 2009
Contents
Designing a 1-bit input I/O controller
Again tonight you have a simple design to implement, but you should make sure you go through the steps carefully.
This lab assumes that you have assembled, designed and fully tested the 1-bit output controller of Lab #8.
Step 1
The basic design. Complete the address decoding part of the schematics below, adding the design we did in class this morning.
Connect the E and address bits to the decoder the exact same way you did in Lab 9, so that you will not have to change the wiring on your kit.
What hexadecimal address did you assign to your flipflop in lab 9?____________
What Yi output is activated by this address? _________
This is the same address we will use for your 1-bit input. We can use both addresses because in the new design the output port (flipflop) is energized only when R/W is low (the processor writes the bit to the flipflop), and the input port you are building tonight will be energized only when R/W is high (the processor will read the bit generated by the switch).
Draw the timing diagrams for a STAA XXXX and a LDAA XXXX instruction, where XXXX is the address you the I/O port. Make sure you show E, the Address bus, R/W, D0, the clock input of the flipflop, and the active-low enable of the tri-state driver.
Step 2
Rewire your kit so that it matches your design. HOWEVER, DO NOT CONNECT THE OUTPUT OF THE TRI-STATE DRIVER TO D0. We will do this only when we are sure your circuit is wired correctly. You have several tri-state drivers available to you tonight:
Pick the one that works best for your design.
Step 3
Write an endless loop that will constantly read a byte at the address corresponding to your 1-bit input device, and write it back at the same address, storing it in the 1-bit flipflop.
Assemble the program, and enter it in your kit.
Run the program.
Use the scope and verify that the Yi output of the decoder that you are currently using for your 1-bit flipflop is energized by your program. It should look something like this:
- Note: Make sure that when you write your lab report you indicate the scale on the diagram, or next to the pictures you take. A timing diagram for which the time scale is not available is of no great use!
Monitor the R/W signal as well, and watch both the Yi output and R/W. You should observe something similar (though not exactly equal) to the following picture:
Report your observations on the grid below. Explain why you see a R/W pulse only every other Yi pulse. Make sure you record the scales, and indicate which signal is which!
Step 4
Do not connect the output of the driver to D0 yet!
Connect the enable input(s) of your driver to the oscilloscope and observe it/them along with R/W and your Yi signal (use 3 probes). Verify that your driver is turned ON only when R/W is high and Yi is low. You shouldn't connect the data output of your driver to the data bus (bit D0) until you are sure that the gate is activated at the correct time, under correct conditions. Failure to do this will result in the destruction of some chips (either the ones on your breadboard, or the ones inside the kit).
So, please, be careful!
Step 5
Once you have observed and verified the correct timing of the signals, connect the output of the driver to D0, and its input to one of the switches.
Activate the switch (you might want to use a tiny screwdriver), and verify that the LED turns ON or OFF according to the position of the switch, as we should expect.
Step 6
A bit of programming: Write a program that makes the LED blink (choose whatever blinking frequency you wish) when the switch is in one position, and that turns the LED OFF when the switch is in the opposite position.
Again, demonstrate the correct operation of your program, please!