I am trying to interface an old PS/2 mouse with a PIC microcontroller but I don't know how exactly the protocol works. Does it work exactly like the keyboard protocol, thus sending to the host 11 bit data packets each containing 1 byte of data? I know the mouse sends 3 data packets each time it detects a movement or click, but does that mean it sends 3 11-bit-packets each time or just a single 27 data packet (1 for start , 8+8+8 for data, a parity bit, end bit)
\$\begingroup\$
\$\endgroup\$
1
-
\$\begingroup\$ Deleted answer because I would agree that it was more commentary... Anyways, Microchip has an application design (and fair warning, this link starts a download for the document). The document talks about hardware design, timing, data transfer, message frames, etc: ww1.microchip.com/downloads/en/appnotes/91055c.pdf \$\endgroup\$– ColinCommented Dec 29, 2023 at 18:20
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
The mouse sends each byte separately with the said 11-bit start/parity/stop sequence. It does not combine the bytes into a packet.
But before the mouse sends anything to you, you must send a command to the mouse which makes the mouse to start reporting data back to you.