PC Mice come in various flavours : the BUS mouse, the standard PS/2 mouse, the serial mouse, and the USB mouse. I do not know if there are FireWire mice available but it isn't technologically impossible.

  • BUS mice are the oldest. They are also called ISA mice because they are usually connected to the PC using an ISA card. Everything is handled by the ISA card and the mouse soely consists of the detectors and buttons.
  • PS/2 mice are the best because nearly every recent computer is equipped with a PS/2 port and the logic is hard coded on the motherboard. As a consequence, the CPU is not used to decode packet data sent by the mouse which saves a few cycles.
  • Serial mice do not use the CPU for data transmission either but they take up a serial port, which can be very annoying on single-serial-port computers.
  • The USB mice is probably the easiest to use, but data is transmitted via the USB bus and therefore decoded by the CPU. But today's computers are so powerful that it makes no difference for the user. Nevertheless I can't bear seeing an USB mouse on a PS/2 compliant machine because I think of all the CPU cycles that are lost for nothing.
    Thanks to Xenex for pointing out the "silky smoothness" of USB mice. This is because their refresh rate is higher by default. The refresh rate of PS/2 mice can be changed up to 200 Hz by sending the appropriate message to the mouse controller. (ps2rate does this under Windows) This is mainly used by quakers who tune their system to get the higher FPS possible. Therefore they need the softest mouse movement possible to frag their ennemies.

The serial mouse

This type of mouse is connected directly to the serial port and uses the standard RS-232C protocol. The mouse gets its current from the RS-232 DRT and RTS pins and uses less than 15 mA.

Pinout

    Pin  | Name               |  Mouse Usage
  -------+--------------------+--------------------------------------------------
   shell | Protective Ground  |
     3   | TD                 | Serial data from host to mouse (only for power)
     2   | RD                 | Serial data from mouse to host
     7   | RTS                | Positive voltage to mouse
     8   | CTS                |
     6   | DSR                |
     5   | Signal Ground      |
     4   | DTR                | Positive voltage to mouse and reset/detection

Packet detail

When the mouse state changes, it sends a packet consisting of 3 (Microsoft mouse flavour) or 5 (Logitech/mouse systems corp. mouse flavour) to the computer. Each packet contains the buttons pressed and the relative position since the last packet.
Microsoft mouse flavour
 Bit  7  6  5  4  3  2  1  0
      x  1  L  R Y7 Y6 X7 X6   Byte 0
      x  0 X5 X4 X3 X2 X1 X0   Byte 1
      x  0 Y5 Y4 Y3 Y2 Y1 Y0   Byte 2
L = Left Button (1 when pressed)
R = Right Button (1 when pressed)
X0..X7 = X distance 8-bit two's complement value -128 to +127
Y0..Y7 = Y distance 8-bit two's complement value -128 to +127
Logitech/mouse systems corp. mouse flavour
 Bit  7  6  5  4  3  2  1  0
      1  0  0  0  0  L  M  R   Byte 0
     X7 X6 X5 X4 X3 X2 X1 X0   Byte 1
     Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0   Byte 2
     X7 X6 X5 X4 X3 X2 X1 X0   Byte 3
     Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0   Byte 4
L = Left Button (1 when pressed)
M = Middle Button (1 when pressed)
R = Right Button (1 when pressed)
X0..X7 = X distance 8-bit two's complement value -127 to +127
Y0..Y7 = Y distance 8-bit two's complement value -127 to +127

As you can see, a serial mouse driver is really easy to implement.

http://www.hut.fi/~then/mytexts/mouse.html

Log in or register to write something here or to contact authors.