PS/2 mouse to Amiga DB9 adapter

It’s time for something more complicated than rewiring premade stuff. After joysticks and gamepads, next thing that you can’t replace that easy is the mouse. After searching the net for a bit I found the solution on Aminet. Small device with microcontroller (MCU for short) that translates signals from standard PC PS/2 type mouse to signal Amiga understands. I also found versions with USB connector, but it’s actually a bit of deception. “Real” USB mice aren’t supported. As far as I understood there are too many variations in USB implementations to implement USB support with these small microcontrollers. It is possible, but it would need more powerful MCU and would subsequently cost more. It could be made with simple MCU but then it would work only with mouse type that it was tested with during development, even so far that it could happen to work only with that specific model, not the whole brand.

Adapters that have USB connectors actually support only USB mice that use PS/2 protocol over USB port. With mice like these you often get USB to PS/2 adapters so it’s actually only cosmetic, not to have USB connector plugged into PS/2 adapter and then into this Amiga adapter. I prefer to have PS/2 connectors as it supports both “real” PS/2 mice and these PS/2 over USB mice. I hope this all isn’t too confusing, in short, with adapter like this (one with PS/2 connector, not USB) you can connect PS/2 mouse, or mouse that uses PS/2 protocol over USB if you use simple adapter. “Real” USB mouse won’t work. I use optical Genius XScroll PS/2 mouse, it costs (in Croatia) around $6, it works great, far more precise than original Amiga mice. One just needs to be carefull to get one that’s PS/2 because there’s also USB version on sale. I have only PS/2 version so I can’t test if USB one is actually PS/2 over USB or native USB (which would definitely not work).

Original file with schematics and instructions can be downloaded on Aminet

http://aminet.net/package/docs/hard/ps2m

And I think I found author’s site here

http://ps2m.sotchenko.ru/index.html

In “full” version this adapter uses both DB9 ports on Amiga, but it supports all kind of things. Mice with 5 buttons, one or two scroll wheels, having two joysticks and the mouse connected and so on. For these additional functions (5 buttons, mouse wheels) driver on Amiga is required). Shematics and instructions how to build one are in original file.

All that is great, but not really necessary, I would be happy to simply have the ability to connect PS/2 mouse and to use it as a regular Amiga mouse, two buttons and movement. This minimal function set doesn’t require much components and uses only one DB9 port on Amiga, just like the real mouse. I have adapted the schematics and this is the result.

Schematics

Schematics

Microcontroller is PIC 16F628A, ceramic capacitor is used to straighten it’s power supply if need be, mouse connects to female PS/2 connector and female DB9 plugs into Amiga and power both the adapter and mouse. First versions used older 16F84(A) which needs external oscillator for frequency generation, 16F628(A) has internal oscillator so that’s few components less and also less space required. I used standard through hole components to make it easier to build. One could use SMD components and make the whole device smaller, but that would make assembly somewhat more complex.

I made two versions of the PCB. Basis is the same, only difference is DB9  connector. All adapters I saw have DB9 connector soldered to PCB and than it connects to computer. I don’t like this because that makes whole adapter actually hang on computer’s DB9 port, and every now and then mouse cable would also tug it and strain the port. It’s not much but if I can avoid it… That’s why I used 2×5 header on second version and DB9 connector that crimps to ribbon cable. This way only DB9 connector plugs into computer, and adapter itself can rest on the surface and not strain computer’s connector.

DB9 version

DB9 version

Ribbon cable version

Ribbon cable version

Red lines are jumper wires, although they represent lines on the top side of the board. For this simple layouts I use single sided boards so I just solder wires on top side where these lines are supposed to be. So far I haven’t found better way to represent these jumper wires, as far as designing electronics goes I’m self taught 🙂 .

I made few of these ribbon cable adapters and they all work great. No problems or instabilities, tested on Amiga 500, 600 and 1200.

Only thing that that needs some attention is programming of the MCU. File ps2m_5button.hex is used for all supported MCUs, 16F627(A), 16F628(A) and the old 16F84(A), which is technically supported by software, but isn’t compatible with my PCB. 16F84(A) needs oscillator which isn’t included in my design since these newer ones have internal oscillators. I’ve tested it with 16F628A and it works without problems. But it’s not that hard to add oscillator and it’s two capacitors if someone still has 16F84(A)s.

When programming MCU’s these are the options that need to be set in programmer’s software in case we use 16F84(A):

OSC = HS
WDT = ON

In case of 16F627(A) or 16F628(A) these are the settings:

OSC = INTRC without CLKOUT
WDT = ON
LVP = OFF
MCLRE = OFF

How exactly it’s configured depends on what programmer and software you’ll use. I use Pickit2 programmer and it’s software, this is how I needed to set these options when programming 16F628A:

Pickit config

Pickit config

If your programmer has similar display for PIC’s CONFIG register you can set it to hex value 215C, or binary value 0010000101011100, whatever it uses, and configure required values that way.

And that’s basically that. Adapter works as it should, I already mentioned that I used mine with cheap Genius XScroll optical mouse without any problems. It never froze or went berserk. Compared to original Amiga mouse it’s way more precise and movements are more fluid.

This is how adapter looks, I etched version that has empty space filled out, it doesn’t affect it’s function, it’s just to save on etching acid. In rar file at the end of this post there’s PDF with both this and version that has only traces.

PCB after etching

PCB after etching

After etching I sanded excess PCB and soldered the components (Instead of soldering MCU directly I soldered socket, that way I can always take it out and reflash it). Soldering could be better but it’s one of my first projects so… 🙂

PCB after soldering

PCB after soldering

