Manav Kataria's Blog

Signaling and Standards Compatibility + PC Mouse, Reference

My Experience with Signaling and standards compatibility:

avro deep wrote:

@Seniors, Mentors and Conveners:

a new idea has been floated of making a wireless mouse… Is it feasible at our level of experience and the time allotted?

Kindly detail your problem statement.

I am assuming a regular table-top wireless mouse.

My experience comes from making the air-mouse compatible with MS Windows serial mouse standard driver.

  • Issues with Signaling Standards: Due to lack of good documentation on the signaling standard I could not make it compatible with off-the-shelf Windows and Linux. I found a few (man) pages on the signaling between serial mouse driver and the device but Windows did not recognize my device as a serial mouse.
  • I tried reverse engineering a regular serial mouse under the scope and a serial port sniffer to find its behavior actually different than the documentation
  • I finally ended up writing my own device communication protocol and windows driver — the VB application you see during the demos

Don’t mean to scare you but note that I’ve not yet started talking about the hardware issues.

All of this is doable but not easy. It will be worth every drop of ur sweat!
If you still want to do this, have a strong team and be ready to think out of the box.

To sober it down on the hardware front, you could attempt a wired (standards compatible) serial/ps2 mouse.

best wishes,

PC Mouse Reference

This documentation  describes:

  1. Mouse detection by driver
  2. Communication Protocol including baud rate configuration
  3. Serial Pin Out


mouse – serial mouse interface

Serial  mice  are  connected  to  a  serial RS232/V24 dialout line, see
ttys(4) for a description.

The pinout of the usual 9 pin plug as used for serial mice is:

pin   name   used for
2    RX    Data
3    TX    -12 V, Imax = 10 mA
4   DTR    +12 V, Imax = 10 mA
7   RTS    +12 V, Imax = 10 mA
5   GND    Ground

This is the specification, in(1,8) fact 9 V suffices with most mice.

The mouse driver can recognize a mouse by dropping RTS to low and rais-
ing  it again.  About 14 ms later the mouse will send(2,n) 0x4D (‘M’) on the
data line.  After a further  63  ms,  a  Microsoft-compatible  3-button
mouse will send(2,n) 0x33 (‘3’).

The relative mouse movement is sent as dx (positive means right) and dy
(positive means down).  Various mice can operate at  different  speeds.
To  select(2,7,2 select_tut)  speeds,  cycle through the speeds 9600, 4800, 2400 and 1200
bit/s, each time(1,2,n) writing the two characters from the  table  below  and
waiting  0.1  seconds.   The following table shows available speeds and
the strings that select(2,7,2 select_tut) them:

bit/s   string(3,n)
9600    *q
4800    *p
2400    *o
1200    *n

The first byte of a data packet can be  used  to  synchronisation  pur-

Microsoft protocol
The Microsoft protocol uses 1 start bit, 7 data bits, no parity and one
stop bit at the speed of 1200 bits/sec.  Data is sent to RxD in(1,8)  3-byte
packets.  The dx and dy movements are sent as two’s-complement, lb (rb)
are set(7,n,1 builtins) when the left (right) button is pressed:

byte   d6   d5    d4    d3    d2    d1    d0
1   1    lb    rb    dy7   dy6   dx7   dx6
2   0    dx5   dx4   dx3   dx2   dx1   dx0
3   0    dy5   dy4   dy3   dy2   dy1   dy0


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s