PS/2 Mouse Change Sample Rate (Command 0xF3)
Posted: Thu Jul 11, 2013 12:55 am
Hi,
I am trying to change the mode of the PS/2 mouse to a PS/2 scrollwheel mouse or PS/2 5-button mouse, which is done by changing the sampling rate three times in a row.
To send a command to the mouse, one must prefix the command by a command to the PS/2 controller on port 0x0064 to tell it that the next byte (on port 0x0060) is to go to device 1 instead of to device 0. So, a command (e.g. 0xF2) to the mouse should look like:
After a bit of looking, I found this page, which suggests that one should send two bytes to the mouse, receiving an ACK after each one. So, I tried:
I then tried making both bytes into PS/2 controller commands. This doesn't quite make sense to me since PS/2 controller command 200=0xC8 isn't anything, but perhaps it's better to interpret it as a single command split into two pieces?:
So my question: is this last way that I stumbled on really correct?
Note: On VirtualBox, the changing of the sampling rates in the final way doesn't change the device ID of the mouse. I'm not sure whether that's to be expected on VB. I haven't tested it elsewhere.
Note: The PS/2 controller was thoroughly initialized by the method suggested here
Thanks,
I am trying to change the mode of the PS/2 mouse to a PS/2 scrollwheel mouse or PS/2 5-button mouse, which is done by changing the sampling rate three times in a row.
To send a command to the mouse, one must prefix the command by a command to the PS/2 controller on port 0x0064 to tell it that the next byte (on port 0x0060) is to go to device 1 instead of to device 0. So, a command (e.g. 0xF2) to the mouse should look like:
- 0xD4 -> 0x0064
- 0xF2 -> 0x0060
- 0xFA <- 0x0060
- 0xD4 -> 0x0064
- 0xF3 -> 0x0060
- 200 -> 0x0060
- 0xFA <- 0x0060
After a bit of looking, I found this page, which suggests that one should send two bytes to the mouse, receiving an ACK after each one. So, I tried:
- 0xD4 -> 0x0064
- 0xF3 -> 0x0060
- 0xFA <- 0x0060
- 200 -> 0x0060
- 0xFA <- 0x0060
I then tried making both bytes into PS/2 controller commands. This doesn't quite make sense to me since PS/2 controller command 200=0xC8 isn't anything, but perhaps it's better to interpret it as a single command split into two pieces?:
- 0xD4 -> 0x0064
- 0xF3 -> 0x0060
- 0xFA <- 0x0060
- 0xD4 -> 0x0064
- 200 -> 0x0060
- 0xFA <- 0x0060
So my question: is this last way that I stumbled on really correct?
Note: On VirtualBox, the changing of the sampling rates in the final way doesn't change the device ID of the mouse. I'm not sure whether that's to be expected on VB. I haven't tested it elsewhere.
Note: The PS/2 controller was thoroughly initialized by the method suggested here
Thanks,