Prev: help in simulink buck converter
Next: manipulate matrix
From: Michael Purdy on 13 May 2010 12:23 Is it possible to communicate to a mouse PS/2 port using MatLab? As far as I can tell it can only be used to connect to a USB, parallel port, or certain types of hardware. Thank you. michael
From: Walter Roberson on 13 May 2010 14:55 Michael Purdy wrote: > Is it possible to communicate to a mouse PS/2 port using MatLab? As far > as I can tell it can only be used to connect to a USB, parallel port, or > certain types of hardware. Thank you. PS/2 ports are serial ports, and can in theory be controlled as serial objects -- but how well that theory can be put to practice may, I suspect, vary with the operating system. PS/2 ports are not RS232, but serial keyboards on computers that had PS/2 ports were often not RS232 either (RS422 sometimes). You might run into problems with contention with the operating system, especially if the mouse port happens to be the only mouse port on the system.
From: Michael Purdy on 14 May 2010 14:08 I'm trying now to set values within MatLab to 'COM1'. I believe that COM1 is generally the mouse PS/2 port. However, I'm not sure how to go about doing this because I don't think PS/2 ports have 'RequestToSend', 'DataTerminalReady', etc. pins that I can change as my data lines. Do you have any suggestions? What I've done so far: s=serial('COM1') set(s) %This gives all the properties of the port, such as 'RequestToSend' and others as mentioned above. Now I don't know how to send data to a pin in the PS/2 port which only has 6 pins unlike other serial ports. Thanks
From: Walter Roberson on 14 May 2010 15:28 Michael Purdy wrote: > I'm trying now to set values within MatLab to 'COM1'. I believe that > COM1 is generally the mouse PS/2 port. However, I'm not sure how to go > about doing this because I don't think PS/2 ports have 'RequestToSend', > 'DataTerminalReady', etc. pins that I can change as my data lines. Do > you have any suggestions? A description of the PS/2 pins and data protocol is available at http://www.computer-engineering.org/ps2protocol/ > Now I don't know how to send data to a pin in the PS/2 port which only > has 6 pins unlike other serial ports. I am getting the impression that you are trying to communicate with a device, and that you have some flexibility about controlling the device -- that you do not actually care about it being PS/2, but rather only care that it could potentially be used to transmit data. If that is the case, then potentially you could create your own transmission protocol -- though, of course, if there is already an existing driver you would, on the whole, prefer not to have to develop a new one. The references I find indicate that COM1 was used for a serial mouse, but not for a PS/2 mouse. In the surfing I have done, I have not yet found any device name for the PS/2 port; at the moment I am not sure if it had a standard name. http://www.webopedia.com/quick_ref/IRQnumbers.asp
From: Michael Purdy on 14 May 2010 15:47
Thanks very much for your help. You are correct in guessing that I am trying to control a device through MatLab code, and also that it doesn't matter that it is through the PS/2 port. I am trying to turn on/off a laser and would like to be able to control the frequency. I am using the PS/2 port because it is serial, and I literally just connected pins in the PS/2 with a wire to a breadboard. I had a USB-serial interface before that wasn't transmitting data fast enough so I couldn't change the frequency to a very high one. This is why I am trying to directly connect to the PS/2 port. |