Jump to main content

Jump to main menu

Henryk Richter

Amiga USB Wheel Mouse Adapter

DIY USB Mouse interface for Amiga Computers

You are here: Homepage » Hardware » Amiga USB Mouse 

Introduction

example UWMouse adapters

When enjoying some time with classic computers, users might wish for a little bit of comfort when it comes to the input devices. Especially the old mechanical mice tend to clog up and require a lot of attention. In light of this, modern optical mice work much smoother and way more reliably. As a consequence, numerous adapter solutions for PS/2 Mice have been available for decades. Sadly, the market for PS/2 protocol compatible mice is drying out these days. Therefore, USB solutions are the only option to get modern mice working with old computers.

USB Mouse adapters are available for the Amiga platform, both in form of commercial offerings and OpenSource projects (such as SmallyMouse). All of these previously developed USB solutions for the Amiga (that I am aware of) are based on the USB boot protocol which doesn't offer support for the scroll wheel.

That's why I decided to build my own solution which implements the full USB HID mode (or report mode) and supports wheel movements along the way.

I've been running this solution for all my Amiga computers for the better part of a year now (A500/A1200/A3000/A4000, Akiko32) with both wired and wireless mice. Even the rather tricky Logitech Unified Receiver does it's job reliably.

The Software stack is built around a modified version of the LUFA library.

LUFA Library
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org

Hardware and building notes

This adapter is based on the ATMega AT90USB1287 microcontroller. This uC can operate as USB device or host. I've set up the project with readily available parts that are still listed by the usual distributors like Digikey or Mouser. My PCB design can be found in the downloads section below in Gerber format.

Conceptually, this adapter is meant to keep compatibility to existing applications with respect to mouse movement and especially buttons. There is no need for a special driver to operate the three mouse buttons such that AmigaOS applications, NetBSD or Linux will work fully out of the box. This design choice means that the signals for the mouse wheel will be sent through the second DB9 port (Joystick port). While a two port design will not win an award for first glance elegance compared to 1 port solutions like Cocolino (serial transfer of extra information) or Micromys (analog extra information), there are some benefits towards compatibility (see above), robustness and required CPU resources. A second PCB containing an automatic switcher is part of this project in order to keep the option of Joystick connectivity. Hence, UWMouse consists of two parts: USB Mouse adapter and Joystick switch.

I'd suggest to start with the ATMega when building the PCB. There is not too much space around the uC and I've found it most convenient to populate it first. The minimal list of parts for uC programming consists of the ATMega, C1,C2,Y1 and R3 alongside the programming header J5. I've placed a circular mark on the silkscreen for correct placement of the ATMega. Please note that the images in this section show version 0.2/0.3 of the PCB. The later V0.4 has got three pins on J3 (W1,W2,+5V).

Next up are R1,R2,R4,R8,R9,C4 and the two LEDs. Please place the 100nF capacitors before soldering J1 and J2. Don't forget the two resistors on the bottom side. Else the LEDs won't work. R8/R9 should be either a solder blob or 0 Ohm resistors.

You may test the adapter without the DIP switches (just in case there are solder joints to correct). The DIP-Switches are supposed to enable optional features and won't be needed for initial tests.

When connecting a USB device, the red LED will glow for 2-3 seconds. After a mouse is detected and properly configured, the red LED will go off and the green LED is lit. Should the adapter run into issues with the format of the USB report mode, then it'll try to get into emergency (=USB boot) mode instead. In that case, both LEDs will be on. I am not aware of mice that need this special treatment (as of this writing).

J4 exposes the UART for debugging purposes. Please note that RX and TX of J4 are TTL level, hence you'd need a FT232R board, level shifters or similar to connect these to an RS232 port. The settings for the UART are 9600 8N1, no flow control, no hardware handshake.

The DIP switches are off by default. Their functions are as follows:

  1. half DPI or mouse speed (useful for hires gaming mice)
  2. force USB Boot protocol (as last resort for problematic mice, no wheel support in this mode)
  3. keep 0, no function at this time
  4. reverse scroll wheel direction (also possible in software, see README of UWMouse Commodity)

The Autojoy adapter is even easier to populate: start with the ATTiny, then add C1/R1 and the three connectors, done. Please pay attention to the location of the female connector on the PCB. The same applies to the male joystick connector. The silkscreen is marked accordingly.

UWMouse minimal population (Platine 0.2)
UWMouse backside
UWMouse fully populated
UWAutojoy minimal population

Programming

Atmel ICSP pinout for 10 pin and 6 pin variants

The uCs on the two boards need a firmware after building up the PCBs. For this task an Atmel compatible programmer is needed. A popular option for such programmers is the USBasp which can be found for affordable rates on sites like *Bay or *mazon. Other ICSP based programmers will work, too.

Pin 1 of the ISP header on both boards is marked on the silkscreen. The ISP header on UWMouse and UWAutojoy follows the common pinout. If your programmer has got a 6 Pin ICSP, then it can be connected directly. Please refer to the provided drawing in case that your programmer has got the ICSP1 format with 10 pins and connect the programmer to the boards by Dupont cabling. Another option would be to search for a 10 pin to 6 pin adapter cable that can be found at the usual sites.

There are several programs available for ATMega programming. My examples below will be based on the free AVRDude in conjunction with an USBasp.

The procedure for UWMouse is:

<code>avrdude -c usbasp -p at90usb1287 -U flash:w:UWMouse.hex:i</code>

Since the UWAutojoy runs on the internal clock of the ATTiny, the clock rate of the programmer might be a little too high. Therefore, I've included -B 30 in the command line below.

<code>avrdude -B 30 -c usbasp -p attiny44 -U flash:w:AutoJoy.hex:i</code>

