Problem reading a PS/2 mouse
Klas
Posts: 3
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?
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?
·
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?
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?
·
Comments
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:
http://www.awce.com/pak11.htm
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->