View Full Version : Problem reading a PS/2 mouse

05-09-2006, 03:34 PM
I trying to read data from a PS/2 mouse from a bs2px but having some problems.
The mouse uses 2 signals, one data and one clock. The big problem is that the mouse generates the clock signal.

It doesnt seem that I can make the shiftin to use a external clock which make me have to write the "shiftin" code myself.
The problem is that the mouse generates the clock signal somewhere between 10.000-16.000 Hz and the bs2px can do 19.000 "instruction-Hz" which is not enough to read the clock and data with if-statements etc. The microcontroller itself and other pbasic commands have no problems reading the clock-signal, the count command reads the exact number of clock pulses for example.

Anyone have an idea? http://forums.parallax.com/images/smilies/confused.gif

Can I make the shiftin to use an external clock?
Can I have a assembly part in the code which I can make more optimized?

Bruce Bates
05-09-2006, 03:59 PM
Klas -

Due to the very reasons you mention, you can not process signals from a PS/2 mouse successfully with a PBASIC Stamp. Such processing is generally done with a co-procesor such as this one:


Bruce Bates

<!--StartFragment -->

05-09-2006, 05:35 PM
Another option is the ezMouse www.multilabs.net/ezMOUSE.html (http://www.multilabs.net/ezMOUSE.html)

05-09-2006, 10:13 PM
Thanks for the answers, I ordered 2 PAK XI's. Hope the shipping to Sweden goes fast..