You can buy preassembled TMK ADB-USB converter hereRESOURCESADB protocol:
https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-BusSource code:
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usbKEYMAP EDITORYou 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.BUILD FIRMWAREhttps://github.com/tmk/tmk_keyboard/wiki#build-firmwareSOURCE CODE:https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usbUse '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.
BUILD CONVERTER YOURSELFYou can use PJRC Teensy or other dev board with ATMega32U4/2.
ADB female socket from the front:
,--_--.
/ o4 3o \ 1: DATA
| o2 1o | 2: PSW(Power SW)
- === - 3: VCC
`-___-' 4: GND
Connect keyboard
DATA line to
PD0(
Pin3 on Pro Micro),
VCC to 5V(
VCC on Pro Micro, not RAW) and
GND as well.
PSW(Power SW) is not used in current firmware. You don't have to connect it. See
this.
pull-up resistorYou must have an external pull-up resistor(1K Ohm) between VCC(5V) and DATA(PD0) line.Check this wiki page:
https://github.com/tmk/tmk_keyboard/wiki/FAQ#pull-up-resistor1k ohm is strongly recommended. You can use 1/10W or higher power rating of resistor. See
this for resistor power rating.
Keyboard Conveter
,------.
VCC---------+--|VCC |
| | |
R | |
| | |
DATA--------+--|PD0 |
| |
GND------------|GND |
`------'
R: 1K Ohm resistor
- You may use 4.7k or less resister if you don't have 1k in hand. But it may not work with longer curled cable or daisy-chained multiple devices.
- See this issue. 4.7k doesn't work in some cases like lenghty cable, curled cable or multipule devices. They required 1k.
https://github.com/tmk/tmk_keyboard/issues/683- 10k ohm didn't work for Turbo Mouse 5 with vintage coiled ADB cable, which is expected to have quite a bit capacitance. 4.7k did work. 2022-03-23
- Kensington Thinking mouse and NeXT mouser didn't work with 10k while they works with 4.7k.
https://geekhack.org/index.php?topic=14290.msg3117619#msg3117619- Griffin iMate and Apple IIGS has even 470 ohm pull-up resistor.
https://geekhack.org/index.php?topic=14290.msg3117720#msg3117720DEBUGYou can use
hid_listen to see debug prints.
Debut OutputsRRRThe "R" on debug output means that the conveter didn't get any respnse to a command within specific term(500ms).
https://github.com/tmk/tmk_keyboard/blob/66e97371bacb1ad55096f0407b47f0a73fadc6c7/tmk_core/protocol/adb.c#L160-L164This 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.
Sigrok ADB decoderCheap $10-20 Logic Analyzer that is compatible with
sigrok works well for this job.
Get one and try. 1MHz sample rate is actually good enough for ADB protocol.
You can use this deocoder with sigrok PulseView to see ADB commands and data..
https://github.com/tmk/tmk_keyboard/wiki/Signal-Capture-for-debug#sigrokTROUBLE WITH YOUR DIY CONVERTER?You are using Pro Micro?Confirm it is a 5V version with 16MHz crystal. Make solder bridge on J1 and use VCC for 5V power, not RAW. MUST check this page also.
I'm never willing to recommend you to use Pro Micro unless you are already familiar to it and have skill to solve problems yourself. Pro Micro is bad choice especially if this is your first time project. Alternatives are PJRC Teensy2.0 and TMK converter, of course!
Please don't ask help for problem specific to Pro Micro here.
Don't ask help before placing pull-up resistor and trying solder on J1!
More
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
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.
[rant]
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.
[/rant]
UPDATE2012/12/12 Extended keyboard support by
blargg2013/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 keystrokes2013/11/28
Fix key drop problem finally Thank you,
blargg!
2015/04/28 Mouse is supported by
mek-apelsin2015/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 converter2019/06/23 Added Apple Extended Mouse Protocol and Kensignton Turbo Mouse support2020-02-13 Updated firmware to fix AEK support
2021-01-24 Change default mapping for 'keypad ='
2021-11-17 Hotplug of keyboard support
2022-04-12 Various pointing devices support
2022-05-05 JIS keyboard support
2022-05-21 sigrok ADB decoder
2022-05-30 Implement 'Address Resolution '
2023-03-12 Fix Remote Wakeup
2023-10-26 Add support for
Microspeed MacTrac 2.0(old firmware)
TESTED DEVICESCheck also:
https://github.com/tmk/tmk_keyboard/issues/736Keyboard:
- 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
- NeXT ADB Keyboard
ANSI- NeXT ADB Keyboard
GermanMouse:
- Apple Desktop Bus Mouse G5431 Taiwan(1)
- Apple Desktop Bus Mouse II M2706 Taiwan(1)
- Apple Desktop Bus Mouse II M2706 Ireland(?) - See ISSUE below.
- Apple Desktop Bus Mouse II M2706
Malaysia- Apple Classic Mouse protocol (1, 2)
- Apple Extended Mouse protocol (4)
- Kensington Turbo Mouse 5 #64210 and Thinking Mouse (0x32)
- Macally 2-button Mouse (0x42)
- Logitech MouseMan/TrackMan Proprietary protocol (0x4C*)
- Logitech MouseMan/TrackMan Extended protocol (0x4D*)
- NeXT ADB Mouse(1) - See ISSUE below.
TEST REQUIRED- Micrspeed MacTrac (0x2F, 0x5F) - Not confirmed
- Contour Design Countour Mouse (0x66) - Not confirmed
- Mouse Systems A3 Mouse/Trackball (0x03) - Not confirmed
- CH Products Tracball Pro/DT225 (0x42) - Not confirmed
https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#mouse LIMITATION-
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-17AEK left/right modifiers discrimination, ISO layout and Adjustable keyboard media keysOn ADB Standard keyboards(M0116) 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(M0115/M3501) can discriminate them except for 'Command' key.
ISO keysThe ISO keys should be correctly supported.
iMate and uKey have problem on some keys reportedly.
https://geekhack.org/index.php?topic=4185.msg61270#msg61270https://github.com/randyrants/sharpkeys/issues/225#issue-537872871Power keyIn default configuration Power key works as 'Magic command' trigger key when it is held.
https://github.com/tmk/tmk_keyboard#magic-commandsYou can remap the Power key somehow but there is a limitation.
https://geekhack.org/index.php?topic=14290.msg3100399#msg3100399You may need to change thse line in config.h if 'Magic command' feature interferes.
https://github.com/tmk/tmk_keyboard/blob/7b31d1b9d9f0d9c7d1e4b553e583381552cd8778/converter/adb_usb/config.h#L54-L57Keypad =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 CapsLockMany of old ADB keyboards have mechanically locking switch for Caps lock and TMK supports them.
https://github.com/tmk/tmk_keyboard#mechanical-locking-supportOr 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.
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.
https://github.com/tmk/tmk_keyboard/issues/274ISSUESCheck also:
https://github.com/tmk/tmk_keyboard/issues?q=is%3Aissue+ADB- Apple Desktop Bus Mouse II(M2706) assembled in Ireland doesn't work due to initialization failure. Meanwhile, M2706 assembled in Taiwan works.
https://geekhack.org/index.php?topic=14290.msg2873443#msg2873443https://geekhack.org/index.php?topic=14290.msg2875515#msg2875515Malaysia one also works. With 'Address Resolution' fix(2022-05) Ireland one work now perhaps.(Test needed)
https://github.com/tmk/tmk_keyboard/issues/748#issue-1396848868- NeXT ADB Mouse has problem at startup.
https://geekhack.org/index.php?topic=14290.msg3119277#msg3119277