Skip to the content
PCBKitNew board
2 layers52.3 × 42.2 mmSmallyMouse2, the printed circuit board in 3D

Universal USB to quadrature mouse adapter

Size
52.3 × 42.2 mm
Copper layers
2
Thickness
1.6 mm
Parts
37
Nets
62
Pads
157
Tracks, vias
309, 21
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
25 May 2017
Updated
19 Oct 2026

Overview

SmallyMouse2 is an open-source printed circuit board by Domesday86, from the Domesday86/SmallyMouse2 repository on GitHub. It is a 2-layer board of 52.3 × 42.2 mm with 37 parts on 62 nets, routed with 309 tracks and 21 vias.

It is built around the AT90USB1287-AU. Its parts include 10 capacitors, 7 connectors, 4 resistors, 1 IC and 1 crystal. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

Synopsis

SmallyMouse2 is the AT90USB1287 firmware source code and KiCAD schematic/PCB design for the SmallyMouse2 project.

Detailed documentation is available on the SmallyMouse2 wiki.

The schematic and PCB design in KiCAD/ are in the KiCad 10 file format and require KiCad 10 or later to open. The original KiCad 4 files are available in the git history (commit 66cf90d and earlier).

Motivation

SmallyMouse2 is a project that creates a USB mouse adaptor for retro computers that use quadrature mouse input including the Acorn BBC Micro, Acorn Master series, Commodore Amiga, Atari ST, busmouse compatible computers and many more. SmallyMouse2 provides both a generic mouse output header (for attaching mouse to retro computer cables) and an IDC connector suitable for use with Acorn 8-bit user-ports. SmallyMouse2 also features a configurable quadrature rate limiter that prevents VIA overrun when in use with slower 8-bit machines.

SmallyMouse2 supports both JTAG and USB bootloader programming. The AT90USB1287 is pre-programmed by Atmel with the (FLIP) DFU bootloader; this bootloader is recognised by Atmel Studio as a programming device and can be used to flash the firmware to the board.

Installation

The firmware is built with the open-source AVR GNU toolchain (avr-gcc, avr-binutils, avr-libc) and CMake. A Nix flake supplies the complete, pinned toolchain along with the programming tools (avrdude for the Atmel-ICE, dfu-programmer for the USB bootloader).

Building

Enter the firmware development shell (code, also the default) and build out-of-tree using a CMake preset:

text
nix develop                     # or: nix develop .#code
cmake --preset release          # or: cmake --preset debug
cmake --build --preset release

The output is written to build/release/:

FileUse
SmallyMouse2.hexFlash image (Intel HEX) - JTAG via avrdude, DFU via dfu-programmer
SmallyMouse2-with-bootloader.hexFirmware merged with the LUFA DFU bootloader - JTAG via avrdude
SmallyMouse2.elfFull image with symbols - JTAG via Microchip Studio / debugging
SmallyMouse2.eepEEPROM image (currently empty)
SmallyMouse2.srecFlash image (Motorola S-record)
SmallyMouse2.lssExtended listing
SmallyMouse2.mapLinker map

