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
hello 16F648A? OR 16F726?
Posted by: omega | August 12, 2011 at 11:50 AM
16F648A? OR 16F726? THANK YOU
Posted by: omega | August 12, 2011 at 11:55 AM
Omega,
You are right, it is 16F726.
David
Posted by: David | August 12, 2011 at 01:42 PM
How did you manage to get the bluetooth dongle working without a pic with usb host feature?
your bluetooth dongle have this feature? or because the usb to PS/2 it was unnecessary?
i mean, when i try to do something similar with what you have done, i have to use a pic24f with usb host to get it working...
Posted by: RedDude | August 13, 2011 at 07:52 AM
RedDude, I found one sentence somewhere (wikipedia?) that explained that USB mice have to be able to work plugged into a PS/2 jack (on the old PCs). The way they do this is to detect that the computer does not support USB and to revert to the old PS/2 signaling. I got lucky with the bluetooth mouse I have -- the dongle happens to work the same way. It could not find USB supported on the connection, so it reverted to the PS/2 protocol.
David
Posted by: David | August 14, 2011 at 10:28 PM
Hey David, thanks so much for the fast answer. Awesome job by the way.
your BT dongle, did it came with the mouse? do you know it model?
so strange! BT dongles are slaves (Usb Device/Peripheral), it should need be conected on a Usb host (master) to get it working... so you think because it was reverted to old PS/2 signaling, the usb host wasn't necessary?
thanks again
Posted by: RedDude | August 15, 2011 at 11:43 AM
RedDude, I probably ordered it from DealExfreme.com, I think about two years ago. The dongle comes with the mouse -- there is a place in the mouse where you can store the dongle.
Posted by: David | August 16, 2011 at 06:14 PM
Exceptionally well information you have shared here. We really impressed with your great information
Posted by: LED Display Signs | December 12, 2011 at 04:56 AM