View Single Post
Old 30 October 2012, 11:13   #1
bobingabout
Registered User
 
Join Date: Aug 2012
Location: England
Posts: 41
My Amiga PS/2 Mouse controller

For starters, I'd like to state that this is not entirely my own work, the base of the project was taken from here: http://atariamiga.free.fr/sourisps2_e.php who in turn took theirs from here: http://www.bneven.com/mouseps2.html


Okay, why did I look into starting this in the first place? well, my old amiga mice are crap now, aged to retirement, so I went on EBay and purchased a USB to Amiga mouse converter. Aparantly I never had any USB mice that were compatable, so I decided to make my own.

Since I have a large supply of Microsoft Opitcal Wheel Mice with that USB to PS/2 brick, I thought it would probably be easier to try and make a PS/2 interface, rather than trying to mess around with the vastly "Unique per mouse" USB protocals. I doubt anyone could make a truely universal USB mouse controller.

So off I went, starting reasearch on a PS2 mouse controller, and, found the above 2 mentioned sites, along with others, but this project seemed the most practical to me. As you can see, it utilises a PIC16F84, something I have used before.


Since the code I used was version 1.2, the version number of my first project is 1.3.

Mouse project 1.3
To create an interface for using a PS/2 Mouse on the Amiga. Also since the code existed, why not for the Atari ST too, even though I don't own one.

I started by simply building the 1.2 as defined in the project on a peice of strip board, no photos of this, sorry. Turns out that the original "Amiga/Atari Autodetect" circuit didn't work, so, I re-wrote the code to check pin A2 instead of B6, and added a switch between 5V and GND. Thats it.
my Tests on my Amiga showed that it seems to work fine, switching the switch causes the mouse to go all crazy, which would indicate it is in Atari mode.
Note: Switch needs to be set on powerup, it is not checked after the initial check.
the original v1.2 code also seems to include a 10 second startup delay, which made the device useless for entering the boot menu, a comparison to the original V1 software shows that this did not exist, so simply removing the delay results in win.

Here is everything you should need for project 1.3, including a photo of the end result.
Code header file
Code
Compiled file

Photo (its a big file, I won't kill your connection by forcing it to load here)
Note: if you file down the corner of the DB9F connector, it will fit in the mouse socket on the A600, and work fine.


Mouse Project 1.4
To intergrate a Joystick port onto the Mouse controller.

Research linked me to a Picture of a schematic diagram of a Joystick/Mouse Auto-switch, There's not much to say about it, just that it utilises a 74LS157 to switch between the 2 ports, and an 74LS00 to implement an RS latch to detect button presses and control the switch.

For my project, I did away with the 74LS00, intergrating the function into the PIC chip, therefore the Button 1 and Button 2 of the Joystick connect to Pins A3 and A4 on the PIC. I then monitor these lines during the wait delay in the mouse data transfer routine, switching to Joystick mode which simply changes the Logic state on pin B7, which connects to the 74LS157 control line. upon detecting a mouse press (any button) it then switchs back to Mouse mode.

NOTE: Since pins 6 and 9 of the Joystick port go through the PIC chip, they can no longer be used for a PotX and PotY function, only button2 and button3.

No photos, but here is the info.
Code header file (same as above)
Code
Compiled file



Mouse project 1.5
To put project 1.4 in an A1200

Not much changed from V1.4. Since it is inside an Amiga, it doesn't need to enter Atari mode, therefore I changed the function of pin A2 to be the middle mouse button on Joystick port in, even though its probably never used, and removed the check for an Atari. It's lazy, but works, and can easily be changed to use the Atari code if anyone wanted to.

Code header file (same as above)
Code
Compiled file

Photo of the back of my Amiga.
Photo inside the amiga with Shield
Photo inside the amiga without shield

As you can see, I cut away the side of the shield so it can comfortabbly stick out and still use the original mouse slot for the joystick port.

Last edited by bobingabout; 30 October 2012 at 11:57.
bobingabout is offline  
 
Page generated in 0.05223 seconds with 11 queries