Cabling

Connection between UWMouse and UWAutojoy (Rev. 0.4+)

Since PCB revision 0.4, a 3 pin cable connects UWMouse and UWAutojoy. The cabling is 1:1. Both PCBs have the same silkscreen marking for W1,W2 and +5V. My case design assumes JST EH connectors.

The minimal length of the cables depends on the Amiga model. On A500, A1200 and A3000, the joystick connector is directly beside the mouse port such that a short cable will suffice. On A2000/A4000, the mouse and joystick ports are reversed in their positions and require a longer cable.

Operating

After successfully programming the ATmel uCs on both PCBs it is implicitly verified that there is no short between 5V and GND. When UWMouse is connected to the Amiga without USB mouse attached, then no LED will be active. Note: USB Hotplug is supported by hardware and firmware. Once a USB device is connected to the adapter, the red LED will be active for 2-3 seconds while the USB device is configured. After successful configuration, UWMouse switches to the green LED. From that point, the mouse should work on the Amiga.

If DIP switch 2 is active (ON), then both LEDs are on after the configuration. This state denotes that UWMouse is in "Emergency Mode" aka USB Boot protocol. In this mode, only X/Y movement and the three buttons are active, not the mouse wheel.

Testing the mouse wheel (and UWAutojoy functionality) can be done quite comfortably on programs like Advanced Amiga Analyzer (AAA) or AmigaTestKit (formerly Systest). You should see the signal of the mouse wheel reflected on changes to pin 1 and pin 3 of the joystick port. Movement or pressed fire button of the Joystick will switch UWAutojoy to the joystick mode such that it patches the Joystick movement through to the port.

Software

Tooltypes of the UWMouse driver

The elementary mouse functions of UWMouse are directly translated by the firmware to the Amiga mouse port such that neither the Desktop applications nor games require any driver. Only the mouse wheel function needs driver software.

The first component of the software stack is the hardware specfic driver which reads the signals from the Joystick port to pass the information about mouse wheel movement into input.device. Suitable software is either WBM (Aminet, see enclosed documentation) or my Commodity. You find the latter also in the downloads section of this page. The UWMouse Commodity can simply be put into SYS:WBStartup after depacking from the LHA archive.

Most Amiga programs won't provide support for mouse wheel events by themselves, though there are notable exceptions (Eagleplayer 2.06, recent MUI versions). Hence, to get mouse wheel support in most applications, another piece of helper software is needed. 

AmigaOS3.2 does have the wheel mouse helper functionality built-in. See SYS:Prefs/IControl for activation of wheel support. The UWMouse driver mentioned above is still needed, though.

You should install FreeWheel on older AmigaOS versions (3.1,3.9,3.1.4 etc.)  as a system wide helper for scrolling functionality in most AmigaOS applications.

Compatibility

I can't guarantee compatibility with all mice, due to the sheer number of vendors and devices on the market and their sometimes interesting behaviour (nicely put). I've put a list of successfully tested mice below.

One important aspect is that only direct connections to mice or their wireless dongles are supported. USB hubs won't work due to limitations of the particular ATMega chip.

Of the mice I tested, only the Logitech MX900 was found to be incompatible. The reason for this case is an internal USB hub in it's base station.

  • Logitech iFeel Mouse (46d/c030)
  • Logitech Wheel Mouse M-BD69 (46d/c00c)
  • Logitech Wheel Mouse M-BJ58 (46d/c00e)
  • Logitech Wheel Mouse M-BT58 (46d/c03e)
  • Logitech M110 (46d/c064)
  • Logitech Cordless Mouseman Optical (46d/c504)
  • Logitech M335 (46d/c52b Wireless Unifying Receiver)
  • Microsoft Intellimouse Optical (45e/39)
  • PS/2 USB Adapter (4b4/8081)
  • Logilink ID0011 (1c4f/34)
  • Razer Abyssus V2 (1532/005b)
  • Steelseries RIVAL 650 (1038/172b)
  • Apple Mighty Mouse (5ac/304)
  • Cherry MC1000 (46a/b091)
  • Roccat Kone AIMO (1E7D/2E27)
  • Logitech MX1000 Bluetooth Laser Mouse (46d/c70e, Apex)
  • Microsoft Comfort Mouse 6000 (Apex)
  • Logitech Mouseman M-BA47 (Marmacc)
  • Logitech Corded Mouse M500 M-U0007 (Marmacc)
  • Logitech MX Anywhere 2S Bluetotth M-R0067 (Marmacc)
  • Logitech Optical Mouse MX500 M-BP81A (Marmacc)

Images

Case variants: with DIP or extra flat
A500/A1200 version
special variant for A3000 (w/o AutoJoy)
special variant for A4000
special variant for A4000 internals

Downloads

THIS MATERIAL IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS HARDWARE AND SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

The following material may be used under the terms of the Attribution-NonCommercial-ShareAlike 4.0 International creative commons license. Please refer to creativecommons.org for details.

UWMouse.lha

AmigaOS 2.0+ WheelBusMouse driver commodity

UWMouse04_gerber.zip

UWMouse Gerber files for PCB order (2 layer)

UWMouse04.xlsx.zip

BOM for UWMouse and UWAutojoy alongside Digikey/Mouser part numbers

UWAutoJoy04_gerber.zip

UWAutojoy Gerber files for PCB order (2 layer)

UWMouse_Autojoy_Case_STL.zip

3D print case designs: generic with two individual cases or A500/1200 design (M2,5 cylindrical screws 10/12mm and- M2,5 nuts required)

UWMouse_Autojoy_Firmware13a.zip

Firmware for AT90USB1287 and ATTiny44A