Last week, you wired an ISA board with 8 LEDs and 8 dip switches. The first task of this lab is to simply increase the number of LEDs from 8 to 16. Feel free to use more electronic components. If you understand the schematic used last week, you should have little trouble coming up with an idea of how to expand the number of LEDs to 16.
For grading, modify your code from last week using 16 LEDs (for example the light chaser).
Your row of 16 LEDs should preferably be controllable over the 8 bit data bus (e.g. D0 to D7).
Devise a means of writing data to the 16 LEDs so that a number from 0 to 65535 (0x0 to 0xFFFF) can be entered and displayed on the LEDs. Be prepared to explain your choice of design.
What you will need to demonstrate next in the lab are three types of kernel timing:
What you need to demonstrate for the next part of the lab is the following:
You send something to the device, say any number.
It displays this number for a fixed amount of time, then turns itself off.
Set it to something visible: about 5 seconds. (this is a rather long delay in terms of kernel, but easy for marking by humans).
Additional timing information can be found here. Write 3 device drivers, each using a different method of kernel timing.
A pushbroom device will be demonstrated in the class. Use what you learned in lab three to implement a timed pushbroom. Begin with a single letter and clock this out through the row of 8 LEDs. Use a simple 5x8 font (for example xterm -fn 5x8 will give you an example of 5x8 font).
Your means above should scale well (i.e. you should be able to explain how you would control 64 LEDs by way of an 8 bit data bus comprised of data lines D0 to D7).
Can your method write to all 16 LEDs at exactly the same time? If not, is this limitation a problem in a practical pushbroom display?
Make your program accept input in base 10 or 16. Hint: use the function strtol or strtoul.
You might also implement kernel space timing to use PWM (rapid flicker on and off) and have them go fully on to write characters to the pushbroom, and partly on when not writing characters:
..+...... .+.+..... +...+.... +...+.... +++++.... +...+.... +...+....as you might have done in LAB1, but with 16 LEDs accessed by 8 data lines (the timing is a little trickier than it was with just 8 LEDs on 8 data lines). In this diagram, "+" is the letter A where light is on brightly and "." denotes the light being on dimly. To get it to be dim, you might flicker it rapidly so it's on only for a short duty cycle.
All you need to do is write a simple device driver which acknowledges interrupts. You may generate the interrupts on the ISA board or on the parallel port. When an interrupt is generated, just use printk to output a message to the syslog. Show the number of interrupts has been incremented in the /proc filesystem.
For fun, you can connect one of the lines on the LEDs to an interrupt line. If you run the lightchaser code, the interrupt should be triggered when the LED is triggered.
Note This Depending on your computer, sometimes an interrupt is generated when an interrupt line goes high, and sometimes the interrupt line is high and an interrupt is generated when the line is pulled low (grounded). You will want to check this and write your code appropriately.
| Activity | Mark |
| Show us a program which accepts a number from the keyboard (in the range from $0x0000 to $0xFFFF) and displays the corresponding bits on the LEDs. The program must accept all of base 9+1 (0 to 65535), base F+1 (0x0000 to 0xFFFF), and base 1+1 (0000000000000000 to 1111111111111111). Be clever! | |
| Show that you understand the different types of kernel timing, show a delay. One mark for each type. | |
| Show us something cool (maybe your favorite corporate (or anti-corporate) logo generated using kernel space timing. Or perhaps show us that you know where to get the font tables out of X windows, for making a 16 bit pushbroom. | |
| Show us your pushbroom in action. | |
| Show us your pushbroom with PWM. | |
| Demonstrate the use of interrupts. Generate some interrupts and show us some result. |