DIY SERIAL MOUSE

Nagging hardware related question? Post here!
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: DIY SERIAL MOUSE

Post by tcat »

Hi,

Well I have probably started the hard way as "My Mouse" (funny that is the Genius model name) is sort of special.
So far I can poll what mouse sends to the SER1 port, I have coded this little program, 'q' quits the poll.

Code: Select all

180 BAUD 1200
190 OPEN #5, ser1ir
220 REPeat poll
230   LET b = CODE( INKEY$(#5,-1) )
240   IF b <> 0 THEN 
250     PRINT BIN$( b,8 )
260     LET b = CODE( INKEY$(#5,0) )
264     IF INKEY$(0) = 'q' THEN EXIT poll
265     GO TO 240
270   END IF 
280   PRINT
290 END REPeat poll
300 CLOSE #5
It seems the mouse sends one byte with some bits set for either left or right mouse buttons.
and an extra byte for middle button.
Then series of bytes follow probably with values of X and Y deltas.
Cannot see the logic so far and not sure I will be up to decoding it.

TCAT


tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: DIY SERIAL MOUSE

Post by tcat »

Hi,

I have updated the polling code above and tried to catch the mouse output to a file.
The mouse should send 7 bits 1 stop bit with no parity, as tested on Linux.
Please see output below.
Early in the output captured mouse moves upwards, sideways, nearer at the bottom ar\e just button clicks.

What I do not quite understand, if it sends just 7 bits why do I see 8 bits in the output?

Many thanks in advance.

Code: Select all

11001100
01011110
11100110
00111101
01011010
11110110
00110001
01000000
11110100
00110001
01011000
11010110
00111101
01010101
11100110
00111101
11010110
00111101
11001111
10101111
11010101
11010110
00111101
11100110
00111101
01000000
01100000
11111111
11000011
11000000
11100000
11000000
11000000
11000000
11010000
11000000
11000000
11000000
11001100
11111111
10111111
11000000


User avatar
tofro
Font of All Knowledge
Posts: 2700
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: DIY SERIAL MOUSE

Post by tofro »

Try "m" or "s" in the parity part of your device name - If you say "no parity", the QL will always receive 8 bits and most probably slip within the data stream.

You can also try and press the left MB during power-on - Some older Genius mice could be made to swith into the Microsoft protocol that way.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: DIY SERIAL MOUSE

Post by tcat »

Toby,

I have tried M-ark and S-pace, but getting Xmit error message.
Mouse clicks works same as without M or S.
Mouse moves with M-ark putting out just a few bytes then Xmit error.

I believe the mouse is in MS mode by default, as I manage to decode mouse clicks, but so far not mouse moves.

xxLxxxxx - left button
xxxRxxxx - right button

Under Linux inputattach mouse works with -mman (MouseMan) and -ms (MS) mode normally.

If anything else,
is there a way to shift 8 bit stream into 7 bit stream by a program, or do I actually need it?
Perhaps masking 8 bits with some value will do?

Thank you so far

TCAT


tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: DIY SERIAL MOUSE

Post by tcat »

Hi All,

I am convinced Genius MyMouse really sends 7 bits 1 stop bit, no parity.
I have tried to send 7 bits stream with 1 stop and no parity bit to QL SER2 port and capture that on the QL sreen.

I have craated this stream of 16 bytes on Linux.
0f f0 33 0f f0 33 0f f0 33 0f f0 33 0f f0 33 0f
This represents a repeting binary pattern
00001111
11110000
00110011
...

On the QL side I received only these 9 bytes of total 16
11111111
01000000
11101000
00000100
11010110
00000100
11010110
00000100
10001111

Also I am suprised that when SER1 port receives data, the data can be also read on SER2 port and vice versa. Is the QL h/w unified to drive both ports at the same time?

So far I am not able to receive 7bits mouse packets correctly. Is there a trick I am not aware of yet?

I wish I could also test a mouse with PC Mouse System protocol, I read on the net, that it sends 8 bits no parity, so I believe this is what QL ports are designed for.

How about Microsoft mouse, would anybody know, perphaps it also sends 7bits but they could be marked or spaced to 8 bits with only 7 bits meaningfull?
Can anyone confirm?

Many thanks so far
Tom


User avatar
tofro
Font of All Knowledge
Posts: 2700
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: DIY SERIAL MOUSE

Post by tofro »

Tom,

No solution, but maybe a little help:

The cuteMouse package comes with a pretty decent description of serial mouse protocols in its docs section
http://cutemouse.sourceforge.net

Apart from that, I'm afraid (but pretty sure) the QL will not be able to receive 7N1 serial streams. It's apparently fixed to 8 bits, no parity or 7 bits 1 parity bit, 2 stop bits always (the stop bits shouldn't matter much).

If you seem to receive the same bit stream on both QL ports, either something is wrong with your hardware or your software. There's no connection whatsoever between the two ports except the baud rate.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: DIY SERIAL MOUSE

Post by tcat »

If you seem to receive the same bit stream on both QL ports, either something is wrong with your hardware or your software. There's no connection whatsoever between the two ports except the baud rate.
It seems software, when I try to echo from SER2 to Linux terminal while moving mouse connected to SER1, nothing comes to the terminal. Also the loop appears only the direction SER1 => SER2.

Would anyone know, are these old Microsoft mice, reported known good for QL?

Many thanks so far.
Tom
Microsoft two button mouse
Microsoft two button mouse


Derek_Stewart
Font of All Knowledge
Posts: 3957
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: DIY SERIAL MOUSE

Post by Derek_Stewart »

Hi Tom,

Microsoft Mice are a Bus protocol and need a special interface, which seems t be different from Serial Mice.

Maybe more info' on the Internet.


Regards,

Derek
Derek_Stewart
Font of All Knowledge
Posts: 3957
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: DIY SERIAL MOUSE

Post by Derek_Stewart »

Here is a link to the Micrsoft Bus Mouse details:

http://www.oldmouse.com/miscellanea/mousebus.shtml

But your mouse, has a 9 Pin D connector on, so maybe it is a serial mouse, which should work in a stanadard serial port.


Regards,

Derek
User avatar
tofro
Font of All Knowledge
Posts: 2700
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: DIY SERIAL MOUSE

Post by tofro »

Derek_Stewart wrote:Hi Tom,

Microsoft Mice are a Bus protocol and need a special interface, .
Derek,
Microsoft bus mice, yes. But amongst the hordes of mice Microsoft has produced over the years are also quite a number of serial mice where Microsoft has (of course) invented their own protocol. See links above for details.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply