Information Technology Reference
In-Depth Information
10.6.4
What interrupt does the keyboard use:
(a)
IRQ1
(b)
IRQ3
(c)
IRQ4
(d)
IRQ12
10.6.5
What interrupt does the PS/2 style mouse use:
(a)
IRQ1
(b)
IRQ3
(c)
IRQ4
(d)
IRQ12
10.6.6
Run the program in Figure 10.4 and show that the joystick buttons are working.
Modify the program so that it only displays a change of status in a button press
(rather that scrolling down the screen). For example:
if ((inval & 0x80) == 1) && (button==0)) { button=1; puts(“B:Button 2 Press”);}
if ((inval & 0x80) == 0) && (button==1)) { button=0; puts(“B:Button 2 Reset”);}
10.6.7
Run Program 10.1 and test the movement detection. Modify it so that it detects the
y movement.
10.6.8
Run Program 10.1 so that the user can calibrate the joystick. The user should be
asked to move the joystick to its maximum x directions, and also the maximum y
directions. From this write a program which displays the joystick movement as a
value from -1 to +1.
10.7 Notes from the author
Phew. I'm glad I got these three interfaces out of the way, in a single chapter. All three are
based on a legacy type system. Over time, the USB port should replace each interface type,
but as they work well at the present they may be around for a while longer.
The method that the games port uses to determine position is rather cumbersome, where
it uses a single-shot monostable timer to determine the x and y positions. An improved
method is to pass the data using a serial interface, just as the mouse does. But, it's a stan-
dard, and that's the most important thing.
The keyboard and PS/2-style mouse connections have proved popular, as they are both
now small 5-pin DIN-style connectors, and as the software automatically scans the port for
devices, they can be plugged into either socket. This allows for an extra keyboard or a sec-
ond mouse to be used with a notebook.
As I've got a few extra lines at the end of this chapter, I would like to review the material
that has been covered up to this point. The key to understanding internal busses is contained
in the Motherboard chapter, where the processor interfaces with the TXC device, which di-
rects any requests to the second-level cache, the DRAM memory or the PCI bus. The PCI
bridge device is also important as it isolates the other busses, such as ISA/IDE, USB, se-
rial/parallel port from the PCI bus, and thus the rest of the system. The keyboard, games port
and mouse interfaces are accessed via the PCI bridge.
Search WWH ::




Custom Search