2026 Geoff Winkless (github@geoff.dj)
Based on the work by:
- 2023 Darren Jones (nz.darren.jones@gmail.com)
- Simon Inns https://github.com/simoninns/SmallyMouse2
- sekigon-gonnoc https://github.com/sekigon-gonnoc/Pico-PIO-USB
This is the software component of my Sam Coupé version of Darren's RP2040 based USB to Quadrature mouse adaptor.
Hardware will be available from PCBWay once I've finished designing it, or you can build your own version with a Pico, a DIN8 (270°) connector, two 74HC03 open-drain NAND gates, a couple of 100nF capacitors, a 300Ohm pullup resistor and a USB OTG adapter.
The PIO branch uses the RP2040 PIO mechanism to handle the output to the Coupé; at the moment though it's fallen behind main (no wireless mouse support, no DB9 cursor joystick, no flash support) so for now stick with the main branch.
The Sam Coupé uses a unique(?) 5-pin bus mouse connection with deltas transmitted on-demand.
The existing interfaces for the Sam require either a PS2 (or PS2-over-USB) mouse (which are becoming less and less easily-available) or a USB-HID mouse with something like the rp2040-mouse (or Smally mouse) with the SamCo mouse interface to convert the Quadrature output into Sam-specific signals. That's expensive and clunky, and the SamCo interfaces are rare.
To build this software you will need:
- a working TinyUSB SDK (https://github.com/hathach/tinyusb)
- CMake Tool Chain
To build the software clone this repository and then run the following
PICO_TINYUSB_PATH=/path/to/tinyusb BOARD=pio_sdk cmake ..
make
Once the build completes you will see the following:
Memory region Used Size Region Size %age Used
FLASH: 46608 B 2 MB 2.22%
RAM: 53668 B 256 KB 20.47%
SCRATCH_X: 2 KB 4 KB 50.00%
SCRATCH_Y: 2 KB 4 KB 50.00%
Press and hold the Pico USB-boot button, connect to your computer using the Pico USB, then copy rp2040_mouse.uf2 built above to the USB drive that the board will expose.