Lab Manual for E24 Project

Keyboard and Mouse Codes

J. Bokor, Fall 2008

Introduction

The project is a simple lab experiment in which you will use an oscilloscope to look at the electrical signals that are sent from a computer keyboard and mouse and interpret them in terms of a binary code.

Lab Access

The experiment is set up in the laboratory in room 140 Cory Hall. The lab is generally open during the day and early evening.

The E24 experiment is set up at STATION 16 in the lab. There are signs identifying this station as the one for EE24. This is in the back of the room adjacent to the one you enter from the main door.

Instructions on how to do the experiment are given below.

Lab Report

After you complete the experiment you must prepare a LAB REPORT. This should be a short description of your experience in doing the experiment. Each student must write their own separate lab report even though the experiment was done by two students. In your report, describe what you did, give the results of the measurements that you were asked to do, and tell about any additional interesting observations you were able to make, or difficulties that you had. The report should be 1-2 pages in length. It must be typed. Handwritten reports will not be accepted. The reports are due in class on December 4.

How to do the experiment

There is a PC at the experiment station. In this computer, the cables connecting the keyboard and mouse have been modified so that the signal voltages can be probed on an oscilloscope. A small box sitting on top of the table has pins on top that are connected to the wires inside the cable. You will set up the oscilloscope to observe the signals by attaching "scope probes" to these pins, then operate the keyboard and the mouse and watch what happens. You will record your observations.

 

1)      Turn on the HP54600B oscilloscope. This is a sophisticated digital storage oscilloscope. It takes about 15 seconds to warm up and boot up its computer. If they are not already connected, connect the two scope probes (grey cables with grey handled probe tips) to the scope inputs labelled 1 and 2. These are called channel 1 and channel 2.

2)      The probe tips retract to expose a hook. Use the hooks to connect the probes to the pins on the top of the keyboard/mouse box.

3)      Connect the channel 1 probe to the keyboard DATA pin. Connect the channel 2 probe to the keyboard CLOCK pin.

4)      On the scope, press the Setup button (It is in the second row of buttons from the top, to the right of the screen). At the bottom of the screen, a menu appears. Then press the Recall menu button. This automatically loads the scope settings that are appropriate for this experiment.

5)      Try pressing various keys on the PC keyboard. It is best if you hold the key down to make it repeat.

6)      Notice the signals on the scope. The clock signal is a regular series of pulses. It should be displayed in the upper half of the screen and should look something like this:

 

7)      It should remain the same regardless of what key is pressed. Now notice the data signal in the lower half of the screen. It will vary depending on which key is pressed. For example, if you press the `s' key, you should see this:

 

8)     

The zeroes and ones do not show on the screen, but they are indicated above to show how to interpret the waveform as a binary code. For the above example, the code is 100100110.

9)      Record the codes for the first two letters of your first and last names.  These need to go into your lab report.

10)  Now connect the channel 1 probe to the mouse CLOCK pin and the channel 2 probe to the mouse DATA pin. The mouse has the ball removed so that you can separately turn the horizontal and vertical wheels. On the oscilloscope, turn the Time/Div knob one click counter clockwise. Turn the wheels back and forth and watch the codes change. You should see that moving the mouse sends 3 separate code groups. You are asked to record just the first group. Record this first group code for each of the following mouse movements:

a)      Horizontal LEFT

b)      Horizontal RIGHT

c)      Vertical UP

d)     Vertical DOWN

Check the movement of the cursor on the PC screen to verify that you are making the indicated movement.

11)  Now click the mouse buttons. Notice that each mouse click sends one code when you push down, and another code when you release. Record the codes for:

a)      left mouse button DOWN

b)      left mouse button release

c)      right mouse button DOWN

d)     right mouse button release

12)  Congratulations! You have completed the experiment. Switch off the hp oscilloscope. Now write up your Lab Report.