Interfacing with a PS/2 mouse

[David] sent in his implementation of reading a PS/2 mouse with a PIC microcontroller and some LED displays. Of course, this follows hot on the heels of using a PIC with a PS/2 keyboard so now might be the time to start digging out your old peripherals out of your junk pile.

[David] began his project trying to figure out how to connect a mouse to his breadboard. After hacking the plastic off a PS/2 mouse extension cord, he wired everything up according to the pinout. Programming the PIC to understand PS/2 commands was a little strange. [David] is used to having his microcontrollers provide the clock signal. The PS/2 protocol is a bit strange as the peripheral sets the clock. Since PS/2 is a bidirectional protocol, the mouse also accepts commands. The host – [David]‘s PIC – must send the mouse a command to start sending movement data.

Because USB keyboards and mice are backwards compatible with PS/2 ports, [David] tried out a few USB mice with a USB to PS/2 adapter. Every attempt at using a USB mouse failed. Strangely, when a Bluetooth mouse was tried (via Bluetooth to USB to PS/2), everything worked perfectly. Check out [David]‘s PIC mouse demo after the break.

Comments

  1. andres ortiz says:

    haha, i built something exactly like this a while ago :)

  2. cyrozap says:

    Wait… Bluetooth USB dongles work over PS2? If so, this is amazing! However, I think he might just be confusing a regular 2.4 GHz wireless mouse with a Bluetooth mouse (understandable, Bluetooth works in the 2.4 GHz band).

    This is still pretty cool, Bluetooth or not.

  3. biozz says:

    i like the photoshop CS5 extended edition emulator he created there!

  4. andar_b says:

    IIRC, those adapters are device specific, or at least manufacturer specific, I have not been able to get mine to work with several wireless mouses, it only works with the one it came with.

    It would make perfect sense to me that the adapter puts the mouse into a PS2 mode, and others don’t respond the same way.

  5. f says:

    Sorry, but that’s not bluetooth, but a normal wireless mouse. Bluetooth mice won’t work that way, because bluetooth is a rather complicated technology requiring setup (and drivers) for the devices to connect and to communicate.

  6. Bogdan says:

    The mice that work with either usb or ps/2 have special microcontrollers that emulate one of the two when connected to the pc. The adapter is just passive. So a mouse that supports only USB will not work with a ps2 adapter. The wireless works just as well because the dongle will provide PS2 signals, again it has nothing to do wit bluetooth.

    I find the demo really amusing…

    • yetihehe says:

      Yeah, I learnt this hard way when I thought: “Hmm, maybe I can use cheap usb number pad with usb/ps2 converter instead of self made keypad or dpad?”. Sadly, the answer is no. I needed to buy full ps2 keyboard for this to work.

  7. password says:

    i would rather say the bluetooth dongle of the mouse is ps/2 compatible not the mouse. after all the mouse sends data to the mouse in some standard and the bluetooth dongle does all the layer abstraction stuff like telling the pc a mouse is attached.

  8. bogdan says:

    Actually, the mouse isnt using bluetooth because its more complex/expensive. It just operates in the same band(2.4ghz)

  9. Thanks for pointing out that just because a mouse is wireless, does not mean it is a Bluetooth mouse. I am going to update my page to fix that.

    Regarding why USB to PS/2 works, I found this statement: “Many keyboards and mice can connect via either USB or PS/2, selecting the appropriate protocol at power-on” on wikipedia (http://en.wikipedia.org/wiki/PS/2_connector)

  10. blue carbuncle says:

    Fridge DJ!!!!

  11. timbo says:

    The 9 x 11 LED is sweet! Where do you find these??

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Follow

Get every new post delivered to your Inbox.

Join 97,581 other followers