A few months ago I found some web pages describing the physical and signalling protocols between a PS/2 mouse and a PC. It was a lot simpler than I expected. Even though there are six pins on a PS/2 mouse, only two of them are part of the protocol: one for clock and one for data. "Data and clock? That's all?" I thought. So I decided to write an program for a PIC so it could communicate with a mouse.
When I was done I had a set of PS/2 communications routines and a small program running on a PIC16F726 that worked with a PS/2 mouse plugged into a breadboard. I can move a "cursor" and toggle elements on the 9x11 LED display. I can clear the display using the right button and load a pattern by pressing the right and left buttons at the same time. Also, the application can detect when the mouse is unplugged.
Tonight I took it one step further and added a USB-to-PS/2 adapter, and then plugged in a Bluetooth-to-USB dongle with a Bluetooth mouse. This worked, much to my surprise, especially since the USB mouse I tried did not work.
Update on Aug 12, 2011: Fixed PIC chip name. Chip is actually PIC16F726, and not the PIC16F648.
Downloads are available at the bottom of the project page.
Larger photos available on Flickr