Skip to content

USB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico

License

Notifications You must be signed in to change notification settings

No0ne/ps2x2pico

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ps2x2pico

USB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico

hw1 hw2 hw3 hw4

Keyboard only (incl. PC-XT) variant: https://github.com/No0ne/ps2pico

PicoMiteVGA variant: https://github.com/No0ne/hid2cdc

PiKVM integration:

Usage

                   _________________
                  |                 |
Pico GPIO11 ______| LV1         HV1 |______ PS/2 keyboard data
Pico GPIO12 ______| LV2         HV2 |______ PS/2 keyboard clock
Pico GPIO13 ______| LV          HV  |______ PS/2 5V + Pico VBUS
Pico    GND ______| GND         GND |______ PS/2 GND
Pico GPIO14 ______| LV3         HV3 |______ PS/2 mouse data
Pico GPIO15 ______| LV4         HV4 |______ PS/2 mouse clock
                  |_________________|

⚠️ Please note that some older motherboards have non-resettable fuses rated under 300mA.

Check the power consumtion of your keyboard/mouse/hub first before plugging in!

Pinout diagram

  Plug (device)        Socket (motherboard)
       _ _                     _ _
    =       =               =       =
  =  5  #  6  =           =  6  #  5  =
 =  3   #   4  =         =  4   #   3  =
 =             =         =             =
  =   1   2   =           =   2   1   =
    =       =               =       =
       ~ ~                     ~ ~
  1. Data
  2. unsed (mouse data on dualport)
  3. GND
  4. +5V
  5. Clock
  6. unused (mouse clock on dualport)

Troubleshooting

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.

⚠️ If you have a YD-RP2040 you need to bridge all three pads of the diode near the USB-C port as seen here: #33 (comment) Otherwise no power would be sent to the devices connected to the USB-C port.

Build

(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

Resources