PS2 to Serial Mouse Adapter

Share:

Motivation and overview

I needed a serial mouse for a 486 computer but I wasn't able to find one at reasonable prices, so searching the web I found 2 projects capable of acting as a PS2 host and translating the PS2 mouse protocol to Serial (in Microsoft mode). One project uses an AVR and another one uses PICs (16F628A and 16F88). I chose the latter, improved its firmware to include wheel support and designed a PCB.

At the time of writing (May 2019) PS2 mice are still available from eBay at reasonable prices and also many USB mice still support the PS2 protocol.

 

Schematic

The project I chose to improve was initially designed by Darron Broad of wiki.kewl.org.

The schematic is very similar to the original one except for the power supply and the bi-color LED. The LED helps determining if the mouse is working. The green LED will light up if the PS2 mouse has a wheel and jumper J1-1 is fitted and the red LED will blink when the PIC detects activity from the PS2 mouse.

Due to the changes I made in the firmware, jumper J1-1 will no longer select the overlow algorithm but will select the type of mouse, with wheel (jumper present) or without wheel (jumper not present). The remaining jumpers J1-2, J1-3, J1-4 will do the same as on the original firmware, select scaling and resolution.

For the power supply, you can choose either to use the micro-usb connector and feed 5V directly to the circuit or use the barrel jack with the 78L05 and feed anything from 7V to 16V. DO NOT PUT BOTH ON THE PCB, IT MAY DAMAGE THE 78L05.

If you really want to put both connectors and get a more versatile board, solder another SMD 1N4148 or similar backfeed diode, between pins 1 and 3 of the 78L05, ie, diode cathode connected to pin 3 and diode anode connected to pin 1 of the 78L05.

schematic

PCB

Once again I preferred the use of through-hole components when designing the PCB and tried to make it as compact as possible.

 pcb top view   dirtypcbs top layer

 PCBs can be bought at DirtyPCBs.com

Software

As mentioned above, firmware is based on PC Pointer by Darron Broad, available at hg.kewl.org, with some modifications made by me, based on code from matze79's PS2-Adapter to include wheel support. If you want to use the original firmware with this PCB, go ahead, it will work perfectly.

Currently my modified version of the firmware emulates a 2 button microsoft serial mouse or a microsoft wheel serial mouse, depending on jumper 1 of J1:

One thing to note is that when the jumper J1-1 is present, even if the PS2 mouse doesn't have a wheel, the emulated serial mouse will act as a Microsoft Wheel Mouse and transmit the 4 byte report packet but with the wheel movement set to 0.

I am still planing to port logitech's 3 button extension from matze79's project and make the wheel work as the 3rd button in the near future.

To compile the firmware, you'll need to get the GNU PIC utilities and use a Linux computer/VM or a Raspberry PI. After extracting the source code, go to the PCPointer folder and run make.

The source code is written in assembly and is very easy to understand, once you know how both PS2 and Serial mice work.

 

Prototype

Breadboard testing

breadboard 1 breadboard 2

 

Pictures and Videos

First PCB fully assembled.

pcb-assembled

 

Downloads

My firmware with wheel support

Unmodified, original firmware

 

References

  1. The PS/2 Mouse Interface - Technical information on the PS2 mouse protocol
  2. PC Pointer - Original firmware from wiki.kewl.org
  3. PS2-Adapter firmware - firmware for AVR chips with many extra features

 

Published on Monday 2019/05/27, last modified on Wednesday 2020/07/15