wiki:ak2tousb

Version 2 (modified by pulkomandy, 14 years ago) ( diff )

--

This small board allows you to plug an amiga keyboard (2000 or 4000 models) to a modern computer with usb ports. The hardware is identical to ps2tousb. Only the firmware is different. As both devices use an usb bootloader, it is easy to switch from one to the other as needed.

Hardware

Very simple hardware :

  • atmega8 chip clocked at 16MHz (likely 12MHz would also work)
  • usb port done using v-usb and using their reference schematics
  • Amiga keyboard handling done using my own library, bit-banging
  • A jumper for firmware upgrade
  • A del (because there is no num lock del on the amiga keyboard)

Single side PCB with some SMD parts to make it smaller

Bootloader

I used the USBaspLoader, which takes some space (1024 bytes) on the device but is easy to work with and appropriate for this kind of devices. There is a jumper on the board you have to fit to enable upgrade mode. Else it will start in regular mode and act as a keyboard. This allows easy development (no need for an ISP connector, nor an usbasp once you have bootloaded the atmega).

Software

The software is quite simple. The usb part was heavily based on other v-usb projects, mainly the Dulcimer, a replacement board for IBM Model M keyboards.

The software does the following :

  • Register itself as an HID device
  • Initialize the keyboard
  • Wait for input from the keyboard
  • Translate the amiga keycode to an HID keycode
  • Maintain an HID report keeping track of the pressed keys (6 of them at a time)
  • Send the HID report to the computer

There are some special quirks :

  • The caps-lock key is handled by the keyboard, which means it send a "key pressed" event when it is enabled and a "key released" even when it is disabled. However, the PC wants to get "pressed then released" at both times. So we have to cheat and build up events for this key.
  • Some keys on the amiga keyboard doesn't exist on the pc. We remap Help to F12, and \| (azerty) on F11. There are others, more suitable keycodes for them in HID (there is a help keycode for example) but Windows doesn't handle them.
Note: See TracWiki for help on using the wiki.