Changes

Jump to: navigation, search

PS2Mouse

1 byte added, 11:52, 4 January 2010
Although I have taken the utmost care preparing this documentation, I do not guarantee that it is error free and I accept no responsibility for damage to anyone’s CPC, Mouse or other personal equipment or injury inflicted on you or others.
== Mapping to Joystick Signals ==
 
Row9.Bit0 Joy1up LOW for 1/300s per mickey, when mouse moved up
Row9.Bit1 Joy1down LOW for 1/300s per mickey, when mouse moved down
Row9.Bit2 Joy1left LOW for 1/300s per mickey, when mouse moved left
Row9.Bit3 Joy1right LOW for 1/300s per mickey, when mouse moved right
Row9.Bit5 Joy1fire1 LOW when Right mouse button pressed
Row9.Bit4 Joy1fire2 LOW when Left mouse button pressed
Row9.Bit6 Joy1fire3 LOW when Middle mouse button pressed
Row6.Bit0 Joy2up LOW when mouse wheel turned towards user
Row6.Bit1 Joy2down LOW when mouse wheel turned towards screen
== The Circuit ==
There are two switches on the PCB, the inner one (beside the power socket), should in most cases be left in the OFF position. This is the Auto-detect position. The firmware will auto-detect which type of mouse is connected and initialise it as required, if however you have a mouse which is not being recognised correctly (Error lamp flashes or incorrect output), switching this switch ON will tell the PIC not to auto-detect and to assume a type 00 mouse (standard mouse with no scroll wheel or extra buttons) and may allow you to continue using the mouse. The position of this switch should be chosen before power is applied. In some cases, although you have chosen auto-detect, the PIC may recognise that the mouse is incompatible and dis-enable the scroll wheel although one is present, the mouse should however continue to work as a non-scroll wheel mouse.
The second switch is for turning the scroll wheel signals on and off. Switching this switch ON allows the PIC to pass the scroll wheel movements on to the CPC. If a correctly recognised scroll wheel mouse is connected and this switch in ON, movement to the scroll-wheel will cause a “5” (Joy2 UPDown) for each roll upwards and a “6” (Joy2 DOWNUp) for each scroll downwards, this may have negative effects with software which has assigned these characters to other functions, so for this reason I chose to include the option to block it. This switch can be used at any time without resetting.
The 5V power lead that usually goes to the CPC should be connected directly to the Adapter PCB, the fly-lead is then plugged into the CPC. When the power is applied, the PIC will try to recognise and initialise the mouse. If recognition and initialisation is successful, the LED will blink once for approximately one second. After this any movement of the mouse will make the LED blink. If the mouse fails to initialise (there may be incompatible ones out there or it may just be broken) the LED will flash continuously in one second intervals.
 
== Mapping to Joystick Signals ==
 
Row9.Bit0 Joy1up LOW for 1/300s per mickey, when mouse moved up
Row9.Bit1 Joy1down LOW for 1/300s per mickey, when mouse moved down
Row9.Bit2 Joy1left LOW for 1/300s per mickey, when mouse moved left
Row9.Bit3 Joy1right LOW for 1/300s per mickey, when mouse moved right
Row9.Bit5 Joy1fire1 LOW when Right mouse button pressed
Row9.Bit4 Joy1fire2 LOW when Left mouse button pressed
Row9.Bit6 Joy1fire3 LOW when Middle mouse button pressed
Row6.Bit0 Joy2up LOW when mouse wheel turned towards user
Row6.Bit1 Joy2down LOW when mouse wheel turned towards screen
== Testing The Mouse ==
1,179
edits