Two firmware images are built from the same source. SmallyMouse2 is the normal firmware; SmallyMouse2-swapped has the middle and right mouse buttons reversed (for example, for Kensington Expert Mouse trackballs used as replacements for the Domesday AIV system's RB2 trackball). Each image has the same set of files, so SmallyMouse2-swapped.hex, SmallyMouse2-swapped-with-bootloader.hex, and so on, sit next to the files above.

Alternatively nix build produces the same files in ./result/ without entering a shell.

Without Nix, any avr-gcc toolchain, CMake 3.24+ and Ninja on the PATH will work with the same commands.

Programming via JTAG (Atmel-ICE)

Connect the Atmel-ICE to the JTAG header, then:

text
cmake --build --preset release --target flash-jtag

or, without a build tree, nix run .#flash-jtag. The fuses and lock bits can be read with the read-fuses-jtag target.

To flash the firmware with the middle and right buttons swapped, use flash-jtag-swapped (or nix run .#flash-jtag-swapped) instead.

Programming over JTAG performs a chip erase, which also removes the DFU bootloader, so flash-jtag writes SmallyMouse2-with-bootloader.hex (the firmware merged with the LUFA DFU bootloader) and the board can still be updated over USB afterwards. The bootloader image comes from the Nix flake; without it (BOOTLOADER_HEX unset) flash-jtag writes the firmware alone and the bootloader is lost.

Restoring the DFU bootloader and fuses (Atmel-ICE)

If the bootloader is missing (for example after programming with another tool) or the fuses no longer select it, connect the Atmel-ICE and run:

text
nix run .#flash-bootloader-jtag

or, from the dev shell, cmake --build --preset release --target flash-bootloader-jtag. This builds the LUFA DFU bootloader from the pinned LUFA source, erases the chip, writes the bootloader and sets the high/extended fuses to the factory values (hfuse 0x99, efuse 0xF3: 8 KB boot section, JTAG enabled, HWB bootloader entry enabled). The LUFA bootloader uses the same USB ID as the factory one, so the DFU steps below work unchanged. Any application firmware is removed; reprogram it over USB afterwards.

Programming via USB (DFU bootloader)

Put the AT90USB1287 into its factory DFU bootloader (hold HWB low while resetting), then:

text
cmake --build --preset release --target flash-dfu

or nix run .#flash-dfu. The device is erased, programmed and then started.

To flash the firmware with the middle and right buttons swapped, use flash-dfu-swapped (or nix run .#flash-dfu-swapped) instead.

USB permissions (udev)

On Linux, programming as a normal user needs udev rules for two devices:

DeviceUSB IDUsed by
Atmel-ICE03eb:2141avrdude
AT90USB1287 DFU bootloader03eb:2ffbdfu-programmer

The Atmel-ICE needs two rules. avrdude can reach it through libusb or through hidapi, and each uses a different device node (usb and hidraw).

On NixOS, add the rules to your system configuration:

nix
services.udev.extraRules = ''
  # Atmel-ICE (AVR JTAG programmer) - usb node for libusb, hidraw node for hidapi
  SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2141", MODE="660", GROUP="users"
  SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2141", MODE="660", GROUP="users"
  # AT90USB1287 DFU bootloader
  SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", MODE="660", GROUP="users"
'';

On other distributions, put the same three lines in a file such as /etc/udev/rules.d/70-smallymouse2.rules. Make sure your user is in the group the rules name, or change GROUP to one it is in (for example plugdev on Debian and Ubuntu). Then reload the rules with sudo udevadm control --reload-rules.

On either system, unplug and replug the device after adding the rules.

Case

Case/ holds an OpenSCAD case design, built with the BOSL2 library:

FileContents
pcb.scadDimensional model of the assembled board, built from the footprint placements in KiCAD/SmallyMouse2.kicad_pcb, with helpers giving the board-space position of any part by reference (for example pcb_part_box("P1") for the USB connector)
case.scadTwo-part case (base and lid) positioned against the board model

Opening the design

From the repository root, enter the openscad dev shell and open the case:

text
nix develop .#openscad
openscad Case/case.scad

Start OpenSCAD from inside the dev shell: the shell sets OPENSCADPATH to the pinned BOSL2, so include <BOSL2/std.scad> fails if OpenSCAD is started any other way (for example from the desktop menu). openscad Case/pcb.scad opens the board model on its own.

Open the Customizer (Window → Customizer) and set part to choose what is shown:

partShows
assemblyBase, board and a transparent lid together; raise explode to lift the lid
baseThe base alone, laid out for printing
lidThe lid alone, turned over for printing
pcbThe board alone

The case dimensions (wall thickness, clearances, standoff height and so on) are in the same panel.

F5 gives a fast preview; F6 does the full render needed before exporting an STL with F7.

Exporting STLs

Without the GUI, nix build .#case renders case-base.stl, case-lid.stl and case-pcb.stl into ./result/. A single part can be exported from the dev shell with, for example:

text
openscad -o case-lid.stl -D 'part="lid"' Case/case.scad

Component heights that are not in the KiCad data (the USB connector, IDC header and pin headers) use typical datasheet values, set near the top of pcb.scad; check them against the parts fitted before printing.

Author

SmallyMouse2 is written and maintained by Simon Inns.

License (Software)

text
SmallyMouse2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SmallyMouse2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with SmallyMouse2. If not, see <http://www.gnu.org/licenses/>.

License (Hardware)

Both the schematic and the PCB design of SmallyMouse2 (i.e. the KiCAD project and files) are covered by a Creative Commons license; as with the software you are welcome (and encouraged!) to extend, re-spin and otherwise use and modify the design as allowed by the license. However; under the terms of the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license you are required to release your design (or redesign) under the same license. For details of the licensing requirements please see https://creativecommons.org/licenses/by-sa/4.0/

Parts

37
QtyValueFootprintReferences
7100nFSmallyMouse2:C_0805_HandSolderingC3, C5, C6, C7, C8, C9, C10
4Mounting_HoleSmallyMouse2:MountingHole_3.2mm_M3_ISO14580MK1, MK2, MK3, MK4
210KSmallyMouse2:R_0805_HandSolderingR3, R4
222RSmallyMouse2:R_0805_HandSolderingR1, R2
222pFSmallyMouse2:C_0805_HandSolderingC1, C2
2LOGOSmallyMouse2:sm2logoG***, G***
116 MHz CrystalSmallyMouse2:Crystal_SMD_5032-2pin_5.0x3.2mm_HandSolderingY1
11uFSmallyMouse2:C_0805_HandSolderingC4
15VSmallyMouse2:Measurement_Point_Square-SMD-Pad_SmallTP7
1AT90USB1287SmallyMouse2:TQFP-64_14x14mm_Pitch0.8mmIC1
1BBC_UP_02X10SmallyMouse2:IDC_Header_Straight_20pinsJ3
1BootloaderSmallyMouse2:Pin_Header_Straight_1x02_Pitch2.54mmJ5
1Exp HeaderSmallyMouse2:Pin_Header_Straight_1x10_Pitch2.54mmJ1
1GNDSmallyMouse2:Measurement_Point_Square-SMD-Pad_SmallTP4
1RSTSmallyMouse2:Measurement_Point_Square-SMD-Pad_SmallTP1
1ResetSmallyMouse2:Pin_Header_Straight_1x02_Pitch2.54mmJ6
1Slow/FastSmallyMouse2:Pin_Header_Straight_1x02_Pitch2.54mmJ2
1TCKSmallyMouse2:Measurement_Point_Square-SMD-Pad_SmallTP5
1TDISmallyMouse2:Measurement_Point_Square-SMD-Pad_SmallTP3
1TDOSmallyMouse2:Measurement_Point_Square-SMD-Pad_SmallTP6
1TMSSmallyMouse2:Measurement_Point_Square-SMD-Pad_SmallTP2
1USB_ASmallyMouse2:Amphenol_87583-2010BLFP1
1Universal outputSmallyMouse2:Pin_Header_Straight_1x10_Pitch2.54mmJ4

The 36 most common of 37 parts.

Questions

How big is the SmallyMouse2 PCB?

It measures 52.3 × 42.2 mm and has 2 copper layers, 1.6 mm thick.

What parts does the SmallyMouse2 use?

37 parts, built around the AT90USB1287-AU. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the SmallyMouse2 KiCad files?

From the Domesday86/SmallyMouse2 repository on GitHub, at the commit this page was made from: the board is KiCAD/SmallyMouse2.kicad_pcb and its schematic KiCAD/SmallyMouse2.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the SmallyMouse2 design in my own project?

Its repository states no licence, so its author keeps all rights: ask Domesday86 before reusing the design.

Similar boards

  • 2 layers447.8 × 139.3 mmA500KB, the printed circuit board in 3D

    A500KB

    HenrykRichter/A500KB

    Amiga 500 Custom Mechanical Keyboard

    250 parts46
  • 2 layers65.5 × 50.8 mmBeebSCSI, the printed circuit board in 3D

    BeebSCSI

    Domesday86/BeebSCSI

    SCSI-1 Emulator for 8-bit Acorn computers such as the BBC Master and BBC Model B

    60 parts29
  • 2 layers101.6 × 76.1 mmTeensylu, the printed circuit board in 3D

    Teensylu

    syntetyczny/KOS

    Another RepRap controller based on teensylu/printrboard and more.

    141 parts3
  • 2 layers140.3 × 51.9 mmXirtam, the printed circuit board in 3D

    Xirtam

    hanshuebner/xirtam

    MOVED to code.netzhansa.com/hanshuebner/xirtam. This GitHub mirror is archived.

    29 parts
  • 2 layers40 × 34 mmDD HIP9011, the printed circuit board in 3D

    DD HIP9011

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    37 parts1.2k
  • 2 layers53.9 × 23.2 mmAnalog, the printed circuit board in 3D

    Analog

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    37 parts1kGPL-3.0
  • 2 layers52 × 51.8 mmEsp32-homeassistant rf bridge, the printed circuit board in 3D

    Esp32-homeassistant rf bridge

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    37 parts915