USB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico
![]() |
![]() |
![]() |
![]() |
---|
Keyboard only (incl. PC-XT) variant: https://github.com/No0ne/ps2pico
PicoMiteVGA variant: https://github.com/No0ne/hid2cdc
PiKVM integration:
- Download
ps2x2pico.uf2
from https://github.com/No0ne/ps2x2pico/releases - Copy
ps2x2pico.uf2
to your Pi Pico by pressing BOOTSEL before pluggging in. - 3.3V/5V conversion is done using a bi-directional level shifter: https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/
- Afterwards connect a USB keyboard and/or mouse using an OTG-adapter and optional USB hub.
- Also works with wireless keyboards and mice with a dedicated USB receiver.
Check the power consumption of your keyboard/mouse/hub first before plugging in!
You can hook up a USB serial adapter to GPIO0 for additional debugging output. The serial settings are 115200 baud, 8 data bits and no parity. You can also use another Pico running the pico-uart-bridge for this.
(update to the latest TinyUSB release first)
export PICO_SDK_PATH=/path/to/pico-sdk
cd $PICO_SDK_PATH/lib/tinyusb
git checkout 0.16.0
cd /path/to/ps2x2pico
mkdir build
cd build
cmake ..
make
- https://github.com/No0ne/ps2pico
- https://wiki.osdev.org/PS/2_Keyboard
- https://wiki.osdev.org/PS/2_Mouse
- https://wiki.osdev.org/Mouse_Input
- https://wiki.osdev.org/%228042%22_PS/2_Controller
- http://www-ug.eecg.toronto.edu/msl/nios_devices/datasheets/PS2%20Keyboard%20Protocol.htm
- http://www-ug.eecg.utoronto.ca/desl/nios_devices_SoC/datasheets/PS2%20Mouse%20Protocol.htm
- Archive.org links for the dead links in the pages above