Hecate Firmware
Hecate is the USB-to-PS/2 keyboard and mouse converter firmware for the RP2040. It takes modern USB keyboards and mice and presents them to a vintage host as PS/2 devices, so you can use current peripherals with computers that only speak PS/2. It is the firmware that runs on the Hecate bridge board, and the same firmware that powers FRANK's on-board RP2040-Zero USB-to-PS/2 helper.
Named after Hecate, the Greek goddess of crossroads and liminal spaces β the firmware stands at the intersection of modern USB and legacy PS/2.
Features
USB host
- Triple USB ports β native Type-C plus dual PIO-USB ports
- Hybrid USB mode β use Type-C and PIO-USB simultaneously
- USB hub support β connect multiple devices via a hub on any port
- HID report parsing β boot protocol and full HID report descriptors
- NKRO β N-key rollover for gaming keyboards
PS/2 keyboard emulation
- Full Scancode Set 2, including all standard keys
- Extended keys (navigation, multimedia, special) with E0 prefix
- Key repeat (typematic) with configurable rate and delay
- LED feedback β Caps / Num / Scroll Lock synced with the host
- Host commands β Reset, Echo, Identify, Set LEDs, Set Typematic Rate
- Proper Pause/Break and Print Screen sequences
PS/2 mouse emulation
- Standard 3-button mouse
- IntelliMouse scroll wheel (auto-detected)
- IntelliMouse Explorer 5-button (auto-detected)
- Stream and Remote modes with automatic detection
- Host commands β Reset, Get ID, Enable/Disable, Read Data, Status
Status LED
- Connection indicator β on when a keyboard or mouse is connected
- Activity indicator β blinks on keypress or mouse click
- RP2040-Zero RGB β green when connected, blue flash on activity
- Pico on-board LED β on when connected, blinks on activity
Pin configuration
| Option | Description |
|---|---|
| GPIO 0 / 1 | UART TX / RX β debug serial (115200 baud) |
| GPIO 2 / 3 | PIO-USB Port 0 D+ / Dβ |
| GPIO 4 / 5 | PIO-USB Port 1 D+ / Dβ |
| GPIO 11 / 12 | PS/2 keyboard DATA / CLK |
| GPIO 14 / 15 | PS/2 mouse DATA / CLK |
| GPIO 16 | WS2812 RGB LED (RP2040-Zero) |
| Type-C | Native USB host port |
Supported boards
- Hecate board β the dedicated USB-to-PS/2 bridge PCB
- Raspberry Pi Pico β on-board LED on GPIO 25 (default build)
- Waveshare RP2040-Zero β WS2812 RGB LED on GPIO 16 (build with
-DUSE_WS2812=1)
Building
Requires the Pico SDK (with PICO_SDK_PATH set) and the ARM GCC toolchain.
mkdir build
cd build
cmake ..
make -j4
The firmware is generated as build/hecate.uf2. For the RP2040-Zero RGB LED, configure with -DUSE_WS2812=1.
Flashing
- Hold the BOOTSEL button on the board
- Connect USB while holding BOOTSEL
- Release BOOTSEL β the board appears as a USB drive
- Copy
hecate.uf2to the drive (or run the includedflash.sh)
Source and license
Hecate firmware is open source (MIT). Full source, build scripts and releases are at github.com/rh1tech/hecate. It builds on ps2x2pico, pico-hid-host, Pico-PIO-USB and TinyUSB.