And finaly, finished product and DB9 connector on ribbon cable. When assembling the cable one should take care on which side is pin 1. Cable has 9 leads and 2×5 header has 10, pin number 10 should be left unconnected on the header. On DB9 connector all are used since it has exactly 9 leads.

Finished adapter with DB9 ribbon cable

Finished adapter with DB9 ribbon cable

Here’s a bit enlarged picture of this, on the left side of the 2×5 header (from this perspective) remains one “hole”.

2x5 Pin Header

2×5 Pin Header

And the complete cable…

Translate in en_us: DB9 i header

Translate in en_us: DB9 i header

To protect electronics a bit I used heat shrink tubing 3 cm in diameter (a bit more than an inch), it’s usually used to insulate wires (that’s some huge wire if it need that diameter 😯 ). It’s just big enough to go around the device, after heating it up it shrunk nicely. Here’s how it looks, nothing fancy or high tech, but it’s OK to me, electronics are protected and connectors accessible.

Final adapter with and without heatshrink tubing

Final adapter with and without heatshrink tubing

And there you have it, finished product 🙂 , on link below you can download Eagle schematics and layout for this adapter (both ribbon and DB9 versions) to modify or print. For those who want only to print I also included PDFs for printing this schematic (in A5 format) of both versions and in two flavours (with and without filling for empty space on PCB).

Schematics, layout and firmware (after download remove .doc extension, it’s a wordpress thing…) : PS2toDB9.rar.doc

Bill of parts for ribbon cable version:

1x PIC16F628A microcontroller
1x 100nF ceramic capacitor
1x PS/2 female connector for PCB
1x 2×5 pin header with ribbon cable connector
1x DB9 female connector for ribbon cable
1x 9 wired ribbon wire

Bill of parts for DB9 for PCB version:

1x PIC16F628A microcontroller
1x 100nF ceramic capacitor
1x PS/2 female connector for PCB
1x DB9 female connector for PCB

Advertisements

Posted on September 21, 2014, in Amiga, DIY, Retro computing and tagged , , , , , . Bookmark the permalink. 13 Comments.

  1. Hello,
    I need some help, i have build it but is not working the pic is the 16F628A.

    Antonis

    Like

  2. Are you sure you’ve set configuration bits correctly when you programmed the microcontroller?

    Like

    • Hello, yes the configuration bits was correct the programmer software has bug and reverse them , when I was selecting one bit to be enabled in the programmer software actually was the opposite.

      After that it worked perfect.
      Thank you

      Like

  3. Hi Thank you ! I just built this and works great, only problem is I have the buttons reversed, I have to use right mouse button to click, any ideas what I could’ve done wrong? I used cables and protoboard instead of your PCB. Regards, uctumi

    Like

  4. oh I found the reason, I had two pins mixed up in the connection between DB9 and the IC, it’s fine now 🙂

    Like

  5. I have problems programming the config with a GALEP-IV. It has way more options than you provide here. Setting the value manually to 215C does not work, it will not be programmed. there is always a verification error. I use PIC16F628, not 16F628A and they seem to have different config values. For example, setting the copy protection option to “off” is “1” for 16F628A and “11” for 16F628. Even when I set the values as you wrote above, it does not work. So, is it possible, that this is not working with a 16F628 IC?

    Like

    • 215C is value for 16F628A, as you said, 16F628 uses different configuration word bits. For 16F628 215C (or 10000101011100 in binary) means something else and won’t work.

      I’ve written above what 215C actually means when it comes to options

      OSC = INTRC without CLKOUT
      WDT = ON
      LVP = OFF
      MCLRE = OFF

      For 16F628 these options translate to 3D5C (or 11110101011100 binary).

      Maybe that’ll help, but if it’s verification issue I’m not sure.

      Generally I had issues when I used universal programmers (I have GQ-4X) for PIC programming, especially when it comes config word programming (my first SD2IEC adapter for example). It wrote the code fine, but it didn’t manage to program config word and PIC of course didn’t work. Cheap ebay PIC programmer worked fine.
      Universal programmers are fine when it comes to (E)EPROM writing, but for MCU specialized solution is better.

      But anyway, try with 3D5C config word, it may work and solve your issue.

      Like

      • Thanks for your answer! I managed to get it working half the way, I think. The buttons are working and up/down movement is also working. But not left/right movement. What can cause this problem? Btw. I tried a cheap TL866 programmer and was not even able to set the configuration bits to the hex value that you wrote. Seems to be a problem with the programmer’s software. In the Galep-software, I can enter the value manually for configuration…

        Like

      • Have you paths from MCU to DB9 connector and PS/2 connector. If some functions work, and some other don’t it looks like there’s connection issue. Code is a code, it’ll work or not. If it works than it seems MCU is flashed correctly so this looks like only thing that could be problem.

        Like

      • I’ve checked the complete layout and every connection is there. I used your PCB layouts to order some PCBs. Any ideas?

        Like

  6. I love the design – nice and simple to assemble using the DIP package!

    I was thinking of modifying this design to work as an automatic joystick and mouse switcher as well. Would you consider have the source code/ pcb’s being put onto git hub or similar so I could extend the project?

    Mike

    Like

  7. pantelius pahatursidis

    I tried to make it work but nothing. I doublecheck everything. Dissapointment. I used Pic 16f628a I programmed with pickit 2 everything ok but my microsoft optical mouse not working. Just one time worked and then nothing. Everything is ok the mouse the amiga the serial port. I checked the connections 1 by 1 i made 3 models but nothing. I use the 5 btn hex file, with settings like you said. The only wrong is the cap which my multimeter shows it 60nF but it is a 104 (100nF) . Do you have any suggestions ? Thank you for all infos. Greetings

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: