geekhack Projects > Making Stuff Together!

TMK ADB to USB keyboard converter

(1/219) > >>


You can buy preassembled TMK ADB-USB converter here


You can use hid_listen to see debug prints.

Debut Outputs
The "R" on debug output means that the conveter didn't get any respnse to a command within specific term(500ms).

This happens when connecting keyboard with converter already powered(hotplug) because keyobard can't response to the converter during its startup. It is not error in this case. But in many other cases the "R" means that there is something wrong on your converter, keyboard or wiring setup.

2012/12/12 Extended keyboard support by blargg
2013/04/08 Fix issue: ADB-USB converter misses keystrokes (NOT FIXED COMPLETELY)
2013/07/22 Changed Pin usage: PD0, NOT PF0 now
2013/10/11 WIP: Fix ADB-USB converter misses keystrokes
2013/11/28 Fix key drop problem finally Thank you, blargg!
2015/04/28 Mouse is supported by mek-apelsin
2015/12/18 Request for help: extended mouse support
2016/06/04 Added LIMITATION section
2016/06/04 Apple Adjustable Keyboard media keys are supported now
2016/09/03 Keymap editor(unimap) is available now
2018/01/19 Fix lag problem on ADB-USB converter
2019/06/23 Added Apple Extended Mouse Protocol and Kensignton Turbo Mouse support
2020-02-13 Updated firmware to fix AEK support
2021-01-24 Change default mapping for 'keypad ='
2021-11-17 Hotplug of keyboard support

You can edit keymap and download firmware with web browser.

TMK ADB-USB converter rev2(ATMega32u2)
TMK ADB-USB converter rev1 and converter with Teensy2.0 or ProMicro(ATMega32u4)

In the Keymap Editor physical key layout is based on Apple Extended Keyboard(AEK) but you can edit keymap of any other ADB keyboards.  For example when you want to edit arrow keys on M0116 you can just change them on the Keymap Editor. The key layout of M0116 is physically different but logically identical to AEK.



Use 'make' to build firmware for TMK ADB-USB converter rev.2.
Use 'make -f Makefile.rev1' to build firmware for TMK ADB-USB converter rev.1, Teensy2.0 or Pro Micro.

You are recommended to use Keymap Editor above, instead build yourself.

You can use PJRC Teensy or other dev board with ATMega32U4/2.

--- Code: ---ADB female socket from the front:
 / o4 3o \      1: DATA
| o2   1o |     2: Power SW
 -  ===  -      3: VCC
  `-___-'       4: GND

--- End code ---

Connect keyboard DATA line to PD0(Pin3 on Pro Micro),  VCC to 5V(VCC on Pro Micro, not RAW) and GND as well. Power SW is not used.

pull-up resistor
You must have an external pull-up resistor(1K Ohm) between VCC(5V) and DATA(PD0) line.

1K ohm is strongly recommended.
You may use 4.7K, 10K or any of 1K-10K Ohm resister, if you don't have 1K in hand. It won't work with longer curled cable or daisy-chained multiple devices.  See this issue.

--- Code: ---Keyboard       Conveter
VCC---------+--|VCC   |
            |  |      |
            R  |      |
            |  |      |
DATA--------+--|PD0   |
               |      |
GND------------|GND   |

R: 1K Ohm resistor

--- End code ---


MoreYou are using Pro Micro?
Confirm it is a 5V version with 16MHz crystal and fill solder on jumper J1. Check this page also.
Pro Micro is not bad choice if you are already familiar and skillful but it is never recommended especially if this is your first time project.
Alternatives are PJRC Teensy2.0 and TMK converter of course!

1K Ohm pull-up resistor You must have an external pull-up resistor(1K Ohm) between VCC(5V) and DATA(PD0) line. 1K ohm is strongly recommended. You may use 4.7K, 10K or any of 1K-10K Ohm resister, if you don't have 1K in hand.

In most cases your wiring is wrong Check your wiring yourself again and again, one hundred times! And try swapping wires at your own risk, note that your wiring are already wrong at this point probably :D It won't break your keyboard unless you are extremely unlucky.

Now you need help? Don't ask help before trying things above!
OK. If you are not sure about your wiring, post pics of your hardware and wriring this really save our time. Don't save your time by omitting this. Shots of controller side and ADB connector/keyboard side would be helpful. Use TMK default prebuilt firmware to test. Also debug outputs from hid_listen command would be useful.

Many people said they are sure their wiring was fine first but it became clear they failed to do that in the end many times in this thread :( Don't omit pull-up resistor with your laziness, you better have it absolutely.
Don't take advantage of generosity of kind and helpful members(yes, including me, of course  ;))! Their time is more precious than your time, use your time to learn and look into your problem first.

- Hotplug of keyboard is not fully supported, you will have to connect keyboard with the converter first, then plug-in USB port.

Hotplug of keyboard and mouse is supported now. 2021-11-17

AEK left/right modifiers discrimination, ISO layout and Adjustable keyboard media keys
On ADB Standard keyboards left and right corresponding modifiers are logically indentical and can not be discriminated one another by the converter. This is ADB keyboard limitation, not converter's.
Apple Extended keyboard can discriminate them except for 'Command' key.

ISO keys
The ISO keys should be correctly supported.

iMate and uKey have problem on some keys reportedly.

Power key
You can remap the key on Keymap Editor or keymap file.

In default configuration Power key works as 'Magic command' trigger key when it is held.

You may need to change thse line in config.h if 'Magic command' feature interferes.

Keypad =
The key is assigned to keycode 'EQL'(usual equal) on default keymap.

Note that keycode 'PEQL'(keypad equal) works on Linux and MacOS but doesn't on Windows. If you are on Windows you will need to use 'EQL'.

Locking CapsLock
Many of old ADB keyboards have mechanically locking switch for Caps lock and TMK supports them.

Or you may want to remove locking pin from the push-lock switch to use it as a normal momentary switch.

Caps lock key of Apple adjustable keyboard is not mechanical locking switch but it emulates locking switch behaviour. You will have problem when using the key as control, for example.

ADB protocol Resource
TMK wiki:

This is code for ADB protocol:

Extended mouse protocol support
- Kensington Turbo Mouse 5(by hasu)

Do you have other multiple button mouse to support? Check this issue on github and ask help in this thread.

- Apple Extended Keyboard M0115
- Apple Extended Keyboard II M3501
- Apple Standard Keyboard M0116, M0118
- Apple Adjustable Keyboard M1242
- Apple Desktop Bus Keyboard(Apple II GS Keyboard) 658-4081

- Apple Desktop Bus Mouse G5431(Taiwan)
- Apple Desktop Bus Mouse II M2706(Taiwan)
- Kensington Turbo Mouse 5 #64210

- Apple Desktop Bus Mouse II(M2706) assembled in Ireland doesn't work due to initialization failure. Meanwhile, M2706 assembled in Taiwan works.

OLD STUFF: MoreAnyway pull-up resistor is a must-have.

Key drop problem[SOLVED]

Finally this was fixed due to blargg's contribution. 2013/11/28

- Apple adjustable keyboard keypad is not confirmed yet. Not sure if it works or not at this time. Confirmed finally!(2018 Dec)

I needed a ADB to USB keyboard converter to test a feel of ADB keyboards on actual usage. After 2days coding and several hours debug, I made this converter based on my keyboard firmware. If you are interested in ADB keyboard converter, try this.

Hah, great.

Strange nobody replied. I thought the Griffin iMate was hard to get these days. The mod forum should have a better place in the forum overview, IMO.

Also, the iMate had issues with intl. 'boards.

So, Colemak converter for ps/2 'boards next? :-)

Neat. :)

I would like to add ADB support to my adapter in the future, but I have lots of other tasks to complete first! One of them is implementing a key remapping UI ;)

And I recently bought a couple of the Belkin ADB adapters, which work ok, at least on US layout. But it seems they are not generally available either :/

Superb! How does it handle latching Caps Lock, though?

Great job!  Love seeing this type of stuff.  How many days have you lost with your head down programming that teensy?  ;)

I may just have to pick up one of these and start playing as well.


[0] Message Index

[#] Next page

Go to full version