Amiga 500 - PS/2 keyboard controller (for external keyboard)

The board plugs into the keyboard pins on the amiga mainboard, and has a second connector for the internal keyboard. The AVR atmega168 microcontroller interfaces with an external PS/2 keyboard, and translates the scancodes it receives, to the signals expected by the amiga. A DPDT switch selects between the internal and external keyboard.

This picture was taken while debugging the firmware. The breadboard resting onto of the floppy drive just connects an ft232 serial-USB chip to the UART of the microcontroller, which is very useful for emitting debug messages. The black box on the right side is the AVRtinyISP programmer, and my oscilloscope probes are connected to the amiga keyboard clock and data lines.

Here's a picture of my oscilloscope showing a key press of the internal keyboard, trying to figure out the signalling I have to emulate.

Not the best looking square hole I admit. But fuck it... does the job.

Now I can put the amiga out of the way, and use it with my regular keyboard through a KVM switch, having to maneuver it around, together with the many cables hanging from the back.

I made a PS/2 keyboard controller and converter, to connect an external keyboard to my Amiga 500.
The main reason I wanted to use an external keyboard with my Amiga, is that I want to be able to use it without having to move everything out of the way to clear space for it in front of my monitor. The amiga is quite bulky, and the many cables dangling from the back and sides of it, make it very annoying to move around. This way I can put it in a corner, and connect it to a KVM switch, or at the very least bring just one keyboard with a single cable in front of me every time I want to do something with the amiga.
Also, the amiga keyboard is absolutely horrible, and now I can use my Model-M keyboard with it.
Source code and schematics available on github: https://github.com/jtsiomb/a500kbd