{"id":15012020,"url":"https://github.com/no0ne/ps2x2pico","last_synced_at":"2025-05-16T11:05:10.838Z","repository":{"id":181617902,"uuid":"528095822","full_name":"No0ne/ps2x2pico","owner":"No0ne","description":"USB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico","archived":false,"fork":false,"pushed_at":"2025-03-04T07:34:29.000Z","size":22743,"stargazers_count":295,"open_issues_count":18,"forks_count":44,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-05-16T11:05:00.131Z","etag":null,"topics":["hid","keyboard","mouse","pikvm","pio","ps2","ps2-keyboard","ps2-mouse","raspberry-pi-pico","rp2040","usb-keyboard","usb-mouse"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/No0ne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-23T17:27:04.000Z","updated_at":"2025-05-09T13:03:26.000Z","dependencies_parsed_at":"2024-03-05T11:45:26.558Z","dependency_job_id":"4f5ea756-4a2b-40dd-8bfe-7ff823733924","html_url":"https://github.com/No0ne/ps2x2pico","commit_stats":{"total_commits":84,"total_committers":7,"mean_commits":12.0,"dds":0.1428571428571429,"last_synced_commit":"f661daca5008d9cd7f7c2d683cfb6eb35f914751"},"previous_names":["no0ne/ps2x2pico"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/No0ne%2Fps2x2pico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/No0ne%2Fps2x2pico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/No0ne%2Fps2x2pico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/No0ne%2Fps2x2pico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/No0ne","download_url":"https://codeload.github.com/No0ne/ps2x2pico/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hid","keyboard","mouse","pikvm","pio","ps2","ps2-keyboard","ps2-mouse","raspberry-pi-pico","rp2040","usb-keyboard","usb-mouse"],"created_at":"2024-09-24T19:42:00.760Z","updated_at":"2025-05-16T11:05:05.815Z","avatar_url":"https://github.com/No0ne.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ps2x2pico\nUSB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico\n\n\n|![hw1](https://raw.githubusercontent.com/No0ne/ps2x2pico/main/doc/hw1.jpg) |![hw2](https://raw.githubusercontent.com/No0ne/ps2x2pico/main/doc/hw2.jpg) |![hw3](https://raw.githubusercontent.com/No0ne/ps2x2pico/main/doc/hw3.jpg) |![hw4](https://raw.githubusercontent.com/No0ne/ps2x2pico/main/doc/hw4.jpg) |\n|-|-|-|-|\n\nKeyboard only (incl. PC-XT) variant: https://github.com/No0ne/ps2pico  \nThere is also an alternative ps2pico firmware for the PC-XT and ps2x2pico hardware: [ps2pico-XT-alt.uf2](https://github.com/No0ne/ps2pico/releases/tag/2.1)\n\nAdditional excellent documentation by Ray: https://minuszerodegrees.net/keyboard/ps2x2pico.htm\n\n[PicoMiteVGA](https://geoffg.net/picomitevga.html) variant: https://github.com/No0ne/hid2cdc\n\n[PiKVM](https://pikvm.org) integration:\n* https://docs.pikvm.org/pico_hid/\n* https://docs.pikvm.org/pico_hid_bridge/\n\n[ITX-Llama](https://www.vogons.org/viewtopic.php?t=93480) integration:\nhttps://github.com/eivindbohler/itxllama\n\n# Usage\n* Download `ps2x2pico.uf2` from https://github.com/No0ne/ps2x2pico/releases\n* Copy `ps2x2pico.uf2` to your Pi Pico by pressing BOOTSEL before pluggging in.\n* 3.3V/5V conversion is done using a bi-directional level shifter: https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/\n* Afterwards connect a USB keyboard and/or mouse using an OTG-adapter and optional USB hub.\n* Also works with wireless keyboards and mice with a dedicated USB receiver.\n\n\n⚠️ Please note that some older motherboards have non-resettable fuses rated\nunder 300mA.\n\n**Check the power consumption of your keyboard/mouse/hub first before plugging\nin!**\n\n![Level Shifter wiring diagram](doc/Level_shifter_diagram.svg)\n\n![PS/2 Pinout diagram](doc/MiniDIN-6_Connector_Pinout_both_sides_CC0.svg)\n\n⚠️ Do not assume wire colors will match cables depicted in photos. Double-check\nyour pinout with a multimeter.\n\n# PS/2 passthru\nIf you also want to use a real PS/2 keyboard and mouse together with your USB devices you can mount another level shifter on top of the pico. These two ports work as PS/2 inputs and are passed through to the PS/2 output ports.\n* GPIO3 LV1 - keyboard data\n* GPIO4 LV2 - keyboard clock\n* GPIO5 LV - 3.3V pull-up\n* GND - GND\n* GPIO6 LV3 - mouse data\n* GPIO7 LV4 - mouse clock\n\nDon't forget to wire HV to 5V and your PS/2 sockets to power the connected PS/2 devices.\n\nPS/2 passthru is especially useful with the PiKVM [Pico HID](https://docs.pikvm.org/pico_hid/) or [Pico HID Bridge](https://docs.pikvm.org/pico_hid_bridge/) as you can continue using your existing peripherals.  \n⚠️ Please note that the [UF2 from PiKVM](https://github.com/pikvm/kvmd/releases) uses different GPIOs due to jumper pins:\n* GPIO26 LV1 - keyboard data\n* GPIO27 LV2 - keyboard clock\n* GPIO16 LV3 - mouse data\n* GPIO17 LV4 - mouse clock\n\nDon't forget to wire LV to 3.3V and GND to GND separately as the level shifter does not fit directly on top of the pico. \n\n# Troubleshooting\nYou 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](https://github.com/Noltari/pico-uart-bridge) for this.\n\n⚠️ If you have a **YD-RP2040** (see silkscreen on back of board if unsure) and\nare not using a USB hub with its own power supply, you need to bridge two pads\nof the diode pair near the USB-C port as seen here:\n\n![Fix for YD-RP2040](doc/YD-RP2040_fix.svg)\n\n# Build\n\nInstall needed libraries and tools:\n\n```sh\nsudo apt install cmake gcc-arm-none-eabi build-essential pkg-config libusb-1.0-0-dev libusb-1.0-0\n```\n\nGet the Raspberry Pi Pico SDK version 1.5.1:\n\n```sh\ngit clone https://github.com/raspberrypi/pico-sdk\nexport PICO_SDK_PATH=/path/to/pico-sdk\ncd $PICO_SDK_PATH\ngit checkout 1.5.1\ngit submodule update --init\n```\n\nUpdate to the latest TinyUSB release 0.17.0:\n```sh\ncd $PICO_SDK_PATH/lib/tinyusb\ngit checkout 0.17.0\n```\n\nGenerate the UF2 file:\n```sh\ncd /path/to/ps2x2pico\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n# Resources\n* https://github.com/No0ne/ps2pico\n* https://wiki.osdev.org/PS/2_Keyboard\n* https://wiki.osdev.org/PS/2_Mouse\n* https://wiki.osdev.org/Mouse_Input\n* https://wiki.osdev.org/%228042%22_PS/2_Controller\n* http://www-ug.eecg.toronto.edu/msl/nios_devices/datasheets/PS2%20Keyboard%20Protocol.htm\n* http://www-ug.eecg.utoronto.ca/desl/nios_devices_SoC/datasheets/PS2%20Mouse%20Protocol.htm\n* Archive.org links for the dead links in the pages above\n  * [Main page PS/2 Keyboard Protocol](https://web.archive.org/web/20160414014033if_/http://www.computer-engineering.org/ps2keyboard/)\n    * [Scan code set 1](https://web.archive.org/web/20160410193756if_/http://www.computer-engineering.org/ps2keyboard/scancodes1.html)\n    * [Scan code set 2](https://web.archive.org/web/20160414030011if_/http://www.computer-engineering.org/ps2keyboard/scancodes2.html)\n    * [Scan code set 3](https://web.archive.org/web/20160410184920if_/http://www.computer-engineering.org/ps2keyboard/scancodes3.html)\n  * [Main page PS/2 Mouse Protocol](https://web.archive.org/web/20160414013310if_/http://www.computer-engineering.org/ps2mouse/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fno0ne%2Fps2x2pico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fno0ne%2Fps2x2pico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fno0ne%2Fps2x2pico/lists"}