Design Notes:

PS2 Mouse Interface to UP1 Board


The mouse outputs a clock and data bits. These are the bits received from the mouse:

 L - left mouse button: 1 is pressed

R - right mouse button

XS, YS- movement data sign: 1 is negative

XV, YV - 1 if overflow has occurred

X0-X7 - movement in X direction

Y0-Y7 - movement in Y direction

 

There are three bytes containing information. Each byte is checked with an odd parity bit, preceded with a start bit and terminated with a stop bit. When the mouse is not transmitting data, the clock is held high.

The clock is connected to pin 30 and the data is connected to pin 31 of the 10K20. A simple four state state machine should be enough to run a mouse driver.

Initially you start in the wait state waiting for the clock to go low indicating that data is coming. When the clock goes low you proceed to the gather state where you sample the data on the positive clock edge and store the necessary bits. If there is no clock for a time out period, they you go back to the wait state and start again. Once you have received 33 clocks, then you have all the data bits and proceed to the verify state where the data is tested to see if it is valid data. If it is invalid, then you proceed to the wait state. If it is valid, then you proceed to the use state where the data is used. When you are done, you proceed to the wait state and the cycle starts again.

There are several tests that may be performed to validate the data:


This information has been assembled by Rob Chapman for EE552.