About UsResearchOpportunities
PublicationsResourcesSite Map
 

ECE385 Introductory lab (Week 1)

This lab is meant to create a working environment for the following labs. People who have already installed linux on a home system will undoubtedly find the lab very easy (especially if you have installed Debian linux). The following labs will be challenging for all students regardless of experience with linux.

For students who have installed Debian linux before

Install the latest stable release of Debian linux (version 3.0) on the computer you will be using for labs in ECE385, make sure you are running a 2.4 series kernel (you can try 2.6, but you may need to do a bit more work for some labs). Then you may skip down to Using the parallel port

For students who have NOT installed Debian linux before

Traditionally, this course has been centered around using Debian linux. If you are unfamiliar with linux, you should probably check out Debian.org and maybe linux.org. Of course, there is nothing preventing you from installing Redhat, Corel, or SlackWare distribution of gnu linux on your own computer. The only requirement that has to be enforced is that you run kernel 2.4 on your machine.

Over the past several years, installing Debian linux has become increasingly easy. You may want to use CD images or floppy disks to do the install. The two pages you may want to consider to get the install done are:

  1. The Debian network install page
  2. The Debian CD image page
It is also possible to buy Debian CD (or even buy a computer with Debian pre-installed, which would be a very expensive means of completing this lab).

GNU Linux/UNIX

Using the parallel port

The purpose of this section is to learn how to create a very simple device (in this case some indicator lights), how to connect this device to a microprocessor (in this case, simply plugging it into the parallel port), and how to address the device (e.g. writing a program to turn the lights on and off)

You will write to the parallel port using the outb instruction of the x86 architecture. You will learn about input and output by implementing a simple light chaser.

The lights may be connected to the parallel port in any of the various ways indicated below:


Alternatively, you may simply use LEDs with appropriate resistors, for a simpler design (simplified drawing shown below):

Download a simple parallel port connection picture, the simplified drawing showing how to connect 8 LEDs to the parallel port . This drawing was made using the free-source idraw program. To learn how to install idraw, try: apt-cache search idraw, then use the apt-get install command to install as indicated. (This assumes you're using debian, otherwise you're on your own.)

You will likely want to just use LEDs connected, simply through resistors, to the parallel port, but in case you want to experiment, you can also use incandescent bulbs such as automotive lamps, or connections to electronic flash lamps, or other devices (e.g. one can put some devices on the internet), if you design appropriate driver and safety circuits, etc..

In this case, simple LEDs are used, but the circuit can obviously drive automotive light bulbs, large 120volt bulbs, (or even 240volt bulbs which respond faster than 120v bulbs for the same wattage) or flash lamps, such as 8 BFGs (big flash guns), to make a thunderbolt lighting chaser, or to simply control various household appliances. Safety first: note that if driving anything more than a simple LED, great care needs to be exercised in isolating the high voltage from the computer case,etc..

There are several pushbrooms in the lab, including one with nice bright light bulbs, as well as smaller ones to show the simple setup needed for driving LED's. Each of the pins from 2-9 carry data to one LED so a number sent to the parallel port would light up the LED's according to the bit pattern of that number.


Sending Data to the Parallel Port

To send data to the parallel port, you will be using the c intruction outb (check out man outb).

Next, write a simple c program which turns on each LED and then turns it off (like the lights on the Knight rider car). This is commonly called a light chaser.

More info on parallel port: it's commonly used for plip, etc., but not at full speed. Modern parallel ports, following the ieee 1284 standard can run 2 to 4 mebaBYTES per second data rate, much higher than actually implemented by most programs. Try doing a WWW search, using your favorite search engine, on ieee 1284. Also try looking for something called the parallel port how-to and gnu Linux parallel port how-to.

More to thing about: What do you do if you want an LED to look half as bright. Implement a program which changes the brightness of an LED (this technique is commonly called pulse width modulation).


Evaluation (grading)

Recall, this is to be done for the grading day. Any extra time will be used to develop supplemental work (which may receive bonus).

Activity Mark
Get computer running, demonstrate that you have a working computer.
2
Be prepared to answer some questions on GNU Linux
1
Build a pushbroom (row of LEDs) comprised of 8 lights. The simplest design is simply a resistor in series with each of 8 LEDs with the plus sides of the LEDs connected to a common positive voltage such as the +5 or +12 volt supply of the computer. A good value for resistors is one that's 500 to 1000 ohms, so that there is enough resistance to use either +5 or +12 volts.
2
Answer some random questions about parallel ports, parallel port addressing, L.E.D.s, calculation of resistance values for L.E.D.s, or other materials you should know to do this lab in a timely fashion. If you thought about this lab and worked on it prior to coming to the lab, you will likely do well in the prelab. These questions will happen right near the beginning of the lab time so you will need to have studied the parallel port, etc., BEFORE arriving at the lab.
2
Send information to the parallel port using outb.
1
Implement a simple light chaser
1
show us some timing, e.g. show us you understand the concept of pulse width modulation (PWM) control of the brightness of a pushbroom (loop delays, e.g. partial on of the lamps). for example, how would you get the lights to appear to be on at half brightness? hint: switch the light on and off rapidly so that it looks like it's partly on.
1

Total

10