Arduino Code for PS2 Keyboard Conversion?

Started by blur2040, June 16, 2017, 11:28:27 PM

Previous topic - Next topic

blur2040

...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.

blur2040

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. 

costa

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.

blur2040

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

sjamaan


blur2040

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.