DIY PS/2 - ADB Adapter Success!

ToneMalone

Active member
I hacked together something abominable today and it worked!

I followed this excellent guide and used an Arduino Uno instead.

Some things weren't exactly clear for the layman like me, so I'd like to share the hurdles i encountered.

- This code is for Arduino's based off the ATmega328p, I initially tried this with my Nano Every but I don't have the experience to rewrite the code to make it compile.

- the pinouts in this guide are correct but the numbers are wrong on the screenshot.
20231103_162829.jpg
I drew up this cheat sheet to help with assembly. (I swapped the ground to the one by pin 13 after some glitches, this smoothed a lot of syncing issues for me)

-Not all PS/2 devices work! I had a dud mouse, and a dud keyboard, they work on other systems but not here. I had one mouse work briefly, then fail! This is a hacky setup (could be my wiring lol!) It took a while to get things stable.

-Lastly I experienced a very glitchy mouse, clicking all over the place on its own and acting bewitched, in the tutorial he mentions spamming keys, this actually syncs things up rather quickly and fixed the mouse and keyboard!

I own a Wombat from BMOW and it works great, all the time. Offers more features like scroll and right click. There are also open source adapters available with PS/2 or USB input. This was fun to put together and a good learning project!

As always be careful when hooking up strange devices to your Macintosh.
 

ToneMalone

Active member
Seems that youtube automatically uploads videos that aren't long or widescreen as 'shorts' I know the quality of my video is already not good but this makes it really hard to see what's going on here. Sorry.
I just learned this is by-passable by typing in "watch?v=" in place of "shorts"
fullscreen video
 

Snial

Well-known member
I hacked together something abominable today and it worked!

I followed this excellent guide and used an Arduino Uno instead.

-Not all PS/2 devices work! I had a dud mouse, and a dud keyboard, they work on other systems but not here. I had one mouse work briefly, then fail! This is a hacky setup (could be my wiring lol!) It took a while to get things stable.

-Lastly I experienced a very glitchy mouse, clicking all over the place on its own and acting bewitched, in the tutorial he mentions spamming keys, this actually syncs things up rather quickly and fixed the mouse and keyboard!
I've had a bit of a look at the Arduino sketch here: http://synack.net/svn/adbduino/adbduino.ino?revision=141&view=markup

I can see what it's trying to do, but it's bound not to be very reliable, because it can't really handle the PS/2 protocol and ADB protocol at the same time. Instead it tries to handle individual commands from one or the other, assuming that the other bus isn't active (though it tries to stop the PS/2 clock). Also, I don't think it handles ADB address reassignment properly. It really needs to handle both of the protocols using interrupts.

I once wrote a PS/2 keyboard to FIGnition FIGgyPad converter called FIGkeys that ran on an AtTiny24. It's correct, because it's interrupt-driven. I think it could be adapted to handle ADB to PS/2 for a keyboard and mouse reliably. This AtTiny24 version didn't need a crystal oscillator and I think that the ADB one wouldn't either, because the RC oscillator is accurate enough for both. I stuck the translation tables in EEPROM rather than in the main code which saved a bit of space and meant I could create a mechanism for reprogramming the keyboard.

Thinking about the pinouts, we need: 1 I/O pin for ADB (if we ignore power, which is OK). We need 2 pins each for a PS/2 mouse + PS/2 keyboard (clock and data). That's 5 pins in total + GND and VCC + LED (we always need a LED). So, it could work on an AtTiny24, 25, 44 or 45.
 
Top