Searching \ for 'Reading position from a mouse using a PIC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'Reading position from a mouse using a PIC'.

Truncated match.
PICList Thread
'Reading position from a mouse using a PIC'
1997\02\14@084259 by Oyvind Kaurstad

flavicon
face
Hi, all.

Does anyone know how a mouse transmits
position to the PC?

I'm talking about a serial mouse, not a bus-mouse.

Has the mouse got "intelligent" electronics that enables
it to transmit serial data to the PC, or is there some other
smart way this is done?

The reason I want to know this is that I have an application that needs
to read direction/speed/button information from a mouse using a 16C84.

Has anyone done this already?

I don't have access to the WEB for the time being, so URL's will
not help me much.

I can take attachments per email of any size though.
(Including HTML documents)

Thanks a lot!

-Oyvind     spam_OUToyvind.kaurstadTakeThisOuTspamnofac.abb.no

1997\02\14@160423 by radyan

flavicon
face
Oyvind Kaurstad wrote:
{Quote hidden}

Hi!
The position you have from MOUSE Software Driver, not from Hardware.
Bye,
Radik Yanai

1997\02\14@191012 by Lee Jones

flavicon
face
>> Does anyone know how a mouse transmits position to the PC?=20
>> I'm talking about a serial mouse, not a bus-mouse.

> The position you have from MOUSE Software Driver, not from Hardware.

Well, true enough.  But you're unlikely to get any mouse vendor
to provide a driver for a PIC.

>> Has the mouse got "intelligent" electronics that enables
>> it to transmit serial data to the PC, or is there some other
>> smart way this is done?

Disclaimer -- this is all from memory.

As I recall, the mouse sends updates to the host whenever it detects
a change (movement, button-down, button-up).  The data is encoded as
2(?) octets with X-displacement and Y-displacement sent as signed 7
bit values.  The buttons are encoded as simply as bit values.

I think the communications in standard asynchronous serial at 9600
baud.  The primary difference between a serial mouse and PS/2 style
is serial uses RS232 voltage levels while PS/2 style uses TTL.

This information isn't hard to find in the PC reference manuals.

You could probably also deduce it using an osciloscope and/or
PC based share/freeware data scope.  Monitor the mouse to PC
interface and tweak 1 variable at a time (for movement, pull the
ball out and move 1 roller at a time by hand).

>> The reason I want to know this is that I have an application that needs
>> to read direction/speed/button information from a mouse using a 16C84.

I also believe that PICs are popular rodent CPUs.  So the mouse's
PIC could talk to your PIC. :-)
                                               Lee Jones

-------------------------------------------------------------------
Jones Computer Communications             leespamKILLspamfrumble.claremont.edu
509 Black Hills Dr, Claremont, CA 91711         voice: 909-621-9008
-------------------------------------------------------------------

1997\02\14@215506 by carl watley

picon face
>Oyvind Kaurstad wrote:
>
>
> Has the mouse got "intelligent" electronics that enables
> it to transmit serial data to the PC, or is there some other
> smart way this is done?

Check out Microchip's AN519 (using the 16C54 chip as a mouse
controller).

Also Check Microchip's Mouse and Trackball controller chip
(MTA41300)

Later,
Carl Watley
WB2ZSG

1997\02\15@011706 by lmclaren

flavicon
face
Oyvind Kaurstad wrote:
{Quote hidden}

There is a very good artical about the above in the Embeded Controller
Handbook from Microchip.
Get a copy from your dealer. The application notes are also on line.
regards
--
Lee McLaren                          EraseMElmclarenspam_OUTspamTakeThisOuTtrumpet.com.au
Comstra pty. ltd.                    lmclarenspamspam_OUTcomstra.com.au
2 Kirksway place                     phone       03 62244488
Hobart Tasmania                      fax         03 62244601
Australia 7000                       mobil       018 138682

'It was five hours of Boggs's "channelling". After three hours
I asked him to summon up the soul of Jimi Hendrix and requested
All Along the Watchtower. You know, the guy's been dead
twenty years but he still hasn't lost his edge'
Mulder

1997\02\15@073652 by Sami Khawam

flavicon
picon face
part 0 3160 bytes
I've attached a file that might help you.

--
Sami Khawam
@spam@a9501901KILLspamspamunet.univie.ac.at
http://unet.univie.ac.at/~a9501901

From: Tomi Engdahl <KILLspamthenKILLspamspamsnakemail.hut.fi>
Date: Fri, 29 Apr 1994 13:28:37 +0200 (EET DST)


T{ss{ hiirien speksit englanniksi. Ei nyt ihan t{ydelliset, mutta kyll{
aika kattavat.


       Serial mouse

Voltage levels:
Mouse takes standard RS-232C output signals (+-12V) as its input signals.
Those outputs are in +12V when mouse is operated. Mouse takes some current
>from each of the RS-232C port output lines it is connected (about 10mA).
Mouse send data to computer in levels that RS-232C receiver chip in the
computer can uderstand as RS-232C input levels. Mouse outputs are normally
something like +-5V, 0..5V or sometimes +-12V. Mouse electronics
normally use +5V voltage.


       Microsoft serial mouse

Pins used:
TD, RTS and DTR are used only as power source for the mouse.
RD is used to receive data from mouse.

Serial data parameters: 1200bps, 7 databits, 1 stop-bit

Data packet format:
Data packet is 3 byte packet. It is send to the computer every time
mouse state changes (mouse moves or keys are pressed/released).

       D7      D6      D5      D4      D3      D2      D1      D0

1.      X       1       LB      RB      Y7      Y6      X7      X6
2.      X       0       X5      X4      X3      X2      X1      X0
3.      X       0       Y5      Y4      Y3      Y2      Y1      Y0

The byte marked with 1. is send first, then the others. The bit D6
in the first byte is used for syncronizing the software to mouse
packets if it goes out of sync.

LB is the state of the left button (0 means pressed down)
RB is the state of the right button (0 means pressed down)
X7-X0 movement in X direction since last packet (signed byte)
Y7-Y0 movement in Y direction since last packet (signed byte)


       Mouse systems mouse

Serial data parameters: 1200bps, 8 databits, 1 stop-bit

The data is sent in 5 byte packets in following format:

       D7      D6      D5      D4      D3      D2      D1      D0

1.      1       0       0       0       0       LB      CB      RB
2.      X7      X6      X5      X4      X3      X2      X1      X0
3.      Y7      Y6      Y5      Y4      Y3      Y4      Y1      Y0
4.
5.

LB is left button state (0=pressed, 1=released)
CB is center button state (0=pressed, 1=released)
RB is right button state (0=pressed, 1=released)
X7-X0 movement in X direction since last packet in signed byte
     format (-128..+127), positive direction right
Y7-Y0 movement in Y direction since last packet in signed byte
     format (-128..+127), positive direction up

The last two bytes in the packet (bytes 4 and 5) contains
information about movement data send in last packet. I have not
found exact information about those bytes. I have not also found
any use for such a information (maybe it is for syncronization
or something like that).





--
RemoveMETomi.EngdahlTakeThisOuTspamhut.fi                        Helsinki University of Technology
G=Tomi S=Engdahl O=hut ADMD=fumail C=fi    Department of Computer Science
# This text is provided "as is" without any express or implied warranty #



More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...