Author Topic: Arduino Code for PS2 Keyboard Conversion?  (Read 348 times)

Offline blur2040

  • SmallMember
  • **
  • Posts: 7
Arduino Code for PS2 Keyboard Conversion?
« on: June 16, 2017, 11:28:27 pm »
...or I need to run Switch.x and don't have a KB to use.

I have seen blurbs around about people using Arduinos to convert PS2 KB to x68000.  Anybody have code for such a thing that they'd like to share?

I've attempted to code one myself, but I'm not much of a programmer.  I found a library to decode PS2 on the Arduino, it works, and it seems that I can translate PS2 keycodes to x68k, but my output on the x68k is garbage.  Usually a bunch of "," or something like that.  Not very useful.

$100 bucks for a prebuilt converter is kinda rough...and I know that there is code out there for PICs, but, well, I like the Arduino.  So easy to use and I don't feel like buying a PIC programmer and building a board for the converter.

Any direction anyone has would be nice.  Should I ever get what I'm tinkering with to work, I'll share it.

Offline blur2040

  • SmallMember
  • **
  • Posts: 7
Re: Arduino Code for PS2 Keyboard Conversion?
« Reply #1 on: June 23, 2017, 11:13:41 pm »
Well, in case anybody is watching, I've got something partially working.  Still quite glitchy and with code that is certainly hideous, but I can push keys on the PS2 keyboard and it usually comes out with the key I push.  Hooray.   Once its a bit more functional, I'll put it out there for criticism/use. 

I know that this road is well trodden--there are the other PS2 to x68k (and vice versa, too) keyboard projects available (which I have used as a bit of a learning tool).  However Arduino has all the "glue" built in: pin headers, lots of input/outputs, programming facilities via USB, etc.  Not to mention an easy to setup development environment that supports all sorts of Arudino variations.  Also, my wife gave me one as a gift, and I needed to find a use for it. 

My hope is that my final result is something that can be built (or tested with jumper wires, at least) stupidly easily for those not technically inclined at all.  My setup is an Arduino, USB cable and some jumper wires (in addition to PS2 kb and x68k computer).  Thus, that goal seems to be within reach. 

Offline costa

  • MassiveMember
  • ****
  • Posts: 156
Re: Arduino Code for PS2 Keyboard Conversion?
« Reply #2 on: July 04, 2017, 12:58:30 pm »
Are you doing in C ? If so, interested.
I could port to Raspberry Pi, as Arduino is not my thing. Also same arguments from you on your first post... so this would be for my personal use only -unless someone else ask for the resulting code.

Offline blur2040

  • SmallMember
  • **
  • Posts: 7
Re: Arduino Code for PS2 Keyboard Conversion?
« Reply #3 on: July 05, 2017, 05:15:29 am »
I'm using the Arduino IDE, which is C...but a little different, apparently.

Remember the part where I'm unskilled though?  I've used a pre-existing Arduino PS2 kb decoder library and translated the resulting keystrokes to x68k keycodes.  The work I've done is pretty damned simple.

I'll try to find some time to clean up what I have and post.  Lots of things not working though.  Cap. Letters.  F keys... But I was able to run switch.x

Offline sjamaan

  • SmallMember
  • **
  • Posts: 2
Re: Arduino Code for PS2 Keyboard Conversion?
« Reply #4 on: August 04, 2017, 12:08:22 pm »
Hey, do you still have the code?

Offline blur2040

  • SmallMember
  • **
  • Posts: 7
Re: Arduino Code for PS2 Keyboard Conversion?
« Reply #5 on: September 03, 2017, 02:22:39 am »
Sorry, took awhile to get around to this.  Its ugly as all hell, probably doesn't work well...doesn't do uppercase letters...but it allowed me to do what I neede d to do...configure ram for my x68k pro with a Ps2 kb.

The inputs and outputs should be self explanatory per the comments.

Anybody better, feel free to make it better.