Simple Arduino based PS/2 to XT keyboard converter

Simple Arduino based PS/2 to XT keyboard converter for old Amstrad PC computer.
Source: (Work in Progress)


12 thoughts on “Simple Arduino based PS/2 to XT keyboard converter

  1. Hello,
    this is very interesting! I have tried building it but I couldn’t get it to work.. I have connected ps2 clock to arduino pin 3, ps2 data to arduino pin4, xt clock to pin2 and xt data to pin5, programmed the board with your script, connected +5v and ground. I have tried on ibm xt 5160… the system boots normally (like when a keyboard is connectd) but the I cannot write anything..Am I missing something?

    • Thank you for your comment.
      Which Arduino board you are using ?
      Because I’m using Leonardo board I used digital pin 3 for PS/2 clock (0 interrupt) (

      Try to change code to this:

      #define ps_clk 2 /* must be interrupt pin (0 interrupt) */
      #define ps_data 4
      #define xt_clk 3
      #define xt_data 5

      And change physical connections. Now ps_clk is pin 2 and xt_clk is pin 3.
      Keep informed if it worked.

  2. the keyboard work very well !!! but I can`t use it in my machine because at the begining appears keyboard error. My machine haven’t got any way to modify the setup settings. Is a xt based machine..
    have you got the code to resolve this problem?

    • I saw zinamo’s writeup on and tried this with an Arduino Uno, making the pin adjustments you mention. It works, but most of the keys show up doubled (‘dir’ shows up as ‘ddiirr’).

      Zinamo mentioned changing the value of delay(10) in the loop() routine. I’ve tried bumping it to 20, 50, 250, and finally 500 without seeing a difference. Should I try larger values yet or something else?

      BTW – who’s version of “Ticket to Ride” is playing in the video?

  3. Yes, I changed the delay() in loop() as you show in the first example. None of the values in my comment seem to make any difference. Today I defined DEBUG with a PS/2 keyboard attached and watched the serial monitor. I did not see any double output in the monitor. But, when I unplugged the Arduino and attached the board to my old IBM PC/XT, most of the characters typed show up doubled on the XT screen. So, “dir /w” shows up as “ddiirr //ww”. Very odd.

    Thanks for the name of the artist – I have some of Ron’s recordings and knew the style, just couldn’t remember the name.

    • Debug is just for sure you get right data from PS/2 keyboard.

      Try to remove delay() from main loop.
      And try to remove delay() from end of _write() function.
      digitalWrite(xt_clk, HIGH) ;
      digitalWrite(xt_data, LOW) ;
      delay(1) ;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s