Problem connecting a PS/2 mouse to a Basic Stamp
BobbyJ
Posts: 22
Standard disclaimer: I am new to Basic Stamps
I am working on a prodject and am trying to connect a PS/2 mouse to a BS2. The reason for using a PS/2 mouse is simply because I have a few extras laying around.·I was planning on using the SHIFTIN and SHIFTOUT commands to handle communications with the mouse.·The commands seemed to be almost perfect for what what I needed to do.
Here's the problem I have. The command reference for SHIFTIN and SHIFTOUT·both state that they·will·generate the clock signal. But, the PS/2 mouse protocol states that the mouse always generates the clock signal. Having both devices generate the clock signal seems like it would be a problem.
So far·the only work around I can think of is·using PULSIN to listen for the clock signal. But the problem I see with this is the command reference states, "PULSIN will wait, for the desired pulse, for up to the maximum pulse width it can measure". For the BS2 that is 131.07 ms. There is a really good chance that the mouse·will sit idle for peirods much·longer than that. I am pretty much all "googled-out" looking up info on the PS/2 protocol, and do not know for sure if the mouse·sends any data when it is idle. I am assuming it does not, which means that PULSIN will do a lot of "timing out" waiting to the clock signal to start.
Anybody have a solution for this?
I am working on a prodject and am trying to connect a PS/2 mouse to a BS2. The reason for using a PS/2 mouse is simply because I have a few extras laying around.·I was planning on using the SHIFTIN and SHIFTOUT commands to handle communications with the mouse.·The commands seemed to be almost perfect for what what I needed to do.
Here's the problem I have. The command reference for SHIFTIN and SHIFTOUT·both state that they·will·generate the clock signal. But, the PS/2 mouse protocol states that the mouse always generates the clock signal. Having both devices generate the clock signal seems like it would be a problem.
So far·the only work around I can think of is·using PULSIN to listen for the clock signal. But the problem I see with this is the command reference states, "PULSIN will wait, for the desired pulse, for up to the maximum pulse width it can measure". For the BS2 that is 131.07 ms. There is a really good chance that the mouse·will sit idle for peirods much·longer than that. I am pretty much all "googled-out" looking up info on the PS/2 protocol, and do not know for sure if the mouse·sends any data when it is idle. I am assuming it does not, which means that PULSIN will do a lot of "timing out" waiting to the clock signal to start.
Anybody have a solution for this?
Comments
All these newbies with their fantastic ideas.................
Klaus
If you ignore the parity bit, you'll only need an 8-bit shift register.· You will need some additional logic to recognize the start and stop bits.
·
http://www.al-williams.com/pak11.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
·
http://www.al-williams.com/pak6.htm
Ion
The project I am now working is to build a custom controller for my XBox. Before getting the XBox I had always gotten my gaming fix from my PC. My all time favorite type of games to play are First Person Shooters. On the PC I used the keyboard and mouse as controllers for the games. The keyboard is used for movement (forward, back, left, right, jump, crouch, evade, etc.) and the mouse is used to aim and fire weapons. It is hands down (in my opinion) the most fluid and accurate way to play these types of games.
Unfortunately, as far as I can tell, Microsoft did not allow for direct support on the XBox for a keyboard and mouse. If somebody wants to develop games for the XBox and wants to allow for the option for using them, they have to write all the code into the game to support it. So I am currently in the position of being forced to use the game controller that shipped with the XBox. These controller work extremely well for some games, but not for what I am playing.
My goal is to replace the right thumb-stick on the XBox controller with a mouse and to replace everything else with new buttons. The idea is to have the same type on controller·for the XBox that I already have on my PC. So far I have been able to do everything except replacing the right thumb-stick. This is the only part of the project, at least for now, that I will be using the BS2. Once I get the X & Y axis and the button state information into the BS2, everything will/should be pretty easy.
I'll check out the links you guys gave. I was hoping this problem could be solved using just the Basic Stamp. But, if I have to add in something else i guess I'll go that route.
Good luck!
Al Williams
AWC