geekhack

geekhack Projects => Making Stuff Together! => Topic started by: hasu on Wed, 12 January 2011, 11:53:40

Title: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 12 January 2011, 11:53:40
(http://i.imgur.com/iLMqfslh.jpg)

You can buy preassembled TMK ADB-USB converter here (https://geekhack.org/index.php?topic=72052.0)




RESOURCES
ADB protocol:
https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus

Source code:
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb




KEYMAP EDITOR
You can edit keymap and download firmware with web browser.

TMK ADB-USB converter rev2(ATMega32u2) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb)
TMK ADB-USB converter rev1 and converter with Teensy2.0 or ProMicro(ATMega32u4) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1)

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 FIRMWARE
https://github.com/tmk/tmk_keyboard/wiki#build-firmware

SOURCE CODE:
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb


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.





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

Code: [Select]
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 (https://geekhack.org/index.php?topic=14290.msg3120014#msg3120014).


pull-up resistor
You 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-resistor

1k ohm is strongly recommended.
You can use 1/10W or higher power rating of resistor. See this (https://geekhack.org/index.php?topic=14290.msg3120014#msg3120014) for resistor power rating.

Code: [Select]
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#msg3117720




DEBUG
You can use hid_listen (https://github.com/tmk/tmk_keyboard/wiki#hid_listen) to see debug prints.

Debut Outputs
RRR
The "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-L164

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.


Sigrok ADB decoder
Cheap $10-20 Logic Analyzer (https://sigrok.org/wiki/Fx2lafw#Logic_Analyzers_/_mixed-signal_devices) that is compatible with sigrok (https://geekhack.org/https://sigrok.org/wiki/Main_Page) 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#sigrok
(https://user-images.githubusercontent.com/424590/169636730-023f5f22-813d-4fe3-977e-885af3a91444.png)


TROUBLE 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 (https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro) 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 :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.

[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]





UPDATE
2012/12/12 Extended keyboard support by blargg (https://geekhack.org/index.php?topic=14290.msg736664#msg736664)
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 (https://github.com/tmk/tmk_keyboard/pull/207)
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 (https://geekhack.org/index.php?topic=14290.msg2549648#msg2549648) 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
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) (https://github.com/tmk/tmk_keyboard/issues/725#issuecomment-1779462409)




TESTED DEVICES

Check also: https://github.com/tmk/tmk_keyboard/issues/736

Keyboard:
- 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 (https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#next-ansi)
- NeXT ADB Keyboard German (https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#next-german)


Mouse:
- 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 (http://Apple Desktop Bus Mouse II M2706 Taiwan)
- 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 (https://github.com/tmk/tmk_keyboard/issues/671) 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 (https://github.com/tmk/tmk_keyboard/commit/d0cddedcdc543ce40ef387f31cbb7690552b61db). 2021-11-17




AEK left/right modifiers discrimination, ISO layout and Adjustable keyboard media keys
On 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 keys
The ISO keys should be correctly supported.

iMate and uKey have problem on some keys reportedly.
https://geekhack.org/index.php?topic=4185.msg61270#msg61270
https://github.com/randyrants/sharpkeys/issues/225#issue-537872871


Power key
In default configuration Power key works as 'Magic command' trigger key when it is held.
https://github.com/tmk/tmk_keyboard#magic-commands

You can remap the Power key somehow but there is a limitation.
https://geekhack.org/index.php?topic=14290.msg3100399#msg3100399

You 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-L57


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.
https://github.com/tmk/tmk_keyboard#mechanical-locking-support

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.






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/274




ISSUES

Check 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#msg2873443
https://geekhack.org/index.php?topic=14290.msg2875515#msg2875515

Malaysia 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
Title: ADB to USB keyboard converter for Teensy
Post by: lowpoly on Fri, 14 January 2011, 04:51:53
Hah, great.

Strange nobody replied. I thought the Griffin iMate was hard to get (http://geekhack.org/showthread.php?t=11839) 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? :-)
Title: ADB to USB keyboard converter for Teensy
Post by: Soarer on Fri, 14 January 2011, 06:20:26
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 :/
Title: ADB to USB keyboard converter for Teensy
Post by: Findecanor on Fri, 14 January 2011, 06:57:32
Superb! How does it handle latching Caps Lock, though?
Title: ADB to USB keyboard converter for Teensy
Post by: iMav on Fri, 14 January 2011, 07:26:10
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.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sat, 15 January 2011, 01:08:18
Quote from: Findecanor;278417
Superb! How does it handle latching Caps Lock, though?


It doesn't nothing actually now.
At this time you must remove lock pin form the ALPS or replace with normal switch :)
Or if you don't care about Caps LED, you can remap to Shift.
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Sat, 15 January 2011, 12:12:08
Hasu, would you mind posting your hex file? I am trying to figure out what stupid thing I have done, since I see no keystrokes. The device is recognized as a keyboard, so I know it has been programmed correctly. I have tried two different computers, three different keyboards, and double-checked my wiring.
(http://geekhack.org/attachment.php?attachmentid=14855&stc=1&d=1295114914)

Quote from: hasu;278881
It doesn't nothing actually now.
At this time you must remove lock pin form the ALPS or replace with normal switch :)
Or if you don't care about Caps LED, you can remap to Shift.


This part should be simple; there is a specific USB code for locking Caps keys — 130 rather than 57.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sat, 15 January 2011, 23:05:37
Quote from: kps;279038
Hasu, would you mind posting your hex file? I am trying to figure out what stupid thing I have done, since I see no keystrokes. The device is recognized as a keyboard, so I know it has been programmed correctly. I have tried two different computers, three different keyboards, and double-checked my wiring.

No, I don't mind at all.

Regarding your wiring, it seems to be OK but you may need to check ADB socket side again.
Following is my ADB socket pinouts, but I think yours is same as mine.

Code: [Select]

    Female socket from the front
    __________
    |        | <--- top
    | 4o  o3 |
    |2o    o1|
    |   ==   |
    |________| <--- bottom
      |    |   <--- 4pins

    Female socket from bottom

    ========== <--- front
    |        |
    |        |
    |2o    o1|
    |4o    o3|
    ---------- <--- back

    1: Data
    2: Power SW(low when press Power key)
    3: Vcc(5V)
    4: GND


   

Quote

This part should be simple; there is a specific USB code for locking Caps keys — 130 rather than 57.


Thank you. I will try the keycode and fix my code.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 16 January 2011, 00:04:22
I tried the "Locking Caps Lock"(0x82) instead of Caps Lock(0x39) in Windows and it failed to handle the key. I didn't check it on other OSes, but Windows fails at least.

Windows has no translation table for "Locking Caps Lock", thus we can use the key unfortunately :(

See this document for details:
http://www.microsoft.com/whdc/archive/scancode.mspx
Title: ADB to USB keyboard converter for Teensy
Post by: Soarer on Sun, 16 January 2011, 07:38:31
That's a messy problem :(

I suppose the only solution is to send two packets for each change in state of the caps lock - one with the key down, and then one with the key up a millisecond or so later.

That appears to be how the Belkin adapter handles it.

What a hassle though!
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 16 January 2011, 08:17:58
Quote from: hasu;279286
No, I don't mind at all.

kps,
I misinterpreted your first sentence :)
Sorry. I attached my hex.



Quote from: Soarer;279367
That's a messy problem :(

I suppose the only solution is to send two packets for each change in state of the caps lock - one with the key down, and then one with the key up a millisecond or so later.

That appears to be how the Belkin adapter handles it.

What a hassle though!


Belkin solution will be a problem for someone who want to remap the key.
But it may be good for most people.

I prefer switch conversion solution though it is not for everyone.
Title: ADB to USB keyboard converter for Teensy
Post by: Soarer on Sun, 16 January 2011, 08:32:14
Quote from: hasu;279388
Belkin solution will be a problem for someone who want to remap the key.
But it may be good for most people.

I prefer switch conversion solution though it is not for everyone.


Yes, that would be better.

But... I have a Macally MK96, and it already has a non-locking switch for caps lock! Its keyboard firmware must simulate the locking action, I guess. I don't know how many other ADB keyboards do a similar thing, but the only way to get a normal key action with them would be to replace the keyboard controller (which is what I will do :) ).
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Sun, 16 January 2011, 12:33:21
Quote from: hasu;279388
kps, I misinterpreted your first sentence :)


Sorry, my fault for using idiomatic English.

Thank you; that has helped me narrow down my problem somewhat.

I hacked in some ugly code to send a Shift directly when the power key is pressed, and that worked. With a logic probe, I see "chatter" on the ADB line on the other port of the keyboard, so I think my connections are sound. I suspect my problem may be either noise or timing related, since (by using the LED on the Teensy) it seems I never get past the if (read_bit()) // Stopbit(0) in adb_host_kbd_recv().
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Mon, 17 January 2011, 09:38:47
Quote from: kps;279449

I hacked in some ugly code to send a Shift directly when the power key is pressed, and that worked. With a logic probe, I see "chatter" on the ADB line on the other port of the keyboard, so I think my connections are sound. I suspect my problem may be either noise or timing related, since (by using the LED on the Teensy) it seems I never get past the if (read_bit()) // Stopbit(0) in adb_host_kbd_recv().



My code is very primitive and have not been checked its signal conformity
by logic analyzer nor oscilloscope, thus it could lose the sync under some circumstances.

Another possibility I come up with is  port damage of your Teensy.
My Teensy actually lost one port by latch-up while prototyping/debug :)
If your DATA line port is suspicious, you should try another port.
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Mon, 17 January 2011, 10:52:09
Quote from: hasu;279835
My code is very primitive and have not been checked its signal conformity by logic analyzer nor oscilloscope, thus it could lose the sync under some circumstances.


I may get out those tools next weekend. My logic analyzer is ancient (HP1615A, 1979) but should be adequate for ADB.

Quote
Another possibility I come up with is  port damage of your Teensy.
My Teensy actually lost one port by latch-up while prototyping/debug :)
If your DATA line port is suspicious, you should try another port.


I don't think that is the case, but I will check.

I do own an iMate, so this is not vital to me, but it might help other people later.

Later, I want to try using one of the cheap PS3 dongles with an AT90USB162. That, plus half an s-video cable, would make an ADB converter for under $10.
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Fri, 11 February 2011, 02:30:41
(http://cfile2.uf.tistory.com/image/136B413E4D54D5661D5B8B)
This week I got Teensy++ 2.0 and tried. As a result I found problems.

1. If ADB cabe is long, OSX couldn't detect keyboard. (In fact, it does but couldn't detect any key strokes) I have short cable which is included in Apple adjustable keyboard and three other normal cables. Short cable works good but others not.
2. key stroke is recognized multiple time.

These problems (I Think) caused by my environment...

I changed adb/config.h (I moved port and bit)

#define ADB_PORT        PORTB
#define ADB_PIN         PINB
#define ADB_DDR         DDRB
#define ADB_DATA_BIT    6
#define ADB_PSW_BIT     5       // optional

I should change ADB_DDR/ADB_PIN as above right ?
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sat, 12 February 2011, 03:03:55
jeffreysung,
Thank you for your reporting!
I don't use this converter daily, so it is still very immature.
But I am happy to improve this project, any feedback is welcome.

Quote from: jeffreysung;293270

This week I got Teensy++ 2.0 and tried. As a result I found problems.

1. If ADB cabe is long, OSX couldn't detect keyboard. (In fact, it does but couldn't detect any key strokes) I have short cable which is included in Apple adjustable keyboard and three other normal cables. Short cable works good but others not.
2. key stroke is recognized multiple time.

These problems (I Think) caused by my environment...

My code(adb.c) which process ADB signal is very primitive. It use polling & delay method to check the DATA line activity, while it should use interrupt routine.  I think it is prone to lose sync with keyboard under some condition(signal with loose edge or interference by other interrupt code). This perhaps causes your problems.

I will rewrite adb.c using pin chajnge interrupt at an early day.


Quote

I changed adb/config.h (I moved port and bit)

#define ADB_PORT        PORTB
#define ADB_PIN         PINB
#define ADB_DDR         DDRB
#define ADB_DATA_BIT    6
#define ADB_PSW_BIT     5       // optional

I should change ADB_DDR/ADB_PIN as above right ?

You are right. It is OK to use PB6.
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Sat, 12 February 2011, 12:56:17
Quote from: jeffreysung;293270
1. If ADB cabe is long, OSX couldn't detect keyboard.


Ah. I just tried this. (Last time I used a normal coiled ADB cable.)  I made a 3-inch cable from an S-video cable. With this, a IIgs keyboard worked (except for the duplicates) and an Extended partly worked.

Then I did a little searching and found a PIC application note (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011062) on ADB. Based on that, I added a pullup to the ADB data line. With the pullup, both keyboards work, even with a long cable.
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Sat, 12 February 2011, 19:50:21
Quote from: kps;294046
Ah. I just tried this. (Last time I used a normal coiled ADB cable.)  I made a 3-inch cable from an S-video cable. With this, a IIgs keyboard worked (except for the duplicates) and an Extended partly worked.

Then I did a little searching and found a PIC application note (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011062) on ADB. Based on that, I added a pullup to the ADB data line. With the pullup, both keyboards work, even with a long cable.


ATMEL supports (maybe) both pull up/down. This could be very useful in weak signal but pull up/down is a little bit slow compared to normal signaling. Thanks for useful info.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 13 February 2011, 03:02:09
kps,

I confirmed the problem on coiled cable, and pull-up resistor solved it.  With coiled cable the converter couldn't get signal from keyboard and  didn't recognize any key stroke. I couldn't see the key duplicate  problem.

AVR's internal pull-up seems to be too weak to communicate with ADB  keyboards, we may need external pull-up resistor instead in many case  though some cable including my  straight cable doesn't need it.

Thanks.

My pull-up resistor:
(http://i.imgur.com/6jcvBl.jpg)
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Mon, 14 February 2011, 01:36:39
Quote from: hasu;294316
kps,


AVR's internal pull-up seems to be too weak to communicate with ADB  keyboards, we may need external pull-up resistor instead in many case  though some cable including my  straight cable doesn't need it.


It is the other around.

There is internal pull-up resistor inside and if you add resistor outside pin, total resistance goes down(1/Rt = 1/Rin + 1/Rout) and this could explain why coiled or long cable couldn't work with.
The ADB cable is like a attenuator and because of internal (big) pull up resistor, signal couldn't swing between +5V and 0V properly (means couldn't go down to ground level).

By adding a external resistor, total pull up resistance goes down, and signal could swing more properly.
Title: ADB to USB keyboard converter for Teensy
Post by: Soarer on Mon, 14 February 2011, 08:24:19
Partly, you are saying the same thing: a big resistor = a weak pull-up.

But the voltage range of the signal is not affected. The capacitance of the cable makes the signal slow to rise from 0V to +V, since that capacitance has to charge up via the pull-up resistor.
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Tue, 15 February 2011, 22:24:30
I fount a strange thing.

Up to now, I tested this board with my macbookpro/iMac. It always shows multiple stroke from time to time. When I connected to Windows PC, there is no multiple strokes.

Is there anybody who tried with Mac ?
Title: ADB to USB keyboard converter for Teensy
Post by: Soarer on Wed, 16 February 2011, 09:07:40
I played around with external pull-up resistors on my PS2 adapter (the principle is the same).

This is with about 5m of cable in all, so pretty much a worst case scenario.

Internal pull-up:

[attachimg=1]

External 2k2 pull-up - better, but still a bit slow to rise and a fair bit of crosstalk between the clock and data signals:

[attachimg=2]

External 1k pull-up - seems to be the sweet spot, much cleaner signals in every respect:

[attachimg=3]

I think it affects the ADB adapter more because the timing is critical - if you have a slow rise on the signal it moves the switching point in time.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 16 February 2011, 22:55:18
jeffreysung,
hmm, it is a weird behaviour.  I can't come up with the cause now and I have no healthy mac to try:(

Soarer,
It is nice to see real wave forms!
I have ordered my first oscilloscope a few days ago. I can hardly wait for my Rigol :)
Title: ADB to USB keyboard converter for Teensy
Post by: Soarer on Thu, 17 February 2011, 06:40:34
Excellent! I don't know how I managed before I got my 'scope :-)

I have just ordered my first logic analyzer (although a cheap one!), an Open Workbench Logic Sniffer (http://www.seeedstudio.com/depot/open-workbench-logic-sniffer-p-612.html). So, similar suspense here :-)
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Wed, 23 February 2011, 00:49:40
Multiple key stroke problem solved.

in adb/matrix.c

just add delay statement before if (codes == 0 ) {

like this.

    key0 = codes>>8;
    key1 = codes&0xFF;

   _delay_us(300);
    if (codes == 0) {                           // no keys
        return 0;
    } else if (key0 == 0xFF && key1 != 0xFF) {  // error
 


I found this problem in making USB controller for Apple Desktop Bus Keyboard(a.k.a. IIgs keyboard).

Why 300us ? This is experimental value. I tried from 250us to 500us and 300us is the most stable value.
(With 300us, there is little multiple stroke issue.)

and I don't know why this problem is occurred only with OSX. : (
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Thu, 03 March 2011, 21:06:40
The upper solution could solve almost multiple key stroke problem but not all.

By setting USB device as low speed device, this problem could be solved.(I didn't tried)

I made USB controller for Apple desktop bus keyboard(IIgs) with Teensy++2.0 and this multiple key stroke problem exists also. I tried in many ways but I couldn't find what is wrong but I could expect there is some timing issue between USB host and firmware. As a work around, by setting this controller as low speed device this problem has gone.

Here is my work picture
(http://cfile7.uf.tistory.com/image/1947915A4D651B381E3C0D)
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Fri, 04 March 2011, 09:01:14
jeffreysung (http://geekhack.org/member.php?u=7649),
Nice USB receptacle setting!


Your problem is not bouncing. right?
I have not experienced the multiple key stroke problem. I tried AEKII, m0116 and some Macways, but it was not a long time use.
Unfortunately I have no IIgs to try. (It is one of keyboards I want to own! :)

Do you have other ADB keyboard than IIgs?
I want to know whether the problem is specific to IIgs or not.

Do you have iMate or other converter?
I want to know whether the problem is caused by my converter or not.
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Fri, 04 March 2011, 09:17:19
Quote from: hasu;304861
Do you have other ADB keyboard than IIgs?
I want to know whether the problem is specific to IIgs or not.


I do have most models of Apple ADB keyboard, including the IIgs. I will test several this weekend.

Quote
Do you have iMate or other converter?
I want to know whether the problem is caused by my converter or not.


I have an iMate, and have never seen duplicate keys with it.
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Sun, 06 March 2011, 10:24:02
I have tried several different keyboards, and got duplicate key reports with all of them.

Quote
TThis is an  Apple  Desktop Bus keyboard, modell A9M0330.
This  is ann Apple Keyboardd,  model  M0116.
This is a squishy Apple Keyboard II,  mmodel  MM0487..
This  is  ann Apple   Extended  Keyboard,, model M0115.
TThis  is an  Appple Extennded Keyboard  II, mmodel M3501.
Thhis is an Applle Adjustable Keyboard, modell MM1242.
Title: ADB to USB keyboard converter for Teensy
Post by: woody on Sun, 06 March 2011, 11:36:39
kps, do you happen to have extra A9M0330 for sale?
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Sun, 06 March 2011, 20:12:10
Quote from: hasu;304861
jeffreysung (http://geekhack.org/member.php?u=7649),
Nice USB receptacle setting!


Your problem is not bouncing. right?
I have not experienced the multiple key stroke problem. I tried AEKII, m0116 and some Macways, but it was not a long time use.
Unfortunately I have no IIgs to try. (It is one of keyboards I want to own! :)

Do you have other ADB keyboard than IIgs?
I want to know whether the problem is specific to IIgs or not.

Do you have iMate or other converter?
I want to know whether the problem is caused by my converter or not.

1.I have two "2 adb to usb" converters and there is no problems with these.
2.I have AEKII/IIgs/Design/Adjustable keyboards and all the same problem with converter.
3.I think there is a different in handling USB interrupt between OSX and Windows. Windows doesn't have problem.
4.If I set teensy( ++ 2.0) as low speed device, this multiple stroke problem is gone. There should be a timing mismatch between this firmware and OSX.
   a. As I wrote before, if I insert delay in keyscan function, the occurrence of this multiple stroke reduced.
   b. If I set as low speed device, USB interrupt/FIFO speed would go lower and this prevent our problem.
   c. With low speed device setting, USB debugging has some problem. It it too low to print debug information on screen.


To set Teensy++ 2.0 as low speed device, you should modify some functions and headers.

usb.c, usb_init
UDCON = 0; --> UDCON = 0x04;  (for Teensy++2.0, set LSM bit.)

usb_debyg.h
#define DEBUG_TX_SIZE 32 --> 8  (All endpoint size should be 8byte)

usb_keyboard.h
#define KDB2_SIZE 16 --> 8 (the same with above)
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 06 March 2011, 20:36:22
Quote from: kps;306178
I have tried several different keyboards, and got duplicate key reports with all of them.

Thanks.
It is on OS X? You see this problem on WIndows or Linux too?

I have no problem during 20-30min my daily usage. Hmm...
Disclosure: I am slow typer 40-50wpm.

I tried this attached firmware (http://geekhack.org/showpost.php?p=279388&postcount=10) on Teensy2.0 and latest firmware on Teensy2.0/Teensy++2.0. My pull-up resistor is 10K Ohm.

Cables: coiled cable and straight cable.
Keyboards: AEKII(M3501) and Apple keyboard(M0116)
OS: WIndows 7 64bit and Ubuntu 10.04


Quote
1.I have two "2 adb to usb" converters and there is no problems with these.
2.I have AEKII/IIgs/Design/Adjustable keyboards and all the same problem with converter.
3.I think there is a different in handling USB interrupt between OSX and Windows. Windows doesn't have problem.
Thanks, jeffreysung.
Finally, I understood that it is a problem specific to OS X.
Unfortunately I have no OSX to try :(

My USB stack(based on PJRC's code) seems to have some faults.
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Mon, 07 March 2011, 09:12:12
Quote from: hasu;306544
It is on OS X? You see this problem on WIndows or Linux too?


It was OS X. I tried again on Windows (with an AEK) and saw two instances of doubled characters in a half page of text.

For my tests I was using yesterday's firmware (did a 'git pull' before testing), 10K pullups, and a 1m straight cable (half an S-video cable).

Quote
My USB stack(based on PJRC's code) seems to have some faults.


I am not sure that is so. I notice in my tests above that 12 of 14 doubles occur at the beginning or end of words. Obviously the software does not know about words, but my fingers do. I wonder whether the ADB keyboards might actually be sending a second event if the key is still down when it is polled again.
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Mon, 07 March 2011, 11:26:04
Quote from: kps;306815

I am not sure that is so. I notice in my tests above that 12 of 14 doubles occur at the beginning or end of words. Obviously the software does not know about words, but my fingers do. I wonder whether the ADB keyboards might actually be sending a second event if the key is still down when it is polled again.


According to my test (USB controller directly attached to IIgs), this multiple stroke might be caused with interrupt handling. The source code looks good and USB interrupt handling functions are based on sample code of pjrc.com.

1. When I debugged adb adapter, key stroke scanning has no problem and USB report(data structure for sending keys to USB host) has no problem.
2. The problem is adb adapter has only one key data but it seems that USB host get the data multiple time.
3. This situation could be occurred if interrupt flag is handled wrong. Think about this. USB host requested to device for new data. Device had sent one data(right data). With some problem, device think there is more data in FIFO and send data at next request. (USB host search new data by polling devices)
4. I think that there could be a problems in key scan turn around time. The simplified actions of firmware is repeating this procedure "key scan - if there is modified key send it FIFO". In repeating this procedure, there should be some problems (especially interrupt handling).
5. In the case of USB controller(directly attached to IIgs), everything from keyscan to storing data to FIFO is perfect.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 08 March 2011, 00:20:18
After browse of some codes of Darwin, I found a clue of the problem.
OS X seems to request SET_IDLE(24ms) to keyboard, while Windows requests SET_IDLE(0ms). I think Linux also requests 0ms.

HID SET_IDLE request inhibits device to report keys during given interval if key state is not changed. 0ms means device must not report without change.
I assume this difference causes the problem appeared only in OS X.

Bug codes run only when idle interval runs out. On Windows and Linux the codes with bug never run, on the other hand the problem occasionally occurs on OS X.

This bug is very timing issue around interrupt handlers. I will fix this problem but it may take some time.



This is the codelet from Apple.
OS X requests 24ms on most keyboards, but 0ms on Apple's. why?
If I found right clue, changing VENDOR_ID to '0x05AC'(Apple) in config.h will disappear the problem.

http://www.opensource.apple.com/source/IOUSBFamily/IOUSBFamily-417.4.1/IOUSBHIDDriver/Classes/IOUSBHIDDriver.cpp

Code: [Select]
   // For Keyboards, set the idle millecs to 24 or to 0 if from Apple
    //
    if ( (_interface->GetInterfaceClass() == kUSBHIDClass) &&
         (_interface->GetInterfaceSubClass() == kUSBHIDBootInterfaceSubClass) &&
         (_interface->GetInterfaceProtocol() == kHIDKeyboardInterfaceProtocol) )
    {
        if (_device->GetVendorID() == kIOUSBVendorIDAppleComputer)
        {
            SetIdleMillisecs(0);
        }
        else
        {
            SetIdleMillisecs(24);
        }
    }
Title: ADB to USB keyboard converter for Teensy
Post by: jeffreysung on Tue, 08 March 2011, 00:39:15
Wow.. awesome!!! there is no multiple key stroke!!!!

Thanks. Hasu

I attach screenshot.

(http://cfile1.uf.tistory.com/image/2013864D4D75CE42251D4D)
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 09 March 2011, 20:27:21
Quote from: jeffreysung;307403
Wow.. awesome!!! there is no multiple key stroke!!!!


jeffreysung,
Thanks for your feedback.

I pushed fix for the problem to github now. I think this fix avoids multiple key stroke.
Title: ADB to USB keyboard converter for Teensy
Post by: b0bb3r5 on Sat, 12 March 2011, 11:56:29
i have a old m0110a how would i go about getting this to work with a teensy? i have a teensy, the keyboard, electronics...etc and id really love to get some help converting it
Title: ADB to USB keyboard converter for Teensy
Post by: kps on Sat, 12 March 2011, 13:33:25
Quote from: b0bb3r5;310514
i have a old m0110a how would i go about getting this to work with a teensy? i have a teensy, the keyboard, electronics...etc and id really love to get some help converting it


The M0110A is not an ADB keyboard, so you should probably start a separate thread for that.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Thu, 01 September 2011, 00:06:35
I finally added locking capslock key support and this is default now.
Someone sent me a patch for this feature. Thank you!

I think most ADB keyboards has a locking capslock in either case whether physical push-lock or software locking.
So this feature is good for people using their keyboard as is, while some who replace caps with non-locking switch
for remapping will want to disable this feature with commenting out following macro in config.h.
Code: [Select]

/* Locking Caps Lock support */
#define MATRIX_HAS_LOCKING_CAPS
Title: ADB to USB keyboard converter for Teensy
Post by: nodnerb on Sat, 29 October 2011, 00:36:38
Hi Hasu,

Your firmware is some great work... works out of the box for my Apple-branded keyboards!

I had some problems with a Datadesk Smartboard, and it wasn't until I got it on an oscilloscope that I found out why...
For some reason, this keyboard sends a '1' as a stop bit (which is against the ADB standard... how did this keyboard ever work on a Mac?).
Also, the timing of the signals is a bit screwy,
__~~~ after 35 us for '1'
___~~ after 56 us for a '0' (This should be 65 us!) - this one is causing random bit-swapping with the default 55 us delay before reading the bit value.
So, for this board, I've changed the read delay to 45 us and disregard the value of the stop bit.

Just got things working a bit on Friday, we'll see how the board works next week.

My keyboard has a sticky "B" key - don't know what I can do about this just yet...

Thank you for providing the firmware for us!

I'm going to look into your source code to see how the layer switching works.

Cheers,
nodnerb
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sat, 29 October 2011, 07:59:33
nodnerb,
Thank you for your feedback! This is good to know.


Quote from: nodnerb;441636

I had some problems with a Datadesk Smartboard, and it wasn't until I got it on an oscilloscope that I found out why...
For some reason, this keyboard sends a '1' as a stop bit (which is against the ADB standard... how did this keyboard ever work on a Mac?).
Also, the timing of the signals is a bit screwy,
__~~~ after 35 us for '1'
___~~ after 56 us for a '0' (This should be 65 us!) - this one is causing random bit-swapping with the default 55 us delay before reading the bit value.
So, for this board, I've changed the read delay to 45 us and disregard the value of the stop bit.

Your keyboard might be compliant for ADB spec though it is not good implementation without enough margin.
If my code could read a bit exactly after 55us it seems to has no problem.  My code intends to read a bit after 55us delay,
but delay time is not so accurate because the code is written in C as you know. It may be imposed a few excess micro seconds in addition to the 55us.


Quote from: nodnerb;441636

I'm going to look into your source code to see how the layer switching works.

Ah, it is a very confusing and chaotic part of my firmware :(
and its broken English comment doesn't work even for me :)
Title: ADB to USB keyboard converter for Teensy
Post by: CyberDave on Wed, 21 December 2011, 03:41:54
Thanks so much for this! I'm modding an Apple Extended Keyboard II with an internal Teensy adapter as a Christmas gift for my brother.


It's working great, except for one thing...the power button isn't doing anything on my Mac. Yes, it is wired up correctly...the Teensy is seeing the key up/down, but seemingly not doing anything. Here's what hid_listen.mac shows for debugging output:


Code: [Select]
r/c 01234567
00: 00000000
01: 00000000
02: 00000000
03: 00000000
04: 00000000
05: 00000000
06: 00000000
07: 00000000
08: 00000000
09: 00000000
0A: 00000000
0B: 00000000
0C: 00000000
0D: 00000000
0E: 00000000
0F: 00000001
ignore keycode: B0
keys: 00 00 00 00 00 00  mods: 00
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
ignore keycode: B0
adb_host_kbd_recv: FFFF


I'm not sure what the "ignore keycode" is all about. Will take another look tomorrow when I'm not half asleep. Until then, any ideas?
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 21 December 2011, 11:25:05
Hi, CyberDave. Thanks for your feedback.

Quote from: CyberDave;475045
Thanks so much for this! I'm modding an Apple Extended Keyboard II with an internal Teensy adapter as a Christmas gift for my brother.

Wow, AEKII for gift?! Your brother is so lucky :)


Quote
It's working great, except for one thing...the power button isn't doing anything on my Mac. Yes, it is wired up correctly...the Teensy is seeing the key up/down, but seemingly not doing anything. Here's what hid_listen.mac shows for debugging output:


Oops, this is a bug. I fixed this bug and pushed the commit to github, try latest sources.

With default keymap you can send a power down event to OS with the power button, Mac's reaction to the event depends on your OS setting. I think Mac will display a sleep/shutdown dialog or sleep immediately without warn.
By pushing power button you will be able to wake your sleeping Mac as well.
Title: ADB to USB keyboard converter for Teensy
Post by: CyberDave on Wed, 21 December 2011, 18:42:47
Quote from: hasu;475239
Hi, CyberDave. Thanks for your feedback.

Wow, AEKII for gift?! Your brother is so lucky :)

Oops, this is a bug. I fixed this bug and pushed the commit to github, try latest sources.

With default keymap you can send a power down event to OS with the power button, Mac's reaction to the event depends on your OS setting. I think Mac will display a sleep/shutdown dialog or sleep immediately without warn.
By pushing power button you will be able to wake your sleeping Mac as well.

He's an editor at a small book publisher, and an aspiring writer. We've been Mac users since we were kids...I've Retr0brighted the keyboard and cleaned it up. I hope he gets a kick out of seeing it restored to its original platinum glory (and that I can get the thing finished before I head home for the holidays (currently I need to figure out how I'm going to install the USB port in this thing so it can look as much like a stock keyboard as possible).

Thanks for the quick fix...I will test it out tonight. Ideally, I'd like it to just pop up the Mac's regular shutdown dialog box. Wake from sleep would be a nice side benefit as well.
Title: ADB to USB keyboard converter for Teensy
Post by: CyberDave on Thu, 22 December 2011, 02:44:17
Update: the power button now brings up the Mac's standard sleep/restart/shutdown dialog, and also wakes my MacBook Pro from sleep. The keyboard is reassembled and looks great. Now I just have to get to work on another one or two of these for myself...

hasu, this is awesome. If you're ever in Seattle, the first beer or two is on me.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Thu, 22 December 2011, 21:02:39
Cool. Happy Christmas!
Title: ADB to USB keyboard converter for Teensy
Post by: blargg on Tue, 10 January 2012, 14:58:24
HUGE thanks for this! I've been using an old PowerMac with ADB Extended Keyboard for the last 15 years for coding, and hate all the cheap keyboards for my newer USB-based machines. I just got a Teensy++ 2.0 and figured I'd try this as the first project. Code built without a hitch, wiring just as shown on the page, and it works perfectly. I've saved up several Apple Extended Keyboard IIs and this will make my slow transition to newer machines so much more pleasant. Thank you!
Title: ADB to USB keyboard converter for Teensy
Post by: woody on Wed, 11 January 2012, 09:22:59
Ha, hello and welcome, blargg!
Title: ADB to USB keyboard converter for Teensy
Post by: HILO on Thu, 26 January 2012, 07:46:34
Hello, I'm beginner of Electronics.
Last day, I got an Apple Extended Keyboard2. But I don't have ADB Port Macintosh.
I tried to make the ADB to USB keyboard converter for Teensy.
But, it's doesn't work.

I tried to trouble shooting.
Maybe, I missed to build.

1. Define following macros for ADB connection in config.h:
   ADB_PORT
   ADB_PIN
   ADB_DDR
   ADB_DATA_BIT
   ADB_PSW_BIT

Then, I refferd to Config.h.
/* ADB port setting */
#define ADB_PORT PORTF
#define ADB_PIN PINF
#define ADB_DDR DDRF
#define ADB_DATA_BIT 0

 I use Teensy 2.0. in this case, I connected Data-Line to Teensy PF0 with 10kOHM PullUp. PSW-Line to Teensy PF1.
What shall I do the source code and Teensy2.0.
Please teach me.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Thu, 26 January 2012, 21:00:20
If you use Teensy 2.0(not++) you don't need to edit any file.
Just 'make' and program your Teensy.
Double check signal and power lines. PSW line is not needed actually.

And try PJRC hid_listen to see debug print.
Title: ADB to USB keyboard converter for Teensy
Post by: blargg on Sun, 29 January 2012, 23:42:42
Seconded; I didn't have to modify config.h even for a Teensy++ 2.0. I just used the same port pin as listed (F0). Be sure you've got the keyboard wired up properly. The pinout in adb.txt is for the female plug on the keyboard, so your male cord will be mirrored horizontally. You can verify it by ensuring that the GND from the Teensy has continuity to the metal shell of the other ADB connector on the keyboard, and non-continuity to +5V (with the Teensy unplugged from USB of course). Also, when I first connect my keyboard, the caps lock LED lights at first, so that's confirmation that +5V and GND are connected properly. I hope you didn't get them backwards.
Title: ADB to USB keyboard converter for Teensy
Post by: HILO on Mon, 30 January 2012, 07:06:21
Thanks to Advice.
Yes, I use Teensy2.0(not 2.0++).
I'll Retry it.

Thank you.
Title: ADB to USB keyboard converter for Teensy
Post by: HILO on Thu, 09 February 2012, 06:28:41
Hello.
By your advice, AEK2 worked. Thank you.

And, I have an problem. I tuned Windows Registry, swapping CTRL  and CapsLock.
My ThinkPad's keyboard can swapping. But, ADBtoUSB Keyboard converter for Teensy can't swap.
Of course, CAPS's latch mech.
That there was a discussion about the CAPS in the past you know the log. My problem is different and the like.
1st, Windows Registry roll back.
2st, /adb_usb/keymap.c rewrite. Swap,
at
 #define KEYMAP( \   ... K36 <- ->K39 ...
  ... KB_##K36 <--> KB_##39 ...
 and
 KEYMAP(  ... LCTL <--> CAPS ...

I tried to swap LGUI and  LALT by 2st modify. It's successfull.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Thu, 09 February 2012, 07:19:16
You need not to edit definition of KEYMAP macro, just edit key symbols in keymaps[] array.

I think this keymap.c patch is enough to swap Left Control and Caps Lock.
Code: [Select]
130c130
<     CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
---
>     LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
132c132
<     LCTL,LGUI,LALT,          SPC,                                              LEFT,DOWN,RGHT,    P0,       PDOT,PENT
---
>     CAPS,LGUI,LALT,          SPC,                                              LEFT,DOWN,RGHT,    P0,       PDOT,PENT
Title: ADB to USB keyboard converter for Teensy
Post by: HILO on Thu, 09 February 2012, 08:28:22
Quote from: hasu;510063
You need not to edit definition of KEYMAP macro, just edit key symbols in keymaps[] array.

I think this keymap.c patch is enough to swap Left Control and Caps Lock.


Thank you!
I'll try it tomorrow.
Title: ADB to USB keyboard converter for Teensy
Post by: HILO on Fri, 10 February 2012, 03:15:31
I tried to change the /adb_usb/keymap.c .
But cannot work, partly.
CAPS Lock could swap the Original CTRL position.

So, I set the Windows's Mouse Cursor , If I push CTRL key, then brinking Cursor.
At this case, changed keymap.c are correct CTRL signal recieved.

I see the Teensy's LED.
When Original keymap.c use. and I push Original CTRL key ,LED brinking two or three time.
When Rewrite Keymap.c use. I Puch New CTRL key (the position was capslock) , LED brinking one.
Maybe, AEK2's Original Capslock key switch/circuit cannot adapt N-key roll over.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Fri, 10 February 2012, 04:02:21
Ah, maybe 'locking caps' feature prevents you from swap the keys.

Try to comment out the macro in config.h like this:
Code: [Select]
/* Locking Caps Lock support */
//#define MATRIX_HAS_LOCKING_CAPS
Title: ADB to USB keyboard converter for Teensy
Post by: Koplimi on Sat, 11 February 2012, 19:57:57
Is it possible to get a debug output to uart?
I'm trying to implement this on a swedish version of the Apple Extended Keyboard II, but it doesn't seem to be working.
The device is recognized in Mac OS, but no key presses are recognized.

Also, does this firmware depend on some functions in the teensy boot loader or are all functionality loaded into the .hex you get after compiling?
(I'm using a bare Atmega32u4)
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sat, 11 February 2012, 22:28:49
It doesn't support UART as debug channel, instead you'll be able to use 'hid_listen' from PJRC even though your board is not Teensy.

And the converter does not depend on PJRC's bootloader, I think it can also work on other board with ATMega32U4.
Title: ADB to USB keyboard converter for Teensy
Post by: Koplimi on Sun, 12 February 2012, 04:54:53
Quote from: hasu;512225
It doesn't support UART as debug channel, instead you'll be able to use 'hid_listen' from PJRC even though your board is not Teensy.

And the converter does not depend on PJRC's bootloader, I think it can also work on other board with ATMega32U4.

Ok. I see a lot of references to debug-modes and so on in the code. But most seems to depend on key presses. Where should I edit to enable it by default?
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 12 February 2012, 05:15:50
Debug print is enabled by default.
Though code of debug print is immature and mess, debug flags are tinkered in pjrc/main.c and adb_usb/matrix.c.
Title: ADB to USB keyboard converter for Teensy
Post by: Koplimi on Sun, 12 February 2012, 08:45:12
Yes, the debug-output seems to work now, thanks!

But there seems to be weird time-issues. For example, the delays are way off.
When you run the code _delay_ms(5000), do YOU really get a delay lasting 5 seconds? Because I don't.
I'm not sure if that's a problem with the code itself or just me. _delay_ms isn't defined for large delays. Or am I wrong?
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 12 February 2012, 09:12:40
I think _delay_ms works well for me.

What frequency is your crystal on the board? Teensy has 16MHz crystal oscillator.
You may need to edit F_CPU in Makefile.

If you have wrong F_CPU setting _delay_ms() will not work properly.
Title: ADB to USB keyboard converter for Teensy
Post by: Koplimi on Sun, 12 February 2012, 09:22:26
That's just the thing. I'm using a 16MHz crystal as well, and the makefile is already set up for that, as you just said.

Could it be something to do with the environment that i'm compiling in? What software do you have installed?
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 12 February 2012, 10:17:26
I compile with WinAVR 20100110 which consists of:
- binutils 2.19
- gcc 4.3.3
- avr-libc 1.6.7cvs
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 12 February 2012, 10:30:02
Added firmware binary built in my environment on the article page. Try it.
Title: ADB to USB keyboard converter for Teensy
Post by: Koplimi on Sun, 12 February 2012, 10:39:01
Ok, I have uninstalled all that is remotely connected to AVR Studio. And I'm getting timings that are correct! That's positive! :)

Will do further testing and see if it might just work now.

EDIT: YES! It's working now! Thank you for the support! =)

Now I wil need to edit the layout.
Title: ADB to USB keyboard converter for Teensy
Post by: HILO on Mon, 13 February 2012, 02:46:52
Thanks to Advice.
I succeeded, perfectly.
Thank you very much.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Mon, 13 February 2012, 05:04:08
welcome. nice to hear that.
Title: ADB to USB keyboard converter for Teensy
Post by: signet on Sat, 16 June 2012, 12:42:46
I was in the market for a new keyboard to replace my MS Ergonomic 4000 (which has serious mechanical design issues with the space bar) when I came across a link to your article. I went down to my local electronics shop and purchased a LeoStick, uploaded your firmware and got out my ancient M0116 which I use on a SE/30 I have had since new.  It worked first time!

I would like to thank you for the work you have done with this firmware.  I think I will get an Extended II keyboard now that I know it works.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sat, 16 June 2012, 20:11:39
signet, Thanks for letting me know my converter went well.

I'm a kinda fan of ALPS. AEKII has good quiet switches but AEK with orange ALPS is also nice and very popular here in Japan.
Anyhoo, every old ALPS switches tend to require to be lubed inside, it is worth doing though very tedious.

LeoStick with piezo and RBG LED seems to be fun though I haven't hear about. We also have a Leonardo compatible board like Teensy in Japan:
http://strawberry-linux.com/catalog/items?code=25005
I think Leonardo and its compatibles are good alternative for Teensy now though Leonardo bootloader is a tad tricky.
Title: ADB to USB keyboard converter for Teensy
Post by: signet on Sat, 16 June 2012, 22:34:03
I had no problems with the LeoStick (a local Australian produced device http://www.freetronics.com/products/leostick#.T91LPXbO97Q (http://www.freetronics.com/products/leostick#.T91LPXbO97Q)). I used a 10K pullup resistor for insurance since my keyboard has a coiled cable. The bootloader was no big deal, I just used the avrdude CLI utility.

I am interested that you mentioned lubrication I lubed the slider support column on the Return key because it was binding a little bit. Do you have to remove the switches from the PC board to lube them inside? I normally use INOX Mx6, a food grade synthetic grease with PTFE to lubricate the sliding parts on my keyboards, but I have no experience of lubing Alps switches.

On a final note, I am thinking of making some changes to your firmware in order to allow the M0116 power key to be used to generate function keys. The M0116 has no function keys. If the PWR switch is depressed in conjunction with the numeric keys I reckon that would work out OK. It is not so easy to find the Extended version of this keyboard here.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 17 June 2012, 11:08:20
Right. Not big deal but some annoying. Leonardo bootloader jumps into user application in 8 seconds after pushing reset button. I think 8 seconds is a bit short to confirm COM port and run command occasionally :)

You don't need to desolder ALPS switch to lub,  you can open it with 2 precision screwdrivers like this:
http://www.youtube.com/watch?v=GhxC6AEzBUo
I usually use a dry lub(RO-59) but have no experience of applying grease to inside of switches.

Ah, M0116 has no function keys... I didn't notice ADB converter needs a keymap layer for function keys.
I'll add it to the firmware sometime soon but power key might not be good idea. IIRC Power switch does not behave as normal keys.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 17 June 2012, 23:04:56
Quote from: hasu;615492

Ah, M0116 has no function keys... I didn't notice ADB converter needs a keymap layer for function keys.
I'll add it to the firmware sometime soon but power key might not be good idea. IIRC Power switch does not behave as normal keys.


Added new keymap layer for function keys. I confirmed Power key works as normal key as opposed to my memory. You can get keys from Function layer while pressing power key. See below for keymap detail.


Code: [Select]

    /* Function layer
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
     * |`  |   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |Fn0|
     * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | |Ins|Hom|PgU| |NmL|Mb1|Mb2|Mb3|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|PrS|ScL|Pau|Up |Ins|    \| |Del|End|PgD| |MwD|McU|MwU|MwD|
     * |-----------------------------------------------------------| `-----------' |---------------|
     * |CapsLo|VoD|VoU|Mut|  F|  G|  H|  J|Hom|PgU|Lef|Rig|Return  |               |McL|McD|McR|MwU|
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|End|PgD|Dow|Shift     |     |PgU|     |MwL|McD|MwR|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Mb3|
     * |Ctrl |Gui |Alt |         Space           |     |    |      | |Hom|PgD|End| |    Mb1|Mb2|   |
     * `-----------------------------------------------------------' `-----------' `---------------'
     */
Title: ADB to USB keyboard converter for Teensy
Post by: signet on Mon, 18 June 2012, 01:20:28
Wow! Thank you very much.  I have grabbed the source code off GitHub and I'll build it after I finish work today.  It is good that Japan and Australia are almost in the same time zone :)  

I have noticed two strangenesses with the behaviour of the keyboard which I hope to understand better in due time.

1. At seemingly random times when typing fast a nonsense character is sometimes generated.
2. When I restart my computer (i.e. power is not cycled) the keyboard is working OK at the bootloader (I can enter commands into the Chameleon boot loader) however when OSX comes up, more often than not the keyboard is outputting a stream of repeated characters.  If I then replug the USB things get back to normal after the controller reboots.

I suppose #1 could be an issue with the pullup resistor being weak, so I can substitute a 4k7 for the 10k I currently have on the ADB data line. It could also be a bit timing problem. Considering the LeoStick has the same system clock frequency as the Teensy 2.0 I any software delays spins would be the same.  I am pretty sure that the keyboard itself is OK because it works fine on my SE/30.

#2 I have no good idea yet. I can sometimes clear it by hitting any key, but usually it is necessary to unplug/plug the USB connection.

Anyway, thank you very much for the code update. I am looking forward to playing with it tonight.
Title: ADB to USB keyboard converter for Teensy
Post by: signet on Mon, 18 June 2012, 06:51:52
I now understand what you meant by the Leonardo boot loader being troublesome.  When I installed your firmware the other day, the board was brand new and it always jumped to its bootloader and stayed there.  This evening I have reset the damned thing countless times and have still not succeeded because of the short time window. My OSX computer is an i7950 (fast), yet I think the boot loader is timing out before AVRDude sees the /dev/tty.usbmodem1a11 usb device appear.
Title: ADB to USB keyboard converter for Teensy
Post by: signet on Mon, 18 June 2012, 07:36:44
Success! I told the LeoStick that I would smash it with a hammer if it didn't run the boot loader for me.  It obviously has ears, because the next time I tried it, it worked.

Your updated firmware works well. The function key layer switch via the power key is perfect. Thanks again. I changed a keymap entry to map the M0116 "Clear" key to DEL otherwise there is no way to generate a DEL code from those keyboards. The Clear code is not used by any OSX software that I use, and the key is adjacent to the Delete key (which generates destructive backspace in a M0116).

I will investigate the strange characters now.
Title: ADB to USB keyboard converter for Teensy
Post by: signet on Mon, 18 June 2012, 11:03:45
More success.  

I changed the pull up resistor from 10k to 4k7 and the random bad characters became much worse, consequently I removed the pull up completely and tested again. Perfect! I have been using the keyboard now for a few hours and there have been no corrupted characters.

I love this M0116 keyboard.  Last week, I was considering buying a silver conductive ink pen to repair the conductive trace on an old Microsoft Natural Elite whose ESC key had failed. For the same price as the conductive ink pen (A$29) I was able to buy the LeoStick and resurrect my favourite keyboard and have a load of fun in the process.

Thanks again.
Title: ADB to USB keyboard converter for Teensy
Post by: hasu on Mon, 18 June 2012, 20:26:02
Weird. Pull-up resistor causes making worse signal from keyboard?
Umm, I guess USB voltage could be low if you use bus powered hub and connect some other device to it.
Anyway, it is nice to know some successes.

As for conductive pen, I have some experiences of it on IBM Model M's though I used a nickel pen.
It worked well on flat sheet part but not on folding or curved part. It tend to be brittle on such part after curing.
Instead I used conductive copper tape to patch trace lines. It looks very bad but works :)
http://geekhack.org/showwiki.php?title=Island:29483
Title: ADB to USB keyboard converter for Teensy
Post by: signet on Tue, 19 June 2012, 10:12:06
I thought it weird too, but it is working perfectly now.  I have not experienced any corrupted characters since removing the pull-up and I am not using a bus powered hub.

I considered copper tape, but the broken traces on the MS Elite keyboard are so thin I think it would be very difficult to apply it. I am not going to bother with the Elite keyboard now anyway, since I am so happy with the resurrected M0116.  

However, I think I have caught the keyboard disease. Now that I know how easy it is to make adapters. I used to be a mainframe system engineer, and remember from my time in Japan the wonderful keyboards on the NEC ACOS mainframe computers.  I think they were better than the IBM keyboards of the time (1980s). The absolute best keyboard I ever encountered were on Pertec XL40 data entry systems. Those keyboards had Honeywell Hall effect switches.  I doubt if it is possible to find any the of the XL40 keyboards now, but you might want to research the NEC keyboards. If you like keyboards you would certainly like them.
Title: ADB to USB keyboard converter for Teensy
Post by: alaricljs on Tue, 19 June 2012, 11:31:46
In the classified... Honeywell Hall effect keypads (http://geekhack.org/showthread.php?18048-Bud-Honeywell-Hall-Effect-Keypads-%28-30%29&highlight=honeywell).  In case you want a taste  ;)
Title: Re: ADB to USB keyboard converter for Teensy
Post by: retroboy12 on Sun, 29 July 2012, 04:32:29
Github link isn't working? error 404
Title: Re: ADB to USB keyboard converter for Teensy
Post by: retroboy12 on Sun, 29 July 2012, 04:56:01
ok Github working but this link dead http://geekhack.org/showwiki.php?title=Island:14290 (no input file)
Title: Re: ADB to USB keyboard converter for Teensy
Post by: stratmaster458 on Mon, 30 July 2012, 12:39:33
Hello. I have been using this mod for quite some time however I have been experiencing the following problems under Mac OS X:
- Caps lock randomly engages when the switch is not clicked
- Some times a type key gets held down
- sometimes key combinations get held down and stuck
- sometimes the keyboard becomes unresponsive and needs to be unplugged.
- Somethings random characters appear instead of the keys that I press I have to unplug the keyboard to fix this.


Important note: this mod works 100% with no problems what so ever under Windows 7 Ultimate x64

Any ideas? Has the firmware been updated since early June?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 31 July 2012, 06:16:13
What is revision of firmware?
Recently I've tweaked code drastically to support LUFA stack. This may cause your problems.

Can you try this revision?(225de7a847a511d004bf909b1334e19497cf2f9d)
which should not be affected with that late fix. I think this will work with OSX.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: stratmaster458 on Tue, 31 July 2012, 21:47:41
What is revision of firmware?
Recently I've tweaked code drastically to support LUFA stack. This may cause your problems.

Can you try this revision?(225de7a847a511d004bf909b1334e19497cf2f9d)
which should not be affected with that late fix. I think this will work with OSX.

Can you provide me a link for the latest .hex ?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: drop1410 on Fri, 07 September 2012, 09:41:09
Hello guys, I'm new here (from Barcelona city in Spain). Well I got a quite new Apple Adjustable keyboard model... and before to buy (also hard to find) iMate adapter I was shocked about this adapter (also love the internal hacking with the mini-sub port). The problem is... I don't have experience with soldering or electronic components :-(... would you able to build one of these converters for me? would be really appreciate it, please let me know how much will cost + shipping costs. Again I have no idea about how to build one of these converters :-(.

You could send me an email to: drop@drop1410.com

I would want to use this keyboard with my mac book pro computer.

Let me know!

Thanks!


The upper solution could solve almost multiple key stroke problem but not all.

By setting USB device as low speed device, this problem could be solved.(I didn't tried)

I made USB controller for Apple desktop bus keyboard(IIgs) with Teensy++2.0 and this multiple key stroke problem exists also. I tried in many ways but I couldn't find what is wrong but I could expect there is some timing issue between USB host and firmware. As a work around, by setting this controller as low speed device this problem has gone.

Here is my work picture
Show Image
(http://cfile7.uf.tistory.com/image/1947915A4D651B381E3C0D)

Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Thu, 20 September 2012, 21:15:54
I tried this again yesterday after long interval and found a severe problem of random key stuck.
The converter occasionally misses ADB signal and reads wrong bit, this causes registering wrong key and key stuck.

I pushed ad hoc fix for this problem into the source repository minute ago. This fix doesn't cure the bug completely though mitigates greatly. If you experienced the problem try the latest source.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: blargg on Mon, 15 October 2012, 00:30:08
I updated my Teensy to the latest version a couple of days ago and it seems better than an earlier version. I've noticed one sequence that seems to stress it: <space>|<space> (something I often type when piping the output of one command to another, e.g. bla bla | cut ...). It often puts the spaces together and the | after them. I notice that when I type the |, there's an odd delay.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Mon, 15 October 2012, 04:02:14
My personal keymap was committed accidentally. Now I reverted its keymap to plain vanilla one.
Try the latest source.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 04 December 2012, 08:51:23
Currently my ADB converter has this unsolved issue: https://github.com/tmk/tmk_keyboard/issues/14
Work around is using old repository commit:33d58c2b5647623d2b.

I'll work on this issue later and post here when the issue is resolved.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: tufty on Tue, 04 December 2012, 13:18:57
Currently my ADB converter has this unsolved issue: https://github.com/tmk/tmk_keyboard/issues/14
Work around is using old repository commit:33d58c2b5647623d2b.

I'll work on this issue later and post here when the issue is resolved.
I had a look, it seems likely to be caused by the state machine stuff in common/keyboard.c - if this is taking a significant amount of time, the ADB layer will miss incoming events.  I've noticed occasional missed keys even with the previous versions (although I had put them down to typing fast on a heavily used 25 year old keyboard).

It seems to me that, rather than polling the bus directly, the adb reading code might be better off moved to an interrupt handler similar to the way Bernard has implemented adb handling in Waxbee (see http://code.google.com/p/waxbee/source/browse/WaxB_Adb2Usb/adb_codec.cpp).

Simon
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 04 December 2012, 23:07:21
Thanks for the info.

It looks like better than poling but it still seems to be interrupted by USB task. To avoid this completely we may need to use pin change interrupt which has higher priority than those tasks. I'll look into his code and AVR datasheet later.
And my code does not handle 'Service Request' properly, this also might cause problem.

Anyway it'll take some time to implement those method.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: tufty on Wed, 05 December 2012, 11:09:21
Thanks for the info.

It looks like better than poling but it still seems to be interrupted by USB task. To avoid this completely we may need to use pin change interrupt which has higher priority than those tasks. I'll look into his code and AVR datasheet later.
And my code does not handle 'Service Request' properly, this also might cause problem.

Anyway it'll take some time to implement those method.
Occasional interruptions by the USB task shouldn't be a problem - Waxbee handles ADB wacom tablets without a hitch (and without dropping packets), and they push the ADB "spec" well past its limits.  Ideally, yes, you probably want to be giving top priority to handling ADB bits, though.  If I get a chance I'll have a look to see if I can convert Bernard's approach. It shouldn't be too hard, but winter has just arrived, we've had 1.5m of snow over the last 2 days, I'm supposed to start driving my chairlift on Friday, and I need to redo the plumbing in the bathroom tomorrow before we start getting -20c.  And if I get a chance, I'd like to wax and do the edges on my snowboards and the skwal.  So many things to do, so little time.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 05 December 2012, 19:32:01
Winter looks like fun there.
I can understand. Life is too short to kill time for the keyboard thing.
Enjoy your winter life and snow!
Title: Re: ADB to USB keyboard converter for Teensy
Post by: blargg on Mon, 10 December 2012, 23:24:06
I've been needing the right control/Alt/etc. keys for Linux programs which give these special meanings. I read in the ADB tech note (untold story) that the keyboard's handler ID can be changed from 2 to 3, causing it give distinct codes for left and right modifiers. This would be a really useful fix.

...well, that went smoothly on the first try. I just implemented the above on the latest source. I've atteched the patch (I'm not familiar enough with git to submit it myself, sorry). Currently it only sets the keyboard device handler to 3 on USB init, so if you unplug the ADB and plug it back into the keyboard, right modifiers won't be differentiated until you unplug and plug ADB back in. I broke out an adb_host_listen() function since it has the same guts as used by the led-setting function and my device handler setting in matrix_init().

Note that even with this, the Extended Keyboard II (and maybe all the others) still don't differentiate between left and right Command (Alt), so that both are reported as the left one. :(
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 11 December 2012, 08:21:55
Great! Thanks for your contribution, blargg.
I'll merge your patch later.

I found this feature in old Apple document the other day but it had been on my TODO list for some time. You greatly saved my time.

I've been needing the right control/Alt/etc. keys for Linux programs which give these special meanings. I read in the ADB tech note (untold story) that the keyboard's handler ID can be changed from 2 to 3, causing it give distinct codes for left and right modifiers. This would be a really useful fix.
Yes, absolutely useful.


Quote
Note that even with this, the Extended Keyboard II (and maybe all the others) still don't differentiate between left and right Command (Alt), so that both are reported as the left one. :(
Ah, shame :(
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 11 December 2012, 19:03:59
Just merged blargg's patch into the repository.  Thanks.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: blargg on Wed, 12 December 2012, 19:49:11
OK, nevermind, MATRIX_HAS_LOCKING_CAPS works properly. For some reason the OS only now apparently started doing the caps lock LED properly when I didn't have my modified .xmodmap invoked.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Tue, 18 December 2012, 20:39:09
Quote
Connect ADB keyboard to Teensy by 3 lines(Vcc, GND, Data). By default Data line uses port F0. This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. The external pull-up resistor(1K-10K Ohm) on Data is strongly recommended

A few questions... This is my first project of this sort, so sorry if they are stupid questions...
The instruction listed above was taken from the GitHub page. In all of the pictures I see 4 lines going to the Teensy (I have Teensy 2.0). So what is the other line from/for?

Also, how do I add the pull up resistor? Does it go inline between the data line on the Teensy?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 18 December 2012, 22:05:15
Quote
Connect ADB keyboard to Teensy by 3 lines(Vcc, GND, Data). By default Data line uses port F0. This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. The external pull-up resistor(1K-10K Ohm) on Data is strongly recommended

A few questions... This is my first project of this sort, so sorry if they are stupid questions...
The instruction listed above was taken from the GitHub page. In all of the pictures I see 4 lines going to the Teensy (I have Teensy 2.0). So what is the other line from/for?
You can omit Power Switch line connected to port F1. ADB has this line to power Mac system up, but current version of the converter doesn't use this line any more. Without connecting power switch line you can still use power switch on keyboard with this converter.
After all you need to connect only three lines: Vcc, Gnd and Data.


Quote
Also, how do I add the pull up resistor? Does it go inline between the data line on the Teensy?
You should connect a resistor(any of 1k-10kOhm) between Vcc(5V) and data, not inline on data line.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Tue, 18 December 2012, 22:42:23
Thanks hash for the help, and for figuring this out to begin with! I have a little over two weeks off starting Thursday and can't wait to get started on this! Thanks again!

P.s. once I get it done, I will post a status update here for you all.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: SmallFry on Tue, 18 December 2012, 23:07:16
His name is Hasu;)
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Tue, 18 December 2012, 23:41:42
Stupid iOS autocorrect.... TMSAISTI
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Fri, 21 December 2012, 14:57:26
If I understand correctly, I am supposed to run the make command from within the adb_usb directory. This directory contains config.h, keymap.c, led.c, Makefile, matrix.c, and README.md. When I do that though, I get the following:

The system cannot find the path specified.
The system cannot find the path specified.
ECHO is off.
-------- begin --------
Process_begin: CreateProcess(NULL, avr-gcc --version, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [gccversion] Error 2

I am smart enough to figure out there is an error... But not smart enough to figure out what the error is. Any ideas?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Fri, 21 December 2012, 20:05:18
It looks like your system could not find path of your toolchain :)

What is you system? Windows, Mac or else?
Which toolchain are you using? WinAVR or Atmel Toolchan?
Did you add directory including binaries to environment variable PATH(Path)?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Sat, 22 December 2012, 11:10:00
You sir are a scholar and a gentleman. Not wanting to do things the easy way, I went and tried to use just gcc make. It evidently didn't have everything I needed. I then got WinAVR And that worked perfectly. Thank you!

Now... I am able to get input from the keyboard, but it seems a little slow, meaning when I type words with a repeating letter, it only registers one of them. Any tips on getting that changed?

I do have some more work to soon my wiring. For now it has a USB connected through the hole that the ADB connected used to be located at, directly to the Teeensy USB port. I had planned on putting a USB-B port where the ADB port was, but need to redo my first wiring attempt.

Another question... Do I need to keep the original controller in its connector? That seems like a good place to hot-glue my Teensy, but it is too tall with that chip in there.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Sun, 23 December 2012, 07:11:07
Current polling rate seems to be too slow to catch ADB signal in case of high speed typing. I'll work on this problem later.

From first post.
Quote
WARNING
ADB-USB converter misses keystrokes
Currently my ADB converter has this unsolved issue: https://github.com/tmk/tmk_keyboard/issues/14
One of work around is using old repository commit:33d58c2b5647623d2b.

AppleIIGS keyboard and M0116 suffer severely from this issue, while Extended keyboards M0115 and M3501 doesn't seem like so bad. Though it may depend on your type speed. In my speed 50-60wpm with Extended keyboard I don't feel big problem.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Sun, 23 December 2012, 09:22:46
Once again, I am an idiot. I can't tell you how many times I read through this thead. Didn't make the connection. I will try the listed commit. Thanks again for the help and patiently answering the numerous stuid questions.

I did get the keys and board cleaned up. Looks nice :)
Just need to retr0bright the space bar, and it should be good. 
Title: Re: ADB to USB keyboard converter for Teensy
Post by: Snipeye on Tue, 25 December 2012, 23:40:05
I got an Apple Extended Keyboard (I) for christmas - I've been working all day to clean it - alcohol q-tips down under the keys, ran the keys themselves through the dishwasher (worked wonders) and I struggled valiantly with getting a good enough version of avr-gcc to compile the teensy hex - finally FINALLY got that just barely - and now I'm having a couple issues with the keymap.  I'm trying to map it so there's a right "command" key, but that doesn't show up in the keymap file, and when I try to add it in, the make command gets mad at me for trying to pass 105 arguments into the keymap macro instead of the requisite 104.  Help?\\


EDIT:  I messed around with the code a little more, and it's ALMOST working right - I still can't get it to register differing commands for left and right command (apple) and both left and right control are mapped to left control only, and my right alt/option isn't working at all.  Are there options I need to change around to get those working right?  I'll post my current keymap.h, and I also had to change a single line of code in my keycode.h to get right-command mapped to command rather than control.  here's the line I changed there:

Code: [Select]
#define IS_MOD(code)             (KC_LCTRL     <= (code) && (code) <= KC_RCTRL
I changed that "KC_RGUI" to the "RCTRL" you see at the end of the line now.  Wouldn't compile if I just deleted the line.

As for my keymap.h,:

Code: [Select]
/*
Copyright 2011 Jun Wako <wakojun@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
 * Keymap for ADB keyboard
 */
#include <stdint.h>
#include <stdbool.h>
#include <avr/pgmspace.h>
#include "usb_keyboard.h"
#include "keycode.h"
#include "print.h"
#include "debug.h"
#include "util.h"
#include "keymap.h"


#define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)]))

// Convert physical keyboard layout to matrix array.
// This is a macro to define keymap easily in keyboard layout form.
/* Apple Extended Keyboard */
#define KEYMAP( \
    K35,  K7A,K78,K63,K76, K60,K61,K62,K64, K65,K6D,K67,K6F, K69,K6B,K71,              K7F, \
    K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74,  K47,K51,K4B,K43, \
    K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K75,K77,K79,  K59,K5B,K5C,K4E, \
    K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,    K24,               K56,K57,K58,K45, \
    K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,        K7B,     K3E,      K53,K54,K55,     \
    K36,K3A,K37,        K31,                K80,K7C,K7D,     K3B,K3D,K3C,  K52,    K41,K4C  \
) { \
    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
    { KC_##K08, KC_##K09, KC_NO,    KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \
    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
    { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \
    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
    { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \
    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_NO,    KC_##K35, KC_##K36, KC_##K37 }, \
    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO    }, \
    { KC_NO,    KC_##K41, KC_NO,    KC_##K43, KC_NO,    KC_##K45, KC_NO,    KC_##K47 }, \
    { KC_NO,    KC_NO,    KC_NO,    KC_##K4B, KC_##K4C, KC_NO,    KC_##K4E, KC_NO    }, \
    { KC_NO,    KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
    { KC_##K58, KC_##K59, KC_NO,    KC_##K5B, KC_##K5C, KC_NO,    KC_NO,    KC_NO    }, \
    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_NO,    KC_##K67 }, \
    { KC_NO,    KC_##K69, KC_NO,    KC_##K6B, KC_NO,    KC_##K6D, KC_NO,    KC_##K6F }, \
    { KC_NO,    KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
    { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K80, KC_##K7F }  \
}


// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
static const uint8_t PROGMEM fn_layer[] = {
    0,              // Fn0
    0,              // Fn1
    0,              // Fn2
    0,              // Fn3
    0,              // Fn4
    0,              // Fn5
    0,              // Fn6
    0               // Fn7
};

// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = {
    KC_NO,          // Fn0
    KC_NO,          // Fn1
    KC_NO,          // Fn2
    KC_NO,          // Fn3
    KC_NO,          // Fn4
    KC_NO,          // Fn5
    KC_NO,          // Fn6
    KC_NO           // Fn7
};

static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Default Layer: plain keymap
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |Pwr|
     * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  =|  /|  *|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \| |Del|End|PgD| |  7|  8|  9|  -|
     * |-----------------------------------------------------------| `-----------' |---------------|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return  |               |  4|  5|  6|  +|
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
     * |Ctrl |Gui |Alt |         Space           |     |    |      | |Lef|Dow|Rig| |      0|  .|   |
     * `-----------------------------------------------------------' `-----------' `---------------'
     */
    KEYMAP(
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   PWR,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
    LCTL,LALT,LGUI,          SPC,                          RALT,RGUI,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),
};


uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
    return KEYCODE(layer, row, col);
}

uint8_t keymap_fn_layer(uint8_t index)
{
    return pgm_read_byte(&fn_layer[index]);
}

uint8_t keymap_fn_keycode(uint8_t index)
{
    return pgm_read_byte(&fn_keycode[index]);
}

So I've not changed much around.  Am I clear on what I need help with and what's not working?  I feel like my post is a bit jumbled.  Thanks!
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 26 December 2012, 03:31:35
ADB has no distinct keycode for right command key, so you can't map different key to it.
Right command key always behave as same as left one.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: Snipeye on Wed, 26 December 2012, 12:16:54
I've been needing the right control/Alt/etc. keys for Linux programs which give these special meanings. I read in the ADB tech note (untold story) that the keyboard's handler ID can be changed from 2 to 3, causing it give distinct codes for left and right modifiers. This would be a really useful fix.

...well, that went smoothly on the first try. I just implemented the above on the latest source. I've atteched the patch (I'm not familiar enough with git to submit it myself, sorry). Currently it only sets the keyboard device handler to 3 on USB init, so if you unplug the ADB and plug it back into the keyboard, right modifiers won't be differentiated until you unplug and plug ADB back in. I broke out an adb_host_listen() function since it has the same guts as used by the led-setting function and my device handler setting in matrix_init().

Note that even with this, the Extended Keyboard II (and maybe all the others) still don't differentiate between left and right Command (Alt), so that both are reported as the left one. :(


That post lead me to believe that ADB, if the handler ID was 3, could differentiate between left and right command/control/alt.  Of course, I don't know if that's the case with the hardware on the AEK, care to enlighten?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 26 December 2012, 12:34:58
You can distinguish between right and left of shift/control/option(alt) with ID3 method. But not command(apple) key.
Both AEK1 and AEK2 doesn't have distinct code for right command key. I don't know why.
I'm not 100% sure, but I believe it doesn't exist a way to distinguish right command key on ADB keyboard.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: Snipeye on Wed, 26 December 2012, 12:50:03
Alright, well that clears things up - thank you very much!  Could you help me get the code set up for distinguishing between right and left control and alt, at least, and then command can both be left?  The keymap default included in the adb_usb folder doesn't appear to have any sort of command key on the right.... and I don't know if I need to change anything to set up the handler as ID 3 instead of default.  Thanks!
Title: Re: ADB to USB keyboard converter for Teensy
Post by: tufty on Wed, 26 December 2012, 13:25:17
Well, you'll need to send a "Listen Register 3" to the keyboard telling it to go to handler 3, at which point you get  separate left and right modifiers.  They are as follows:

Left Control : 0x36
Command : 0x37
Left Shift: 0x38
Left Option : 0x3A
Right Shift : 0x7B
Right Option : 0x7C
Right Control : 0x7D

The message you need to send is, if I've got this right:

0x2B 0x62 0x03

In theory you should do this as part of bus deambiguation, but as we're talking about a specific situation with only one device at its default address, we can explicitly code in the address (the 2s in the first two bytes)

You'll then need to modify keymap.c in order to graft in the keycodes above and what you want to map them to.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: concept10 on Wed, 26 December 2012, 14:43:25
Hello All,

I recently found a stash and bought 2 of the Apple Extended Keyboards (Model 2) and instead of purchasing the Griffin iMate and running into this thread, I decided to try and adapt this project to an Arduino UNO board (ATmega328p) that I haven't found a purpose for yet.

I have attempted to compile the project with no luck so far.  Anyone have any suggestions or advice on what I need to change?  My current thought is to loose the pjrc usb library and use the lufa or v-usb library instead.  At this point, I am not sure of the proper modifications I need to make.  Any help welcome.

Thanks.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: Snipeye on Wed, 26 December 2012, 15:46:56
Well, you'll need to send a "Listen Register 3" to the keyboard telling it to go to handler 3, at which point you get  separate left and right modifiers.  They are as follows:

Left Control : 0x36
Command : 0x37
Left Shift: 0x38
Left Option : 0x3A
Right Shift : 0x7B
Right Option : 0x7C
Right Control : 0x7D

The message you need to send is, if I've got this right:

0x2B 0x62 0x03

In theory you should do this as part of bus deambiguation, but as we're talking about a specific situation with only one device at its default address, we can explicitly code in the address (the 2s in the first two bytes)

You'll then need to modify keymap.c in order to graft in the keycodes above and what you want to map them to.

... K.  I'm not that advanced.  Haha, I appreciate the effort, mind dumbing it down for me a little bit?  What/where do I need to change?  And as for the separate keys - I've grafted them in, I believe correctly, but I don't know how to apply the message you said I needed to send in order to initiate with ID of 3....

In adb.c, I've found something like what you're talking about - I've found a command that's already there, "adb_host_listen(0x2B,0x02,0x03)" and the comments say that's telling the keyboard to listen on register 3.  Then later (in adb_host_kbd_recv(void)) a byte (0x2c) is sent, telling the keyboard to talk on register 0.  Changing that to 0x2f to tell it to talk on register 3 screwed things up, so I changed that back.

Basically, it looks like it's already being told to listen on register 3, and it's still not differentiating between left or right control, alt, or shift.  Hmm... am I doing something wrong?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: Soarer on Wed, 26 December 2012, 16:11:14
I'm just guessing, but try changing:
Code: [Select]
adb_host_listen(0x2B,0x02,0x03)
to:
Code: [Select]
adb_host_listen(0x2B,0x62,0x03)
BTW, 'talk' and 'listen' are just Woz-speak for 'read' and 'write', so sending e.g. a 'listen on register 3' command means that the keyboard will write the next 2 bytes sent to it into register 3.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: Snipeye on Wed, 26 December 2012, 16:42:37
That doesn't seem to work - tried it, no difference.  But the fact that there's no difference when I send a binary "1100010" rather than a "10" - no error or ANYTHING - means that perhaps the command isn't doing anything at all.  I'm pretty sure the '10' is what it's looking for, as 11 is talk.  Reading some more on how it's initialized right now, but doubt it'll help much.  Any other suggestions?


OK, I read the ADB spec more and looked at the adb.c protocol some more, and found some dependencies - primarily in the "adb_host_listen" and "attention" commands.  The protocol is default set up to send "0x2B,0x02,0x03" through adb_host_listen on initiation.  However, the adb protocol states the first 4 bits of the upper byte are reserved - should be "0000" - then the next 4 bits are the device address - a keyboard defaults to "2", which is (correct me if I'm wrong) "0010".  The next two, 4-bit chunks should be the command (listen, "0010") and the register, ("0011").  So, the "0x2B" should in fact be 0x02, right?  I tried changing it, and it's had no effect thus far.

In the "adb_host_listen" function, it calls "attention()" - the adb spec for that says an attention signal is 776-824 us low, and after the attention signal should come a 70us sync signal, high.  The attention() function was delaying for 700us, then placing a 1-bit (35us low, 65 high) - effectively providing 735us low, which is not a valid length for the attention signal, then 65us high, which is probably long enough.  I changed the attention function to bring the data line low for 800us, then high for 70, and then whatever functions take place after that should work properly.  I have seen no change in effect on the keyboard functionality.

Regardless, I don't think the attention signal was getting through, as the adb_host_listen command that occurs in the adb_host_init doesn't appear to DO anything -- commenting it out has no effect on the functionality of the keyboard whatsoever.  However, I'm unable to make it work - my modified attention() function doesn't appear to work any better.  Does anybody have the right/left control/alt/shift differentiated on an AEKv1?

Please, keep throwing suggestions my way.  I'm learning and becoming a little more capable.  :P
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 26 December 2012, 20:19:51
Snipeye,
Handler ID 3 is enabled by default now with patch from blargg. https://github.com/tmk/tmk_keyboard/commit/cf1eb8fbc6789776d3b3457dd5cf4ed84815e8b3
And keymap.c already has distinct keycodes for right and left shift/control/gui(apple or windows key). With default keymap Alt is mapped to command key.
What is your problem then?

Concept10,
While dealing with V-USB to handle ADB signal is very difficult, at least I tried this and failed to make it work. V-USB consumes quite a bit of time to handle USB.
Instead, I think you can load LUFA stack into ATMega16u2 and handle ADB with ATMega328p, then let two controllers communicate with UART line.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 26 December 2012, 20:43:06
Which spec are you referring? ADB spec has some ancient source but each and all doesn't explain protocol enough :)
Yes, my code is not completely conforming with spec to keep code simple for reference purpose.

I mainly use these as spec.
ADB - The Untold Story: Space Aliens Ate My Mouse
    http://developer.apple.com/legacy/mac/library/#technotes/hw/hw_01.html
Apple IIgs Hardware Reference Second Edition [p80(Chapter6 p121)]
    ftp://ftp.apple.asimov.net/pub/apple_II/documentation/Apple%20IIgs%20Hardware%20Reference.pdf



OK, I read the ADB spec more and looked at the adb.c protocol some more, and found some dependencies - primarily in the "adb_host_listen" and "attention" commands.  The protocol is default set up to send "0x2B,0x02,0x03" through adb_host_listen on initiation.  However, the adb protocol states the first 4 bits of the upper byte are reserved - should be "0000" - then the next 4 bits are the device address - a keyboard defaults to "2", which is (correct me if I'm wrong) "0010".  The next two, 4-bit chunks should be the command (listen, "0010") and the register, ("0011").  So, the "0x2B" should in fact be 0x02, right?  I tried changing it, and it's had no effect thus far.

In the "adb_host_listen" function, it calls "attention()" - the adb spec for that says an attention signal is 776-824 us low, and after the attention signal should come a 70us sync signal, high.  The attention() function was delaying for 700us, then placing a 1-bit (35us low, 65 high) - effectively providing 735us low, which is not a valid length for the attention signal, then 65us high, which is probably long enough.  I changed the attention function to bring the data line low for 800us, then high for 70, and then whatever functions take place after that should work properly.  I have seen no change in effect on the keyboard functionality.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: Snipeye on Wed, 26 December 2012, 21:32:02
I was referring to this:

http://www.eetasia.com/ARTICLES/2000JUN/2000JUN02_CT_AN8.PDF

But upon closer inspection, it appears that my right and left control/alt/shift ARE, in fact, being differentiated.  I'm in OSX, was going to the "keyboard viewer" to determine what keys were being pressed, and it was showing both left and right control/alt/shift as only 1 - but that is not, in fact, the case.  Any suggestions for applications to determine what keys are being pressed with a little more accuracy?  It's working perfectly and is ready to go for my project (if I remember I'll post a link when I'm finished, but I'm installing a USB hub and giving it a nice paintjob.  Should be pretty cool.)  Thank you all for all the help - wouldn't have been possible without you guys.  Perhaps another dumb question - though all my keycaps are off right now (cleaning and painting) so I can't see the names of the switches, but the only LED I can get to turn on is for caps lock.  What key combos on the AEKv1 should activate the other LEDs?  Bear in mind I'm in OSX.  Thanks!
Title: Re: ADB to USB keyboard converter for Teensy
Post by: tufty on Fri, 28 December 2012, 01:25:05
IIRC, under OS9, scroll lock was F14, and numlock was shift-clear
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Mon, 07 January 2013, 09:58:32
Current polling rate seems to be too slow to catch ADB signal in case of high speed typing. I'll work on this problem later.

From first post.
Quote
WARNING
ADB-USB converter misses keystrokes
Currently my ADB converter has this unsolved issue: https://github.com/tmk/tmk_keyboard/issues/14
One of work around is using old repository commit:33d58c2b5647623d2b.

AppleIIGS keyboard and M0116 suffer severely from this issue, while Extended keyboards M0115 and M3501 doesn't seem like so bad. Though it may depend on your type speed. In my speed 50-60wpm with Extended keyboard I don't feel big problem.

How would I go about using that commit? I cant seem to find it up on Git.  I also scanned through the code and did not see a place to modify the polling rate
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Mon, 07 January 2013, 10:17:49
Here: https://github.com/tmk/tmk_keyboard/tree/33d58c2b5647623d2b07a210ef97a27920e5563e
No scan rate config option. Somewhere in codes takes too long :) you have to tune code.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: wogdog on Mon, 07 January 2013, 10:41:29
Works perfectly now!! Thanks!! Both for your patience and knowledge. This forum is great! I have learned a lot already from the short time I have been here, and look forward to learning more. I have found some additional mechanical keyboards around the building that I have been able to 'acquire'. Now I just need to get them to USB also, and I am good to go.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Tue, 09 April 2013, 01:08:36
Fixed missing key stoke problem finally. https://github.com/tmk/tmk_keyboard/issues/14
Title: Re: ADB to USB keyboard converter for Teensy
Post by: ryemac3 on Wed, 10 April 2013, 12:34:14
I have a few bare bones Arduino boards that I made with some Atmega328s.

(http://kevinrye.net/files/barebonesarduinov2_0064.jpg)

They would be perfect for this project. Does anyone know how to port this code over to Arduino?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 10 April 2013, 17:25:28
You need V-USB to support USB  on ATmega328 but V-USB and my ADB code are incompatible unfortunately. My ADB code use busy wait polling method to implement the protocol and V-USB interrupts and screw up ADB code with up to 50us block, IIRC. My code needs hardware engine on USB AVR like ATmega32U4 or AT90USB1286 instead of software V-USB at the moment.

To port this converter into ATmega328 I think you have to rewrite ADB code with timer interrupt or other method at least, but I'm not sure.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: tufty on Thu, 11 April 2013, 00:35:43
Fixed missing key stoke problem finally. https://github.com/tmk/tmk_keyboard/issues/14

Hey hasu.

That's fantastic, finally makes my M0116 work properly without missing keys.  I just put a pull request up - feel free to merge my M0116 layout into your master.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Fri, 12 April 2013, 00:11:16
tufty,
merged your support for eject key and M0116 layout. Thanks.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: oryhara on Thu, 06 June 2013, 20:32:01
What would one need to do to make this work with teensy 3.0?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Thu, 06 June 2013, 21:44:05
Physically, some components for 5-3.3 voltage shifter.
To handle ADB 5V signal Teensy 3.0 will need this because its I/O ports are not 5V tolerant, I think.

And knowledge of Cortex architecture and C language. That's all.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: oxalyn on Tue, 11 June 2013, 23:59:21
This is probably my inexperience, but:

Is anybody compiling this on OS X 10.7.5 using the CrossPack avr-gcc package? No matter which version of CrossPack I install, I get a number of compiler errors when compiling:

...

Assembling: ../../common/xprintf.S
avr-gcc -c -mmcu=atmega32u4        -x assembler-with-cpp -DF_CPU=16000000 -DBOOTLOADER_SIZE=4096 -DPROTOCOL_PJRC -DNO_PRINT -DNO_DEBUG -Wa,-adhlns=obj_adb_usb/common/xprintf.lst,-gstabs,--listing-cont-lines=100 -I. -I../.. -I../../protocol/pjrc -I../../protocol -I../../common -include config.h  ../../common/xprintf.S -o obj_adb_usb/common/xprintf.o
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h: Assembler messages:
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:121: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:122: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:123: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:124: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:125: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:126: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:128: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:129: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:142: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:147: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:159: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:164: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:169: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:174: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:179: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:184: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:192: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:199: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:213: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:218: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:223: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:228: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:233: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:238: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:246: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:253: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:273: Error: unknown opcode `typedef'
/opt/local/lib/gcc/avr/4.7.0/../../../../avr/include/stdint.h:278: Error: unknown opcode `typedef'
../../protocol/adb.h:56: Error: unknown opcode `void'
../../protocol/adb.h:57: Error: unknown opcode `_bool'
../../protocol/adb.h:58: Error: unknown opcode `uint16_t'
../../protocol/adb.h:59: Error: unknown opcode `void'
../../protocol/adb.h:60: Error: unknown opcode `void'
../../common/matrix.h:26: Error: unknown opcode `typedef'
../../common/matrix.h:39: Error: unknown opcode `uint8_t'
../../common/matrix.h:41: Error: unknown opcode `uint8_t'
../../common/matrix.h:43: Error: unknown opcode `void'
../../common/matrix.h:45: Error: unknown opcode `uint8_t'
../../common/matrix.h:47: Error: unknown opcode `_bool'
../../common/matrix.h:49: Error: unknown opcode `_bool'
../../common/matrix.h:51: Error: unknown opcode `matrix_row'
../../common/matrix.h:53: Error: unknown opcode `void'
make: *** [obj_adb_usb/common/xprintf.o] Error 1

I appreciate any help provided.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Wed, 12 June 2013, 01:39:59
try this patch.

Code: [Select]
/* key combination for command */
+#ifndef __ASSEMBLER__
 #include "adb.h"
 #include "matrix.h"
 #define IS_COMMAND() ( \
     matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \
 )
+#endif
Title: Re: ADB to USB keyboard converter for Teensy
Post by: oxalyn on Wed, 12 June 2013, 10:30:11
Thank you, that did the trick!
Title: Re: ADB to USB keyboard converter for Teensy
Post by: oxalyn on Thu, 13 June 2013, 23:23:18
OK, I got everything working and wired up. Of note, the default 'keymap.c' file has the Option and Command keys swapped. I fiddled with it until it worked:

Code: [Select]
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_EXTENDED_US(
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   PWR,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PEQL,PSLS,PAST,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
    LCTL,LALT,LGUI,          SPC,                               RALT,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),
};

On the last line, LALT and LGUI are swapped in the default file, and the RALT is a RGUI in the default file.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: oxalyn on Fri, 14 June 2013, 00:19:07
Also, no matter what I do, I can't get the Power key to work. I wonder if it's due to the patch you gave me above, which may not be defining IF_COMMAND()?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Fri, 14 June 2013, 00:53:01
I think it is not due to that patch.

Power key is used as 'Magic key' to run Magic commands. IS_COMMAND() macro defines 'Magic key' and which cannot be used as normal key for typing.
To use Power key as normal key define IS_COMMAND() with other key or comment out COMMAND_ENABLE in Makfile.
https://github.com/tmk/tmk_keyboard#magic-comannds
Title: Re: ADB to USB keyboard converter for Teensy
Post by: oxalyn on Sat, 15 June 2013, 00:28:27
Hmm. I compiled with both COMMAND_ENABLE = yes and #COMMAND_ENABLE = yes, and got identical results: the system acts as though nothing had been pressed when I hit the power button. I even got the same results with a different keyboard.

Here is the relevant section of MAKEFILE:

Code: [Select]
# Build Options
#   comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
#MOUSEKEY_ENABLE = yes # Mouse keys(+5000)
#EXTRAKEY_ENABLE = yes # Audio control and System control(+600)
#CONSOLE_ENABLE = yes    # Console for debug
#COMMAND_ENABLE = yes    # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover(+500)

I did spend all day using this system, and other than the power key it performs flawlessly. I'm a speed typist, and it keeps up quite well.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: hasu on Sat, 15 June 2013, 05:42:09
Hmm. I compiled with both COMMAND_ENABLE = yes and #COMMAND_ENABLE = yes, and got identical results: the system acts as though nothing had been pressed when I hit the power button. I even got the same results with a different keyboard.

Hmm, 'make -f ... clean' may be needed before 'make -f ...' when you change config.h. Try 'make clean'.
If this makes no difference let me know again. I'll look into my code more.

EDIT: Or maybe your system doesn't recognize 'System Power' keycode(PWR). you can try another keycode.
For example use 'A' instead of 'PWR' in your keymap, you will see 'a' when pressing Power key.

Quote
I did spend all day using this system, and other than the power key it performs flawlessly. I'm a speed typist, and it keeps up quite well.

Great. It is exactly what I want to hear!
Post here if you come across any problem.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 18 June 2013, 19:24:37
My new DIY ADB converter! I did this instead of buying extra Teensy's from PJRC.

(http://i.imgur.com/Zl2pecLm.jpg)

http://deskthority.net/workshop-f7/teensy-2-0-alternatives-atmega32u4-t4253-30.html#p112185
Title: Re: ADB to USB keyboard converter
Post by: TheFlyingRaccoon on Tue, 18 June 2013, 20:59:07
My new DIY ADB converter! I did this instead of buying extra Teensy's from PJRC.

Show Image
(http://i.imgur.com/Zl2pecLm.jpg)


http://deskthority.net/workshop-f7/teensy-2-0-alternatives-atmega32u4-t4253-30.html#p112185

This looks awesome! What was the total cost of materials?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 19 June 2013, 02:22:05
Around $10. Not so cheap.

PCB $1.5
MCU $5
Connector $2
Xtal $0.5
R,C,etc $1.5
Title: Re: ADB to USB keyboard converter
Post by: Captain Hammer on Mon, 15 July 2013, 01:22:45
I was having the same problem as oxalyn (10.8 with CrossPack), but after trying Hasu's suggestion, I now get these errors:

In file included from <command-line>:0:0:
./config.h:62:1: error: expected identifier or '(' before '+' token
./config.h:62:1: error: stray '#' in program
In file included from /usr/local/CrossPack-AVR-20130212/lib/gcc/avr/4.6.2/include/stdint.h:3:0,
                 from ../../protocol/adb.h:41,
                 from ./config.h:63,
                 from <command-line>:0:
/usr/local/CrossPack-AVR-20130212/lib/gcc/avr/4.6.2/../../../../avr/include/stdint.h:159:1: error: unknown type name 'int8_t'
/usr/local/CrossPack-AVR-20130212/lib/gcc/avr/4.6.2/../../../../avr/include/stdint.h:213:1: error: unknown type name 'int8_t'
In file included from <command-line>:0:0:
./config.h:68:1: error: expected identifier or '(' before '+' token
./config.h:68:1: error: stray '#' in program
make: *** [obj_adb_usb/keymap.o] Error 1

These problems also appeared with attempting to compile on Ubuntu with gcc-avr and libc-avr.
Any help would be greatly appreciated.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 15 July 2013, 09:28:46
Hmm, this patch works for me.
http://geekhack.org/index.php?topic=14290.msg926590#msg926590

It seems your failed to patch. You copied the line from the patch including '+'? You don't need '+'.
Quote
./config.h:68:1: error: expected identifier or '(' before '+' token

Actually the source should look like this. Preceding '+' is not needed to copy.
Quote
/* key combination for command */
#ifndef __ASSEMBLER__
#include "adb.h"
#include "matrix.h"
#define IS_COMMAND() ( \
    matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \
)
#endif
Title: Re: ADB to USB keyboard converter
Post by: arfink on Sun, 29 September 2013, 16:16:18
I'm going to try this out on my IIgs keyboard. This looks very promising! I'll report back how it goes when I'm done.
Title: Re: ADB to USB keyboard converter
Post by: arfink on Thu, 03 October 2013, 18:20:31
Quick question: the first page of the discussion here mentioned Data should be connected to PF0, while the Github indicates the default is D0. Which is it?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 03 October 2013, 18:29:08
Use PD0 now.
Pin usage changed recently.
Title: Re: ADB to USB keyboard converter
Post by: arfink on Thu, 03 October 2013, 20:54:40
Well, I got everything compiled from the newest version on Git, and it seems that the IIgs keyboard is routinely dropping key strokes, especially double letters and sometimes even spaces.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 04 October 2013, 00:22:45
hmm, I also could confrm IIgs(Alps made in Japan) and M0116  drop key stroke sometime.

I found problems:
1) These keyboards are worse than normal 2KRO keyboard. They are *always* blocked when you press just two keys. This may be annoying if you are fast typer.

2) Pressing  same key sucessively tens to lose the stroke. Like I type 'jjj' and see 'jj' sometime.
But I'm not sure what causes this, switch defect, keyboard controller or my converter? Though I think my converter likely sitll has some bugs. I'll need to look into with scope or logic analyzer and reading the spec fully again. 

I'd like to see how iMate works with these boards, but I have none of that unfortunately. And I don't think I have time to debug this problem further soon.

Looks like these problems doesn't occur or seldom on Apple Extended keyboards M0115 and M3501.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Fri, 04 October 2013, 01:00:11
I'll be blunt - The key dropping is down to your converter, hasu. Connected through an iMate, my M0116 doesn't drop keys at all, and I'm a fast typist.

I believe the keyboards themselves only give 2 key rollover for normal alphabetic keys, and give full rollover for the control keys.  At least, that's what I'm seeing through the iMate, although it may well be that the iMate doesn't handle anything more than 2kro as well.  Not a problem for me, but I don't game...

Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 04 October 2013, 01:19:58
tufty, interesting. Then my code sucks somewhere and misses signal.
I'll try to rewrite code from scratch when I got time for the curiousity.
Thanks.

This will not be fixed anytime soon,
For now I recommend iMate for daily usage.
Title: Re: ADB to USB keyboard converter
Post by: arfink on Fri, 04 October 2013, 11:30:43
That's fine, for daily usage I'm just using an old IBM XT keyboard. So the IIgs is just a curiosity. I do know that when I used the IIgs keyboard with the IIgs I can hammer away on it as fast as I want, and it never misses a beat. So yeah, I think it's the converter.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 06 October 2013, 21:16:18
Hey, I've found myself doing more AVR programming lately and I realized that I now have the skills to write this ADB converter using interrupt-driven code that uses a hardware timer to measure durations. I've been using simavr which would be perfect for simulating ADB and testing the code in a sandbox. I now have an oscilloscope as well (with digital capture) so can debug any hardware issues. Just want to be sure that nobody else is working on this rewrite already.

I've since found a Belkin USB-ADB converter ($5 at a thrift shop) and it indeed works better than ours here, so it'd be nice to improve the one here. The Belkin one is apparently made by PI Engineering, the same people who make a Y-mouse PS2-USB keyboard/mouse adapter with similar esc-<letter> control codes.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 06 October 2013, 22:13:15
Great. I didn't start to fix yet.
If the community can get access to your reliable converter it is awsome.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Mon, 07 October 2013, 00:12:54
I'm studying the current code and it seems that the USB driver is bit-banged, and can't handle having interrupts disabled for more than a very short time (for obvious reasons). It's also almost a certainty that it keeps interrupts disabled when it's running. I assumed that this was meant to run on AVR devices with USB hardware, but maybe this project (tmk_keyboard) is meant to run on almost any AVR device.

Given the constraints of v-usb, it might still be possible to use some hardware assist for ADB. I'm thinking input capture to time ADB input, and perhaps PWM in a one-shot mode to time output bits. This is assuming that USB doesn't tie things up for more than 100us or so. I know almost nothing about USB so this may be overly optimistic. I know the ADB protocol has timeout handling, but if we timed out reading from the keyboard, it probably won't send the key press events again.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 07 October 2013, 02:36:09
Some projects like keyboard controllers(under keyboards/*) and PS/2, Sun, X68 converters can run with V-USB, I think. But I don't test/use them with V-USB recently and not so eager to support it anymore.

I'm not sure but my codes use only a few interrupts of hadware USB engine(LUFA) and timer(timer.h). I think USB interrupts are not so critical so that USB tasks are almost processed with hardware and timer is also trivial. You will be able to use your interrupts and place critical sections mostly freely with LUFA stack.

It is great if the converter works with V-USB, so that we can make it from cheap MCU.
This is very challenging technically, but it may be possible as you described. IIRC V-USB blocks around 50us, not long as 100us.

But I think Atmega32u4(LUFA) is the first target to tackle.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Mon, 07 October 2013, 12:01:37
I was thinking that for V-USB, the ADB polling could be done between USB events. But you say it's not currently used so I won't waste time on that.

I looked at the timing on a scope and first off, USB transmission lasts 3us normally, sometimes as much as 15us. So it doesn't seem like it would mess up the current timing.

I'm getting bogged down trying to understand the source. On the older version I have, hid_listen never hears the device (even though keyboard works), and I'm not getting uart debug output working either.

I tried the current code but make fails:

$ cd converter/adb_usb
$ make

-------- begin --------
avr-gcc (GCC) 4.5.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


mkdir -p obj_adb_usb/protocol/pjrc
Compiling C: ../../protocol/pjrc/usb.c
avr-gcc -c -mmcu=at90usb1286       -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DPROTOCOL_PJRC -DNO_PRINT -DNO_DEBUG -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_adb_usb/protocol/pjrc/usb.lst -I. -I../.. -I../../protocol/pjrc -I../../protocol -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_adb_usb_protocol_pjrc_usb.o.d  ../../protocol/pjrc/usb.c -o obj_adb_usb/protocol/pjrc/usb.o
../../protocol/pjrc/usb.c: In function ‘__vector_11’:
../../protocol/pjrc/usb.c:892:15: error: ‘keyboard_report’ undeclared (first use in this function)
../../protocol/pjrc/usb.c:892:15: note: each undeclared identifier is reported only once for each function it appears in
make: *** [obj_adb_usb/protocol/pjrc/usb.o] Error 1
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 07 October 2013, 19:26:30
It seems I broke something on PJRC stack with recent changes. Use Makefile.lufa to build.
I'd like to make LUFA default stack from now. But PJRC will be also supported for a while, I'll fix this problem later.

Build with LUFA and hit Power + h you'll get help on hid_listen.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Mon, 07 October 2013, 20:06:29
I split the core adb.c file out and made a new converter using the PJRC keyboard sources from the Teensy website. I'd like to reproduce any problems with this much simpler backend to figure whether the problem is the adb driver or all the translation going on. I noticed that neither PJRC sources on the site are as full-featured as the PJRC ones you use.

Using your full LUFA build, is there any reliable way to reproduce the problems?

EDIT: went through all my keyboards and all 5 extended ones are M3501. I have three smaller ones: two M0116 and an M0487 (IIgs keyboard). The M0487 shows issues like you mentioned with pressing the same key over and over quickly. It shows up my bare-bones tester that just runs the adb.c code and outputs over the hardware UART (so no interrupts to interfere). It doesn't occur when I poll the keyboard every 16 msec, but loses keys badly when I scan it continuously.

Polling every 1 msec causes it occasionally. Every 5 msec it's much more rare.
Title: Re: ADB to USB keyboard converter
Post by: sprit on Mon, 07 October 2013, 20:50:46
I love this post!  for a long time
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 07 October 2013, 21:35:30
EDIT: went through all my keyboards and all 5 extended ones are M3501. I have three smaller ones: two M0116 and an M0487 (IIgs keyboard). The M0487 shows issues like you mentioned with pressing the same key over and over quickly. It shows up my bare-bones tester that just runs the adb.c code and outputs over the hardware UART (so no interrupts to interfere). It doesn't occur when I poll the keyboard every 16 msec, but loses keys badly when I scan it continuously.

Polling every 1 msec causes it occasionally. Every 5 msec it's much more rare.

Wow, you are right :o
I confirmed that adding simple 5ms delay between scans make the problem gone!

Not sure about optimal value of scan rate now, but I believe you found the solution.
What's your recommendation? 16ms? I think it is fast enough even for fast typers.

It seems my code make the old controller high loaded unnecessarily...

Thanks blargg!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 07 October 2013, 22:39:04
I used 16ms delay tentativly and pushed the fix to the repository now.
With this commit it seems the problem is gone or mitigated dramatically to me.
https://github.com/tmk/tmk_keyboard/commit/e8e8f93bcf0cdc8d72d35662db5a1da4716762b8

tufty and arfink, can you try the latest source and test this fix?
Title: Re: ADB to USB keyboard converter
Post by: blargg on Mon, 07 October 2013, 23:20:59
I'll have to try this finicky keyboard on some old Macs (PowerBook 540c and PowerMac 8500) and see if it works reliably, and what the ADB poll rates are on them.

I've also rewritten adb.c somewhat to hopefully be more robust, and I plan on offering it. The approach lends itself to easy conversion to use a timer rather than delay loops, and perhaps make it fully interrupt-driven. I'm going to add ADB simulation to simavr so I can run it through some virtual stress tests.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 08 October 2013, 00:20:38
Yeah, the interrupt driven is still more reliable approach, of course. Keep us updated.
Once your code works and makes available to us it would be great.

I'm looking forward to seeing your code! And it looks simavr is very useful tool, I must try it.

Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 08 October 2013, 15:07:46
ADB polling periods
PowerBook 520c: 11.7 ms
PowerMac 8500 11.2 ms
Belkin ADB-USB adapter: 8.34 ms

Since this isn't for gaming, I'd say 11.5 ms is a good level. Clearly lower values are risky.

PowerBook 520c timings:
Attention: 800 us
bit cell time: 99 us

So the low-level timings you use are good in that regard.

I'm making progress using simavr for testing.

Another thing, I've changed my ADB code to never drive the data line high, and rely entirely on the pull-up resistor. This way there is never a risk of the AVR driving it high while the keyboard pulls it low. So init code becomes:

ADB_DDR &= ~(1<<bit);
ADB_PORT &= ~(1<<bit);

And then

static inline void data_lo( void ) { ADB_DDR |= data_mask; }
static inline void data_hi( void ) { ADB_DDR &= ~data_mask; }

This way the AVR pin behaves like a normal open-collector output: either floating or held low. We don't want to rely on the AVR's internal weak pull-up, since I think we've shown that it's too slow.

I looked at the rise time for no pull-up (hilarious), 10K (almost 10 us), and 1K (~150 ns), so a 1K pull-up is definitely desired, and seems to be roughly what the Mac uses.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 08 October 2013, 17:49:44
I wrote some code that tests the overhead of the PJRC basic USB keyboard driver's ISR, and found it to be only 5us. My Linux machine polls USB at 1kHz, so these missing 5us chunks occur every millisecond. I'm going to incorporate this into the simulator. My improved ADB code shouldn't be affected by this, though the current ADB code might be as it wasn't very tolerant of variations in timing in the simulator. With my improved code I don't think there's much need for an interrupt-based version, and the complexity could be a source of new bugs. Even if one were made, I'm not sure how to get PJRC's ISR to re-enable the timer interrupt so it can itself be interrupted by our ADB code. This doesn't rule out using a capture register when receiving from the keyboard, though.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 08 October 2013, 23:40:08
I did a preliminary input capture version for receiving from the keyboard and it does time it more accurately in the face of interrupts, but didn't perform any better than the basic rewrite I've done. And its send timing is still affected by interrupts, so it seems the only reasonable alternate version is a full interrupt-based one. But, I've been researching the LUFA USB driver and it seems that delaying interrupts isn't a problem with the hardware-based USB (https://groups.google.com/forum/#!searchin/lufa-support/interrupts/lufa-support/A4P8vgkKVLY/BEIboiUFt3AJ). Also, it apparently doesn't really support re-enabling interrupts in its interrupt handler, so an interrupt-based ADB would still get delayed. It sounds like disabling interrupts for the duration of ADB transfers would be fine for the hardware-based USB implementations. And assuming that LUFA is similar to the PJRC basic USB keyboard driver, the interrupt overhead doesn't mess up ADB timing enough to matter.

Here's the updated adb.c and the simple ADB-USB converter I wrote (with a makefile):

blargg-adb-usb-1.zip (http://blargg.8bitalley.com/avr/blargg-adb-usb-1.zip)

The above can be used as a standalone ADB-USB converter (I'm using it right now to type this).

The new ADB code doesn't disable interrupts at all. You could do that around the calls to the adb code. I think if you're going to disable them, you could do it for the entire call, not just when the keyboard is talking.


Changes
-----
* Documented header and source a little more and added some symbolic names for error values.
* Rearranged functions in source to not need prototypes.
* Merged lots of functions where there was no loss in clarity.
* Added adb_host_kbd_modifiers() to get keyboard modifiers, just because it was only 3 lines of code and it could be useful to someone in the future for a keyboard driver.
* Added config.h support for setting ADB_PORT etc.
* Eliminated constant reconfiguring of ports every time they're used. We can set them up once in init and depend on them not being messed with. If someone else is screwing with our configuration, then that needs to be fixed, rather than us constantly reconfiguring them.
* Changed to using open-collector output and relying on external 1K pull-up resistor. This is how ADB devices do it and avoids possibility of us driving bus high while keyboard pulls it low.
* Moved bit-reading code into adb_host_talk so that we can report any bit timing errors rather than ignore them.
* Optimized code to be smaller and thus have less timing overhead.


Timing fix
----------
The biggest issue was wait_data_lo() and wait_data_hi(). Their loop delayed delayed 1 us in *addition* to the loop overhead, which was 1.5 us on its own due to gcc not inlining and the data_in() reconfiguring the port every time. This could have been throwing timing off so that it was just on the edge of working, failing when timing was just slightly off.

Now the code compensates so that loop is exactly 1 us (16 cycles). This allows return value to be used to calculate how long pulse was in the bit reading code. In addition, it logs every timing value so that we can look at them later and see how well within margins it's timing things, and be sure that the times it's measuring match the times of the actual pulses coming in. It just puts them into an array for examination by the calling code.

The new bit reading code times the low and high portions, then determines whether it's a 0 or 1 based on which was longer than the other, rather than looking at absolute times. In the simulator it's show itsely very robust to wide variations in timing.

The timing is still affected slightly by the overhead between calls to wait_*, but it's only a few us.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 09 October 2013, 00:54:56
excellent work! ill look into later.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Wed, 09 October 2013, 22:05:29
Small tweak to adb.c line 48:

// gcc is very unreliable for inlining, so use macros
#define data_lo() (ADB_DDR |= data_mask)
#define data_hi() (ADB_DDR &= ~data_mask)
#define data_in() (ADB_PIN & data_mask)

Making these macros ensures that they are inlined, something hard to get GCC to do consistently. This is important for timing.

Argh, I also see that I based my adb.c on the one from December 10, 2012, rather than the current one. So you'll have to add the adb_host_listen(0x2B,0x02,0x03) call to init (though I think it should be done by the caller).
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 10 October 2013, 20:30:27
I added files from blargg's excellent wokrk into my repository, but it is not integrated and not default yet at this time. I need time to understand his work and code and after that I'll work on merging. You can use blargg's ADB protocol stack with 'make -f Makefile.blargg'.

Or his work itself is a complete ADB converter, you can just download zip archive from his post to use his ADB converter. His code is concise and skillful you may want to look through it.

Thanks.

Yeah, you are right. That command should be moved from adb.c. I'll fix it later.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Thu, 10 October 2013, 20:50:07
I'll see if I can learn how to use github to submit a patch myself. It's silly for me to make you try to grasp it all when I could do it in a few minutes.
Title: Re: ADB to USB keyboard converter
Post by: sprit on Fri, 11 October 2013, 08:00:58
For my Apple II gs ?

[attach=1]
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 11 October 2013, 23:09:11
I'll see if I can learn how to use github to submit a patch myself. It's silly for me to make you try to grasp it all when I could do it in a few minutes.

Thanks, but I know what I have to do: just replacement of my adb.c with yours.
The only problem is my ego, hehe; I'm hesitating to remove my own code from repository and trying to keep it somehow :D

I also saw your post in simavr ML, which said you dont want to be bothered by Git :) I can understand you! You've already done great job, I don't want to kill your time anymore.

sprit, I believe this converter also works on your IIgs, try it!
Title: Re: ADB to USB keyboard converter
Post by: blargg on Fri, 11 October 2013, 23:41:00
Except the locking caps lock of course. I'll get around to that in a few days.

Quote
The only problem is my ego, hehe; I'm hesitating to remove my own code from repository and trying to keep it somehow

Never fear, I was facing the same thing with me wanting my coding style there, and how I rewrote adb.c almost completely even though it wasn't actually necessary. So today I got the simulated timing tester all working, so it tests the code to be within ADB timing tolerances, and verifies that it can receive from the keyboard at timing limits. Now I'm going to *minimally* modify your original adb.c code to pass the test, so that your style etc. is preserved. It's a good exercise for me to not try to redo everything unnecessarily.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 13 October 2013, 00:02:40
OK, here's my update of the current adb.c that you can just drop in. It's the fewest changes I could make and pass my tx/rx timing tests. I've kept it in your style. It was a good exercise to not do everything my way.

http://pastebin.com/RSK622dg

* data_* macros to ensure inlining
* data_* open-collector
* wait_data_* timing fix to exactly 1 usec per iter
* wait_data_* uint16_t on both for longer timeouts
* read_bit time both levels and compare, much more robust
* read_bit error reporting wouldn't work with just bool return value, so had to move into adb_host_kbd_recv()
* stop bit handled separately since its high portion doesn't end like other bits, and can have SRQ extension
Title: Re: ADB to USB keyboard converter
Post by: tufty on Sun, 13 October 2013, 00:46:06
blargg, hasu.

Awesome work.  Not had time to mess with this, but I'll see if I can make some time this week.

Simon
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 13 October 2013, 15:21:09
I'm going to see whether I can get the ADB converter working on a USBasp 2.0 programmer, which is basically an atmega88 with zener diodes for voltage conversion to USB, a 12 MHz crystal, and connector to several pins. So I could put V-USB on it and the ADB code to have a really cheap converter (only a few dollars on eBay). I already got one of the programmers and it works great as a programmer, so the build quality is good. With a second one I can reprogram the first with the ADB and V-USB driver just by connecting the ISP cable between them.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 14 October 2013, 10:26:50
Thanks a lot. I merged your fix into repository.

OK, here's my update of the current adb.c that you can just drop in. It's the fewest changes I could make and pass my tx/rx timing tests. I've kept it in your style. It was a good exercise to not do everything my way.

http://pastebin.com/RSK622dg

* data_* macros to ensure inlining
* data_* open-collector
* wait_data_* timing fix to exactly 1 usec per iter
* wait_data_* uint16_t on both for longer timeouts
* read_bit time both levels and compare, much more robust
* read_bit error reporting wouldn't work with just bool return value, so had to move into adb_host_kbd_recv()
* stop bit handled separately since its high portion doesn't end like other bits, and can have SRQ extension


Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Tue, 29 October 2013, 11:46:32
Hi hasu, blargg and JeffreySung

First off thanks so much for making and contributing to this project - a real lifesaver when it comes to resurrecting old keyboards.

I'd like to ask what the difference is between keyboard/IIgs and converter/adb_usb? I am able to successfully make using blargg's Makefile in adb_usb, but I can't make at all with the keyboard/IIgs files. Here's my dump below.

So I'd like to know

Thanks in advance for your patience.

Code: [Select]
mkdir -p obj_IIgs_Standard
Compiling C: matrix.c
avr-gcc -c -mmcu=atmega32u4        -gdwarf-2 -DF_CPU=16000000UL -DPROTOCOL_PJRC -DMOUSEKEY_ENABLE -DEXTRAKEY_ENABLE -DNO_PRINT -DNO_DEBUG -DMOUSE_ENABLE -DVERSION=b9fe36f-dirty -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_IIgs_Standard/matrix.lst -I. -I../.. -I../../protocol/pjrc -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_IIgs_Standard_matrix.o.d  matrix.c -o obj_IIgs_Standard/matrix.o
matrix.c: In function 'matrix_scan':
matrix.c:126:10: warning: implicit declaration of function 'host_keyboard_leds' [-Wimplicit-function-declaration]
matrix.c: In function 'read_col':
matrix.c:271:11: error: 'PINA' undeclared (first use in this function)
matrix.c:271:11: note: each undeclared identifier is reported only once for each function it appears in
matrix.c: In function 'unselect_rows':
matrix.c:295:5: error: 'DDRA' undeclared (first use in this function)
matrix.c:296:5: error: 'PORTA' undeclared (first use in this function)
matrix.c: In function 'select_row':
matrix.c:354:7: error: 'DDRA' undeclared (first use in this function)
matrix.c:355:7: error: 'PORTA' undeclared (first use in this function)
matrix.c: At top level:
matrix.c:176:13: warning: 'matrix_has_ghost_in_row' is static but used in inline function 'matrix_has_ghost' which is not static [enabled by default]
make: *** [obj_IIgs_Standard/matrix.o] Error 1
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Tue, 29 October 2013, 11:51:24
Oh frick just read the IIgs readme files :(


I've got a Teensy 2.0. Am I able to use adb_usb code to drive a IIgs keyboard then or do I have to get a Teensy++ 2.0 and build for that? (My keyboard will arrive only in the following couple of days)

Thanks.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 29 October 2013, 12:47:33
'keyboard/IIgs' is for replacing controller on inside of  keyboard with Teensy2.0++ and you need to mod your keyboard, while 'converter/adb_usb' is a converter for ADB keyboards including IIgs and you can keep keyboard intact.

You can convert your IIgs into USB keyboard with adb_usb and Teensy2.0. The converter doesn't require Teensy2.0++.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Tue, 29 October 2013, 12:54:40
Thanks very much hasu. That's clearer to me now. So I just need to live with adb -> teensy -> usb (an additional attachment)

As long as I can start using the IIgs keyboard when I receive it I'm happy :)

May I ask what are the advantages of modding it with the Teensy 2.0++? Is the only benefit the more compact setup without having to have the adapter outside of the keyboard?

Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 30 October 2013, 00:43:21
I think you are right.
Not so different. The biggest difference is thier looking. jeffreysung's mod makes vintage IIgs into a complete modern USB keyboard. http://geekhack.org/index.php?topic=14290.msg304680#msg304680
As for their function what you can do with is almost same in practical usage or I can't come up with.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Wed, 30 October 2013, 00:49:27
Thanks for the clear explanation hasu.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Sat, 02 November 2013, 16:12:22
sorry to bother you - I tried making the file but when I load it onto the teensy and usef hid_listen, all I get is

Code: [Select]
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)
adb_host_kbd_recv: ERROR(FFFE)

This is even before I connect my keyboard.
Any ideas? Thanks.
Title: ADB to USB keyboard converter
Post by: hasu on Sat, 02 November 2013, 22:55:48
it looks like conection has something wrong, it has pull up resister?
edit: ah, keyboard isnt conected yet? see how it goes when conected.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Sun, 03 November 2013, 01:03:35
I have connected my keyboard to the teensy like such

adb         teensy
1 (data)      D4
2 (PSW)      D5
3 (+5v)      VCC
4 (GND)      GND

I have this in my config.h

Code: [Select]
#define ADB_PORT        PORTD
#define ADB_PIN         PIND
#define ADB_DDR         DDRD
#define ADB_DATA_BIT    4
#define ADB_PSW_BIT     5       // optional

I have not soldered a resistor yet. Should I try soldering a resistor?

Do I connect resistor from D4 (my DATA port) to VCC?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 03 November 2013, 01:12:21
right, place resister like 1k ohm between vcc and data line.

psw line isnt used by default, you dont need in fact. but it wont harm anything.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Sun, 03 November 2013, 10:47:14
hasu, I'm very happy to report that your firmware is working 100% despite my very bad soldering!  :) The resistor made it work perfectly. I was also able to map the keys correctly with your keymap.c. Very very happy with how this turned out and I can't thank you enough.

Thank you so much hasu.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Sun, 03 November 2013, 10:51:45
I would like to add that keystrokes are not dropped so far, and quick keystrokes are registered perfectly. I map ww to :w in my vim so I have to type w twice very quickly to trigger :w - no issues at all with this firmware and keyboard.

If there are any tests or observations you'd like me to do please feel free to get me to do so, I'll be more than happy to contribute back in any little way I can.

For the record I'm using

Stripped s-video cable head soldered to Teensy 2.0
adb_usb firmware by tmk/hasu
10k1k resistor from VCC to DATA line note: typo, I bought a 1k ohm resistor
Apple Desktop Bus keyboard (aka Apple IIgs keyboard)

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 03 November 2013, 12:57:13
Great to hear that the revised ADB driver is working better for a demanding typist! It was most likely merely reducing the polling frequency.

And yeah, with my revisions to the ADB driver the pull-up resistor is required. This way rather than maybe working without it with one wondering why, it flat out requires it. Also, my tests on an oscilloscope show that a 1K is the better value rather than 10K, though 10K should be fine.

Hmmm, I wonder whether we could allow the absence of a pull-up resistor by tying several input pins together, all with weak internal pull-ups. This would allow people to build this without needing resistors. Datasheet lists internal pull-up from 20k to 50k, so 5 pins connected together would yield 4k to 10k pullup.

Yes, this works. 5 pins tied together with weak pull-ups gives a ~7k pullup on my Teensy, and ADB works. Given how many unused pins there are this might save someone having to locate a resistor, and make this require nothing more than the Teensy and an s-video cable cut in half. The main drawback of this is that you have to be sure the code doesn't configure the pull-up pins as outputs.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Sun, 03 November 2013, 12:59:03
I'm definitely not a demanding typist :)

Your work is much appreciated sir. Again, I reiterate my offer to do testing with my setup if required, with what I have listed as above.

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 04 November 2013, 08:46:01
hydrospell, thanks for your reporting and offer for further testing.
happy to hear your IIgs goes well now. Let me know if you run against any problem with your keyboard.

blargg, putting together multiple I/O  is very interesting idea! It will be useful for those who don't have pull-up resistor in hand :)
Title: Re: ADB to USB keyboard converter
Post by: thegagne on Mon, 04 November 2013, 09:30:04
So I have a few ADB Apple KB, and I want to make use of one, what's the best method at this point? Is this project mature? Should I just pull the controller and put a teensy in, or convert it? Find an old iMate?
Title: Re: ADB to USB keyboard converter
Post by: tufty on Mon, 04 November 2013, 10:05:21
Hasu's converter is certainly mature enough to use, but may* still drop keys on certain models (sorry hasu, been too busy to repatch my m0116 mappings into your code, I'll try and get round to testing again soon, I promise). 

If you don't have an iMate lying about, drop the cash on a teensy and give it a go.  Worst case, you can rip out all the ADB circuitry, get handy with the soldering iron, and use either hasu's or soarer's "raw matrix" drivers for the teensy.

Simon

* it did last time I tried, but I haven't tested recently, and there's been a major rehash of the ADB code since then.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Mon, 04 November 2013, 12:12:13
Okay, took the time to do it.

I'm still getting dropped keys, particularly with "double" letters. Ironically enough, it just dropped one of the "t"s in "letters" and I had to edit. It's a *lot* better than before, but it's still an issue, at least for my M0116.

To give you an idea of the difference, I just had a shot at ztype (http://phoboslab.org/ztype/) using it.  I usually hit 45-50 wpm and 98%+ accuracy using the same keyboard hooked to an iMate, with the teensy I couldn't do any better than 27wpm and 91% accuracy.

Back to the iMate for me at the moment.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Mon, 04 November 2013, 12:37:42
I wonder whether the iMate is polling faster and thus able to handle a higher typing speed. That is, there is a sweet spot of polling rate where it's not too low for fast typists, and not too high that the keyboard drops keys. hasu, you have meta-commands, correct? You could add one to adjust the polling rate in half-msec or so increments (and print it to hid). That would solve the polling rate issue if that's the cause.

(typed on an M0116 without problem, so apparently I'm not a very fast typist)
Title: Re: ADB to USB keyboard converter
Post by: tufty on Mon, 04 November 2013, 13:04:34
I wonder whether the iMate is polling faster and thus able to handle a higher typing speed. That is, there is a sweet spot of polling rate where it's not too low for fast typists, and not too high that the keyboard drops keys. hasu, you have meta-commands, correct? You could add one to adjust the polling rate in half-msec or so increments (and print it to hid). That would solve the polling rate issue if that's the cause.

(typed on an M0116 without problem, so apparently I'm not a very fast typist)
I think it's more likely to be driving the adb protocol handler via interrupts.  IIRC the processor used on the iMate is significantly less capable than the teensy.

The teensy *is* capable of handling full-whack ADB without dropping events (check out https://code.google.com/p/waxbee/ which handles adb tablets, these drive the ADB connection harder than it should be capable of going), but it absolutely has to be doing the ADB low level protocol via interrupts to do it.  If you miss an edge, you lose a packet, simple as that. 
Title: Re: ADB to USB keyboard converter
Post by: thegagne on Mon, 04 November 2013, 17:35:00
Hasu's converter is certainly mature enough to use, but may* still drop keys on certain models (sorry hasu, been too busy to repatch my m0116 mappings into your code, I'll try and get round to testing again soon, I promise). 

If you don't have an iMate lying about, drop the cash on a teensy and give it a go.  Worst case, you can rip out all the ADB circuitry, get handy with the soldering iron, and use either hasu's or soarer's "raw matrix" drivers for the teensy.

So... how's the performance on teensy with "raw matrix" drivers? I don't think I can handle drops...
Title: Re: ADB to USB keyboard converter
Post by: blargg on Mon, 04 November 2013, 21:59:11
It's a *lot* better than before, but it's still an issue, at least for my M0116.
Can you come up with an easy-to-do test that shows the dropped keys that a non-touch-typist could reproduce? I want to make this happen on my M0116, so I can solve this problem. If I have to rewrite the ADB code to be interrupt-based and use input capture, so be it.

If you're willing, my plan is to have you try a version I've done of the ADB keyboard driver that uses PJRC's USB driver and my own glue code to adb.c, then if that doesn't work, a version with adjustable polling rate, then if that doesn't work, a rewrite using interrupts and input capture.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Tue, 05 November 2013, 00:56:19
It's a *lot* better than before, but it's still an issue, at least for my M0116.
Can you come up with an easy-to-do test that shows the dropped keys that a non-touch-typist could reproduce? I want to make this happen on my M0116, so I can solve this problem. If I have to rewrite the ADB code to be interrupt-based and use input capture, so be it.
Not really.

I would conservatively estimate my sustained rate outside "sprint typing" games at around 35wpm - better than a "hunt and peck" typist but not full touch-typing speed as a secretary would use it.  This is mainly because my technique is awful...

I see most drops on repeated letters, a case where there is significantly less finger movement between keystrokes.  Hammer action if you will, maybe 50 wpm+  My guess is that the code that processes a "finalised" keystroke is delaying things enough to make the difference.

So I suppose a qualitative test would be to go for "double keypresses", as fast as you can.

Quote
If you're willing, my plan is to have you try a version I've done of the ADB keyboard driver that uses PJRC's USB driver and my own glue code to adb.c, then if that doesn't work, a version with adjustable polling rate, then if that doesn't work, a rewrite using interrupts and input capture.
Sure thing.  My teensy is set up as follows under hasu's code:
Code: [Select]
/* ADB port setting */
#define ADB_PORT        PORTC
#define ADB_PIN         PINC
#define ADB_DDR         DDRC
#define ADB_DATA_BIT    7

So... how's the performance on teensy with "raw matrix" drivers? I don't think I can handle drops...
Not heard any complaints with either hasu's or soarer's code.  hasu's code has been used on the ergodox, which should be capable of some really fast action.

Title: Re: ADB to USB keyboard converter
Post by: CarVac on Tue, 05 November 2013, 06:49:47
So... how's the performance on teensy with "raw matrix" drivers? I don't think I can handle drops...

I type ~100-105 wpm and the teensy 2.0++ is not a problem on my reborn Thinkpad keyboard.

The only time I drop letters is when a wire pulls out of the breadboard, but that'll be cured once I finalize the analog electronics and lay it out all on a PCB.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 05 November 2013, 14:07:09
I had an idea for testing high-speed typing: wire another microcontroller up to the keyboard and have it generate automated keypresses of adjustable frequency, and adjustable synchronization to ADB polling (in case that affects dropping, so it can trigger worst-case behavior). Then find what a Mac can handle, what the Belkin adapter can handle, and what our code can handle (I don't have an iMate unfortunately and don't know how well the Belkin compares).

tufty, what OS are you using (in case that affects USB polling rate or something)? If it's Windows, I think all I've got is some version of XP on a laptop.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Tue, 05 November 2013, 14:08:48
Yeah, thrashing adb down the line at it would work, I'd guess.  Of course, you'd have to have a reliable adb protocol *generator* for that ...

I'm on OSX, BTW.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 05 November 2013, 14:32:33
Oh, I meant having the tester directly connected to the keyswitches on the M0116 keyboard itself, simulating human presses as closely as possible to the real thing. Though yours is an interesting idea as well. I kind of have done this with the simulator, feeding the ADB driver data of varying timing and verifying that it handles everything within spec. But this doesn't have the USB stuff running which is might be the culprit.

OS X, good, I have a PPC iMac running 10.5.x I could fire up for this.
Title: Re: ADB to USB keyboard converter
Post by: Soarer on Tue, 05 November 2013, 15:09:02
A little project to press keys etc. would have other uses as well, like generally analyzing a keyboard's scan rate, debounce time and method, etc.

Being able to 'press' four keys ought to be enough, using something like a 74HC4066 (http://www.nxp.com/documents/data_sheet/74HC_HCT4066.pdf) quad analogue switch. Could always use more than one of them. A teensy could drive it with a variety of patterns at different speeds. I'm thinking you'd send a command to the Teensy to start each sequence, so it could also be used to measure total lag (like namenlos did).
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 07 November 2013, 15:52:10
tufty, thanks for testing.
I don't have any missing keystroke on my ADB boards since blargg's fix was merged. And I tried your github repositry and had no drop key during short run.

I doubt it misses signal so often, ADB is totally host driven polling protocol and device doesn't send data asynchronously. Host sends talk command and waits for response from keyboard, we can know when keyboard send data and use busy-wait. I think it doesn't necessarily need interrupt based code. It is the case in particular unless busy-wait is disturbed by other interrupts.


MINOR CODE CHANGE:
I added cli() in adb.c to prevent interrupts from breaking timing of busy-wait. This would be stupidly long block like several milli seconds, but the converter has no other critical task fortunately.
https://github.com/tmk/tmk_keyboard/commit/94823030f00e9293ffc7ae4bec9611c8224d3532

Without this cli() block I don't have any minssing keys but during typing I occasionally see errors at:
https://github.com/tmk/tmk_keyboard/blob/c18c52f551545b46a28902c69730eefbdb75577d/protocol/adb.c#L142
This error seems to be no harm, though, use of cli() can suppress it.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Fri, 08 November 2013, 00:24:20
The extra USBASP arrived and I've got V-USB and the ADB code running it somewhat decently (typing this using it). I was able to use the jumper posts to get the signals for ADB. +5V from the voltage selection, and an I/O pin and GND from the clock select jumper posts, so no physical modifications to the USBASP board (other than installing the jumper posts for J2 and J3, as they don't come installed). The breadboard just has the 1K pull-up resistor. It was easier to just bring the jumper posts over there rather than try to connect my ADB socket's wires to the board directly.

(http://i.imgur.com/evwOfLB.jpg)

(http://i.imgur.com/vjZxSwr.jpg)

EDIT: nice, I got the ADB polling synchronized with the V-USB interrupts so that I can disable interrupts for the entire ADB code (send command to keyboard, receive response) and not disrupt USB. So this is allows a $3 ADB-USB converter ($6 if you need to buy a second USBASP to reprogram the first).

EDIT2: I made the key tester, though it's on the Teensy so I can't test the Teensy versions until some new atmega chips arrive to move the tester program over to. Testing the Belkin USB-ADB adapter, the maximum key press rate without dropped keys on an M0116 is 14.3 per second. With my V-USB version on a reprogrammed USBASP (atmega8 at 12 MHz), the maximum key press rate is 13.9 Hz (just a hair lower than the Belkin). Each test closes the contacts of the switch on the M0116 keyboard to cause 80 presses of the same key at the maximum rate and I check for any dropped or wrong.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sat, 09 November 2013, 12:52:36
More maximum key press rates (e.g. on M3501 with USBASP-based converter, you can press the same key 31 times per second without any being lost):
Code: [Select]
31.3Hz M3501 USBASP with reduced ADB time
29.4Hz M3501 Belkin

15.2Hz M0116 USBASP with reduced ADB time
13.9Hz M0116 USBASP
14.3Hz M0116 Belkin

10.4Hz M0487 USBASP with reduced ADB time
10.2Hz M0487 Belkin

I reduced the ADB command sending time by 25% (still within spec by 5%), which upped its maximum rate slightly.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 09 November 2013, 14:16:48
Great job again! blargg,

How did you sync with V-USB? IIRC V-USB consumes about 50us with its interrupt rouine of USB and that breaks ADB communication.
Can we get to access your code some later? Ingriguing.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Sat, 09 November 2013, 14:27:14
That's sounding extremely positive.  If you have test code, I'd be happy to give it a go.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sat, 09 November 2013, 18:09:24
Moved my key tester to another AVR and tested TMK LUFA version on the Teensy. Timings came out slightly differently for others, so I retested everything. Unfortunately I'm not finding any problem with the TMK version as compared to the Belkin and VUSB ones, so this hasn't isolated the dropped key issue.

Code: [Select]
Maximum key press rate for various keyboards and USB-ADB adapters:
29.4Hz M3501 Belkin
27.8Hz M3501 USBASP
26.3Hz M3501 TMK LUFA

15.2Hz M0116 TMK LUFA
15.2Hz M0116 USBASP
14.7Hz M0116 Belkin

14.3Hz M0487 TMK LUFA
13.5Hz M0487 Belkin
10.9Hz M0487 USBASP

Now to ready this USBASP version for posting here.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 10 November 2013, 01:44:31
OK, here's the source code and some documentation for this USBASP version of the ADB code:

adb-usb-usbasp-1.zip (http://blargg.8bitalley.com/avr/adb-usb-usbasp-1.zip)

The simplest wiring just involves cutting the extra ISP ribbon cable you'll have from the USBASP and splicing the ADB cable to it (here I'm using a header that plugs into the breadboard, since I'm not going to build a permanent cable):

(http://i.imgur.com/5L9ZYqv.jpg)

The other approach is to connect to the jumper pins on the USBASP board. This allows keeping the ADB keyboard connected to the USBASP, the USBASP plugged into USB and into the ISP cable to the reprogrammer, and the reprogrammer also plugged into USB, all at the same time. This way you can reprogram the USBASP as you debug this code, and not have to unplug anything each edit-debug cycle:

(http://i.imgur.com/GYaQ13L.jpg)

EDIT: hmmm, I just realized that the 1K series resistor on the TX pin of the USBASP board could be used as the pull-up for ADB; just tie TX and RX together and have the code keep TX high. So no extra components needed, just wires to wires when using the ISP cable cut in half.

EDIT2: It wasn't surviving a host suspend+resume. Fix: insert an adb_keyboard_poll() call in input.c line 211:

Code: [Select]
        if ( diff > (byte) min_tclocks )
        {
            prev_time = time;
            break;
        }
       
        usb_keyboard_poll(); // inserted
    }

Now that I know what happens during suspend, I should make the power key on the ADB keyboard wake the host.

EDIT3: I got host wakeup working using the ADB power key. Haven't updated code archive yet.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 10 November 2013, 16:54:25
Oh wow, I just figured out a way to make it miss a key easily: press the key down for only a split-second. This generates the key down and key up events together in the same 16-bit word returned, and at least my handler nullifies it (adds to keys held, then removes, before sending off to USB). So we need to check for this condition, and if it holds, defer the key up until after sending off the key held status to USB.

BTW, I was causing this to occur on the M3501, by far the fastest-responding of all the keyboards above. So since it occurs there, it'll be easier to make occur on others.

Seeing if I can reproduce this on the TMK LUFA version, and then come up with a fairly clean fix to that and mine.

EDIT: With this fix to the USBASP version, it can handle up to 41.7Hz key press rate without loss on an M3501. It should be able to handle 60Hz, so there's some room for improvement :)

EDIT2: Argh, this doesn't help the M0116 at all. I guess it is unable to deliver the press and release events in the same exchange.
Title: Re: ADB to USB keyboard converter
Post by: hydrospell on Sun, 10 November 2013, 22:28:48
blargg

you're operating at such a high (low in terms of programming?) level that I honestly have no idea what you're doing, except you're doing important work for us who want to use teensy with these obsolete keyboards!

FWIW I've seen no key dropping problem yet on my IIgs board. I'm a 90wpm typist on typeracer if that means anything -- are you optimizing for much higher typing speeds than this? 41.7Hz key press rate is pretty intense. (insert fingering joke)

cheers
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 10 November 2013, 23:22:01
My main goal is to have as clear an idea of what all is happening and why. This naturally leads to a cleaner design that gets better performance out of ADB.

I've done more research into the fundamental limitations of USB on the AVR MCUs and the ADB keyboards:

* V-USB has an opportunity to update the keyboard every 8ms; you either use that opportunity or wait until the next one 8ms later. No variation. Interrupt also occurs at that rate. This was consistent across Linux and an iBook running Mac OS 9.2.2 and Mac OS 10.4.11.

* Teensy USB (PJRC) can update every 2ms (only tested on Linux). Interrupt activity is minimal. Fine to disable interrupts during ADB.

* ADB keyboard internal polling rates, worst-case (keys constantly being pressed and released, ADB transaction between every poll): M3501 122Hz, M0116 57Hz. Note these are calculated based on looking at the polling signals with a scope. I hope to actually produce these key rates (half that of course) at some point to confirm these calculations.

* Internal polling rates are slightly higher when no keys are being pressed because ADB activity pauses internal polling until the transfer is done. This is why polling too quickly, especially on keyboards with lower internal polling rates, can cause them to become slow to respond, as this lowers the polling rate. In the extreme, you could cause the internal polling rate to go down to 1 Hz.

* Key pressed and released between ADB reads: M3501 generates key down and key up events for same key on next ADB read. M0116 doesn't generate anything apparently.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Mon, 11 November 2013, 20:37:28
Update to the USBASP code:

adb-usb-usbasp-2.zip (http://blargg.8bitalley.com/avr/adb-usb-usbasp-2.zip)

* Keyboard works after resume from sleep.
* Power key wakes host.
* Changed polling to 12ms (83Hz). Works better with M0116. Can still be adjusted back to 8ms (125Hz) in main.c
* Fixed dropped key when it's pressed and released in same ADB event.
* Reorganized code and made USB synchronization more robust.

I also found that the M0116 can generate simultaneous key down and key up events in one ADB transaction, so maybe this was the problem occurring there too.

I achieved 41.1Hz single key press rate on the M3501 when I set the polling period to 8ms in the USBASP code.

Now on to the Teensy code, which can send USB updates every 2ms.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 14 November 2013, 15:59:28
blargg, Thanks for your testing and further research. Incredibly great skills and jobs!

Ah, this is very likely the cuase of key drop problem. I'll fix this fault of my firmware with how your 'extra_key' does later.

I also found that the M0116 can generate simultaneous key down and key up events in one ADB transaction, so maybe this was the problem occurring there too.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Thu, 14 November 2013, 18:03:08
I've spent the last few days full-time working on this code. New versions of my USBASP and Teensy ADB converter code (renamed projects for clarity):

blargg-adb-usbasp-3.zip (http://blargg.8bitalley.com/avr/blargg-adb-usbasp-3.zip)

* Now merges extra ADB events with next where possible, making better use of limited USB update opportunities.
* Eliminated adjustable ADB polling rate, as higher rates only hurt, and improved USB synchronization made adjustable polling impossible.
* Consolidated sources.
* Using 16-bit timer1 for everything.

blargg-adb-teensy-2.zip (http://blargg.8bitalley.com/avr/blargg-adb-teensy-2.zip)

* Changed polling to 12ms (83Hz). Works better with M0116. Can still be adjusted back to 8ms (125Hz) in main.c
* Fixed dropped key when it's pressed and released in same ADB event.
* Reorganized code to be in sync with v-usb version.
* Disable interrupts for all ADB transactions.
* Send each ADB event byte as a separate USB report. This ensures things are in order and cleanly handles cases when the same key is pressed then released in a single ADB event.

More research

* The M0116 can generate key down and key up in same event word.

* Just as keyboard can report key down then key up in same event (key down in upper byte), it can report key up then key down in same event (in this case, the key up is in the upper byte).

* The keyboards buffer up key presses done faster than ADB polling. In a test on the M0116, I polled ADB only once every four seconds. Pressing a, waiting until it appeared, then pressing 123456 quickly resulted in 1234 being received over the next 16 seconds. So buffer is 4 keys. And on the M3501, it buffers 16 key presses. It even buffers the relative order of presses and releases of multiple keys, replaying everything as it occurred. So it's likely that the buffers are actually 8 and 32 events, respectively, holding key press and release events until they're read by host. I never realized how involved the driver in a keyboard could be.

* Power key presses are buffered just as others.

* Power key press generates 7F7F, and release FFFF. These special encodings are necessary to differentiate between the FF merely meaning no event (the 7F7F isn't necessary; press could be encoded like any other key).

* A 12ms ADB polling rate is ideal, even for the M3501; 8ms only improves maximum key press rate by a hair, and 4ms just makes it far worse.

Handling key press and release in same event

With the Teensy USB, the host can poll it as quickly as every 2ms, so handling key press and release in same event is trivial: just handle each as a separate USB report. In my Teensy code I always handle the two ADB bytes separately, since this preserves the order of key presses as well.

An easy way to check whether your handling of this is working is to lower your ADB polling rate to say once a second, ensuring that any key presses result in a key down and key up in the same event.

In my V-USB code, where USB polling is only 8ms, I intelligently defer and merge ADB events across polls, to keep the report rate as high as posssible. As the code shows, this is very involved and I wouldn't recommend it on the Teensy at all.

Timings

With my improved Teensy and V-USB code, I get what might be the best possible timings on the M3501 (the M0116 timings are the same as before):

Code: [Select]
41.7Hz M3501 blargg-adb-usbasp-3
38.5Hz M3501 blargg-adb-teensy-2

The M3501 polls around 122Hz, which would suggest a 61Hz maximum key press rate. But, for debouncing purposes, it might require two polls of the key released before it will register another key press. If this is true, then the maximum key press rate would be 40.7Hz.

Disabling interrupts during ADB

For the Teensy code, interrupts should be disabled for all of ADB code, including when sending. The USB hardware means that you don't need interrupts enabled constantly. I mention this hasu because I think your current ADB code only disables interrupts when receiving from the keyboard.

Continuing the search for the dropped keys problem

The latest Teensy code I posted is worthy of continued testing for the dropped keys problem. tufty, if you could give this a try on your M0116, that'd be great. I can then continue my earlier list of things to try if even this doesn't work.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Fri, 15 November 2013, 01:49:48
Hi Shay

Any chance you could put the teensy code up on github?  Doesn't compile out of the box for me (gcc 4.6.2), I'll clone on my account and see if I can patch up the errors.  Otherwise, the errors are issues with non-const stuff with __attribute__(progmem).

Code: [Select]
error: variable ‘…’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’items in error so far are device_descriptor, keyboard_hid_report_desc, config1_descriptor, string0, string1, string2 and descriptor_list.

There's also a warning on __builtin_avr_delay_cycles being implicitly defined.

Cheers

Simon
Title: Re: ADB to USB keyboard converter
Post by: blargg on Fri, 15 November 2013, 13:16:31
OK, after some bumps I've got a repo up for it (thanks for the push to figure git out):

https://github.com/gblargg/adb-usb

It was probably the -Wall and -Wextra options in the Makefile causing the problems, which I've removed from the Makefile. I'm using avr-gcc 4.5.3 which probably doesn't have as strict warnings.

I also built a .hex file for you using your settings posted earlier (PORTC, bit 7), if you want to just flash this without building the source:

blargg-adb-usb-3.hex.zip (http://blargg.8bitalley.com/temp/blargg-adb-usb-3.hex.zip)
Title: Re: ADB to USB keyboard converter
Post by: tufty on Mon, 18 November 2013, 04:06:00
Had a heavy weekend, haven't had time to play.  I'll try and get a test or two done in the next day or so.

Simon
Title: Re: ADB to USB keyboard converter
Post by: tufty on Wed, 20 November 2013, 07:45:14
Helluva week going on, but just had a try.

a - binary doesn't work.  My guess is that it's built for teensy2.0++ rather than teensy 2.0
b - code won't compile.  It mentions DDRA, which apparently the teensy 2.0 doesn't have, and tries to use _builtin_avr_delay_cycles, which I don't appear to have either.

Haven't had a chance to dig much more, maybe tonight.

Simon
Title: Re: ADB to USB keyboard converter
Post by: blargg on Wed, 20 November 2013, 12:50:58
OK, rebuild for your teensy 2.0 and pushed fixes for PORTA and __builtin_avr_delay_cycles issues (thanks for trying the code):

blargg-adb-usb-3-teensy-2.0.hex.zip (http://blargg.8bitalley.com/temp/blargg-adb-usb-3-teensy-2.0.hex.zip)

Hopefully the hex or source now works for you.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Tue, 26 November 2013, 01:42:06
So, the week's been hellish, but I just got a chance to play.

Firstly, your hex works fine on my teensy.
Secondly, as my typing without swearage will attest, there's no dropped keys so far.  This is most excellent news.  I just typed out a 400 word article at full clip, and the only issue I've seen was my slightly "sticky" space bar, and that's a mechanical issue.

You are a star.

Just noticed that the teensy's LED is glowing orange, though. Not sure if it's getting a high-freq 50% duty cycle signal across it, or if it's something to do with pin resets.  It's on PD6, IIRC

I'll probably end up hacking my "standard" M0116 layout into a fork of your code (the extended layout you have used swaps option and command on the M0116, and loses my second layer mappings), but it occurs to me that it should be possible to detect the type of keyboard at ADB startup, by looking at the original handler id the keyboard has, and swap layouts dynamically.  Useful for people building external converter boxes that need to handle both "standard" and "extended" keyboards.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 26 November 2013, 13:50:12
Great to hear! This gives us code that works, and tmk which drops keys, and among the differences a few that are the cause.

Quote
Just noticed that the teensy's LED is glowing orange, though. Not sure if it's getting a high-freq 50% duty cycle signal across it, or if it's something to do with pin resets.  It's on PD6, IIRC
Oh yeah, I have my code by default put all pins as inputs with weak pull-ups. This is the safest approach since nothing floats and anything else unexpectedly connected won't play tug-of-war with pins set as outputs. I didn't bother making PD6 an output held low. Will update the repo with that fix.

Quote
I'll probably end up hacking my "standard" M0116 layout into a fork of your code (the extended layout you have used swaps option and command on the M0116, and loses my second layer mappings),
Since you'll be doing more reflashing, I'd like to try implementing the key pressed/released in same event fix in tmk's code for you to try before you port the layouts to mine, so we can hopefully have tmk's working just as well as mine.

tmk github: "Remove tentative files from blargg"  Yay, I hated seeing my stuff clutter up the adb converter there. Simple is good :)

Quote
it should be possible to detect the type of keyboard at ADB startup, by looking at the original handler id the keyboard has, and swap layouts dynamically.  Useful for people building external converter boxes that need to handle both "standard" and "extended" keyboards.
Good idea. I'll have to see whether keyboards have some kind of model ID readable, or some low-level difference in how they respond.

Regarding reconfiguration, I've recently discovered bootloaders and the great USBaspLoader (and done a big rewrite of it which I'm releasing soon). These would be great for this kind of thing on the USBASP stick, and I remember seeing hooks for them in tmk's code even. Updating of the layouts without needing a separate progammer.

I also ordered some attiny85's and am going to put the ADB converter on to it. I think I can get it down to the attiny85, three generic small-signal diodes, a small capacitor, and a few resistors (two 1K, two 68 ohm). This will support USB self-reprogramming via avrdude, so layout customizations and bug fixes could be applied without any separate programmer.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 26 November 2013, 15:35:28
I forked tmk_keyboard and added the same-key-down-then-up-in-adb-event fix to it:

https://github.com/gblargg/tmk_keyboard

Also tested it by changing ADB polling rate to 1Hz (and tested that old code indeed lost the keys).

I see that hasu has modified the ADB code to wrap all bus operations in cli()/sei(), so it should be solid now, unless the problem is elsewhere in tmk's matrix handling, keyboard HID driver, or LUFA.

And no thanks to gcc for giving me a nice compiler bug that I spent an hour trying to realize was a compiler bug and not my bug. Confidence shaken in GCC, as it kept occuring until I convoluted my code and added volatile to get around it, though have no idea what conditions cause the compiler bug.

EDIT: I ran a test to see what differences the keyboard have via registers, for differentiating which is connected and automatically selecting the keymap:
Code: [Select]
        Talk   1    2    3
M0487 (IIgs): 0000 xFFF 6x08
M0116 (Kybd): 0000 FF00 6x01
M3501 (Ext2): 0000 FFFF 6x02

I just send a talk command (same as one for checking keys, just a different register number) and print the 16-bit result. The x nibbles were random. Register 3 is most promising. Bit 14 is service request enable, which defaults to 1, and bit 13 is exceptional event, set to 1 if not supported. So seeing a 6 there matches what the docs suggest. Bits 8-11 are the device address, which it apparently chooses at random? I was seeing values all over the place. I wonder whether my test code was somehow triggering a collision and the keyboard were choosing a random address.

The low byte is the one that is perfect for us. Docs show it's the handler ID. So that's it. IIgs crappy keyboard is 0x08, Apple Keyboard is 0x01, and Extended Keyboard II is 0x02.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Wed, 27 November 2013, 01:55:21
The device address *shouldn't* be random, it should be 2 for a keyboard.  It's wierd that you're seeing odd values.  Are you doing a full bus reset prior to checking addresses (shouldn't need to do address resolution, we only have one device)?

I'd recommend reading (and saving a copy of) Space Aliens Ate My Mouse (http://web.archive.org/web/20041012035642/http://developer.apple.com/technotes/hw/hw_01.html) if you haven't already.

Keyboard type resolution should definitely start with register 3's default handler id, and there may be some register 2 information allowing us to get more specific.

There's things that can be done with register 1 for specific keyboards, apparently - the iBook keyboard can be told to do different things through there (http://www.snark.de/mac/tpad/adbkbd.html), for example.  Chapter and verse is probably best got from the Apple's source, http://opensource.apple.com/source/AppleADBKeyboard/AppleADBKeyboard-232.0.1/AppleADBKeyboard.cpp for example.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 28 November 2013, 01:39:50
blargg,
I merged your fix of extra key. Thank you.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Thu, 28 November 2013, 01:47:39
Are you doing a full bus reset prior to checking addresses (shouldn't need to do address resolution, we only have one device)?
Currently the ADB code doesn't do any kind of reset. It'd be nice if it did an explicit reset in the beginning. It must be triggering a collision and causing this. I should get this resolved even though it's posed no problem.

Quote
I'd recommend reading (and saving a copy of) Space Aliens Ate My Mouse (http://web.archive.org/web/20041012035642/http://developer.apple.com/technotes/hw/hw_01.html) if you haven't already.

Keyboard type resolution should definitely start with register 3's default handler id, and there may be some register 2 information allowing us to get more specific.
Yeah, I scanned that and the other ADB docs (the IM chapter, IIgs ADB guide, and Microchip's app note) but I couldn't find any list of keyboard handler IDs like I found empirically.

Quote
Chapter and verse is probably best got from the Apple's source, http://opensource.apple.com/source/AppleADBKeyboard/AppleADBKeyboard-232.0.1/AppleADBKeyboard.cpp for example.
Interesting that it still has ADB vestiges that are preserved in the Darwin driver code.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Thu, 28 November 2013, 09:10:27
This might help - it's "classic" side, but there has to be a way of discovering - http://www.fenestrated.net/~macman/mirrors/Apple%20Technotes%20(As%20of%202002)/tb/tb_12.html

The adb stuff in Darwin is because, at least up to 10.4, supported machines still used it.  Keyboards and trackpads on (I think) the G4 iBook were ADB, for example.  I know my powerbook G4 is.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Fri, 13 December 2013, 22:33:45
I got some attiny85 chips and while the ADB converter works (including without an external crystal), it's not going to be any cheaper/easier than reprogramming a USBASP or some USB-equipped AVR board. USBASP is the way to go. Already-assembled with a USB connector, status LEDs, a place for a jumper, good bootloader support for self-updating, and an ISP connector and included ribbon cable to cut in half and connect the ADB cable to. This is ideal.

When I have some motivation I'll add keyboard type detection and support for different layouts for each type.
Title: Re: ADB to USB keyboard converter
Post by: multiholle on Sat, 14 December 2013, 10:25:41
I tried your Code with my Apple Extended Keyboard II and a Teensy 2.0. It worked a couple of times, but not always. Right now it's not working at all. When I enable the debug output I get the following:

Code: [Select]
Waiting for device:....
Listening:
debug enabled.
Keyboard start.

After that all three green LEDs of the keyboard are on and nothing happens if I press a key. Any ideas?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 14 December 2013, 18:27:45
blargg, nice. Can I have usbasploader and your converter with attiny85? 8KB is enough to do that?

multiholle, do you have pull-up resistor? Pic of your converter may help.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 15 December 2013, 18:59:36
hasu, oh, do you mean can USBaspLoader fit on an attiny85 with the USB-ADB converter? They should combine fine, as the ADB-USB code is only about 3000 bytes, and the bootloader under 2000. The attiny85 is so limited that the bootloaders have to jump through extra hoops. The USBasp reprogrammed is preferable. It has more I/O pins even just on the end connector than the attiny, and a crystal. I'm curious as to what advantages an attiny85 has over it.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 15 December 2013, 19:35:59
Thanks, 3KB code size is great.
Yes. I was thinking about tiny85 with USBaspLoader+ADB converter because I prefered dedicated small DIY conveter than tentative setup with cheap USBasp hardware. But I found I don't have it in my parts box and I can get mega328p at almost same cost of tiny85 at local store :) I'll go with mega328p if I make my own DIY converter. But still 8pin DIP is attractive size for DIY converter.

I see, getting USBasp hardware from ebay is the best in terms of cost effective. I'll also get some.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 15 December 2013, 20:33:48
Be sure you get the one that claims 5V/3.3V, otherwise you might get a cheaper one that doesn't expose the TX/RX pins. They might show a picture of the LC Soft one but still send the cheaper one, which is why to look for 3.3V with jumper selection claim, then it's the LC soft board. I should be receiving one from another seller and I'll report back which two so far sent me the right one.

Like you said, more capable atmega chips are about the same price as an attiny. Also the attiny series has fewer features, e.g. frozen while reflashing itself, which makes USB harder to handle without errors, no USART, only 8-bit counters. On the other hand, the tiny has a 16MHz internal RC, 20MHz maximum frequency, pin change interrupt, that only newer atmega chips seem to have.
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Sun, 22 December 2013, 05:51:48
Thank you guys so much for all the hard work. I just used the code from the master branch of tmk/tmk_keyboard, with a teensy 2.0 installed inside an M0116, and it works perfectly! (Though the default layout seems to have command and option keys switched; but that’s easy enough to reverse myself.)

Now I just need to figure out how to turn the caps lock key [I replaced the switch w/ a non-toggle version] into an Fn key, so I can use the regular number row for F keys, etc. That’s the project for tomorrow or the next day, now that the hardware part works.

Anyway, again thanks.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Sun, 22 December 2013, 10:50:23
Thank you guys so much for all the hard work. I just used the code from the master branch of tmk/tmk_keyboard, with a teensy 2.0 installed inside an M0116, and it works perfectly! (Though the default layout seems to have command and option keys switched; but that’s easy enough to reverse myself.)

Now I just need to figure out how to turn the caps lock key [I replaced the switch w/ a non-toggle version] into an Fn key, so I can use the regular number row for F keys, etc. That’s the project for tomorrow or the next day, now that the hardware part works.

Anyway, again thanks.
My fork of the tmk repository (https://github.com/tufty/tmk_keyboard) has a capslock-triggered function layer.  It's a bit behind hasu's repository, though. You should be able to do some mergery to get something that works.
Title: Re: ADB to USB keyboard converter
Post by: arfink on Wed, 15 January 2014, 20:18:19
Funny running into you again here Shay. It's been a long time. :)
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Mon, 24 March 2014, 10:41:29
Hello folks. I might be reviving a dead project, but I've been having trouble getting my Apple Keyboard II (m0487) to work. I am using an Arduino Micro, it should work. I've put the 1K resistor on the DATA Line. I am using the coiled cable, but it shouldn't matter as I have the 1k resistor. Currently, I've tried it on two Macs, but it doesn't want to work. USB Prober detects it. Everything appears to be in place, I just cannot get the keyboard to type! Any suggestions?

EDIT: I tested the keyboard on my macintosh classic, it works fine there. (ADB) so the keyboard is working.
Here is the setup:
(http://i.imgur.com/vcNED4x.jpg)

EDIT 2: Found the error:
Code: [Select]
adb_host_kbd_recv: ERROR(-17)
adb_host_kbd_recv: ERROR(-17)
adb_host_kbd_recv: ERROR(-17)
adb_host_kbd_recv: ERROR(-17)



I just have no idea what it means :P.
Title: Re: ADB to USB keyboard converter
Post by: robertarrington on Mon, 24 March 2014, 15:26:57
Hi.

I just purchased an AEKII on eBay and am interested in using this tool to convert its ADB signal to USB.

However, I accidentally purchased a Teensy 3.1 (MK20DX256). Is there any way to use this firmware with a 3.1?

Thanks
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Mon, 24 March 2014, 18:03:57
However, I accidentally purchased a Teensy 3.1 (MK20DX256). Is there any way to use this firmware with a 3.1?
No. If you’re willing to write a whole bunch of code, then some of Hasu’s code could probably be re-used. But that’s probably a multi-week effort for a competent programmer.

Just go buy a Teensy 2.0, or some similar little microcontroller (there are some tiny Arduino clones on ebay for $5/each).
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 24 March 2014, 18:49:27
128keaton,
Pull up resistor should be connected in parallel between Data line and 5V. Your resistor is located in series. I assume green line is Data line, the line should be connected to a port PD0  directly and the resister between 5V and PD0.


For later reference,

PULL UP RESISTOR:
Code: [Select]
Keyboard       Conveter
               ,------.
5V------+------|VCC   |
        |      |      |
        R      |      |
        |      |      |
Data----+------|PD0   |
               |      |
GND------------|GND   |
               `------'
R: 1K Ohm resistor

WRONG:
Code: [Select]
Keyboard       Conveter
               ,------.
5V-------------|VCC   |                                                                                                             
               |      |
               |      |
               |      |
Data----R------|PD0   |
               |      |
GND------------|GND   |
               `------'
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Mon, 24 March 2014, 19:09:37
128keaton, yeah, as Hasu says, you want to plug the resistor into your breadboard to directly connect the 'data' and +5V pins. (You don’t need to attach it to the wires coming from your ADB plug.)
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Mon, 24 March 2014, 19:52:13
128keaton, yeah, as Hasu says, you want to plug the resistor into your breadboard to directly connect the 'data' and +5V pins. (You don’t need to attach it to the wires coming from your ADB plug.)

128keaton,
Pull up resistor should be connected in parallel between Data line and 5V. Your resistor is located in series. I assume green line is Data line, the line should be connected to a port PD0  directly and the resister between 5V and PD0.


For later reference,

PULL UP RESISTOR:
Code: [Select]
Keyboard       Conveter
               ,------.
5V------+------|VCC   |
        |      |      |
        R      |      |
        |      |      |
Data----+------|PD0   |
               |      |
GND------------|GND   |
               `------'
R: 1K Ohm resistor

WRONG:
Code: [Select]
Keyboard       Conveter
               ,------.
5V-------------|VCC   |                                                                                                             
               |      |
               |      |
               |      |
Data----R------|PD0   |
               |      |
GND------------|GND   |
               `------'


128keaton, yeah, as Hasu says, you want to plug the resistor into your breadboard to directly connect the 'data' and +5V pins. (You don’t need to attach it to the wires coming from your ADB plug.)



Alright. I did that, thanks. Still no success. Hm.
(http://i.imgur.com/JkbXjfm.jpg)
Any more ideas?

Key:
Yellow = 5V
Yellow/Orange = GND
Green/Yellow = DATA before 1k
White = DATA after 1k which leads to RX/0


(http://arduino.cc/en/uploads/Main/ArduinoMicro_Pinout2.png)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 24 March 2014, 20:12:33
Error -17 means converter can't communicate with keyboard at all, check your wires again. Are you sure about connector pinouts?
Posting pics of your connector may help.
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Mon, 24 March 2014, 20:22:03
Error -17 means converter can't communicate with keyboard at all, check your wires again. Are you sure about connector pinouts?
Posting pics of your connector may help.
(http://i.imgur.com/RnQB277.jpg)This good enough?
Or do you need more detail. Are all of the ports mirrored?
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Mon, 24 March 2014, 20:47:35
Perhaps you can figure it out with a continuity tester, probing some points on the keyboard itself and your breadboard?
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Mon, 24 March 2014, 20:51:03
Perhaps you can figure it out with a continuity tester, probing some points on the keyboard itself and your breadboard?
Okay, ill do that really quick.
EDIT: It all connects fine! Everything seems to be how it should be! I tested to make sure my pens weren't reversed, and they weren't.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 24 March 2014, 21:11:36
Hmm, I think you connect them wrongly. Ask Google about ADB connector  pinouts and take time to look into your wires.
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Mon, 24 March 2014, 21:18:10
Hmm, I think you connect them wrongly. Ask Google about ADB connector  pinouts and take time to look into your wires.
(http://www.kbdbabel.org/conn/kbd_connector_adb.png)
Thats what I am using.  I tested the connection from the keyboard connector, from the Arduino to the board inside the KB. Wrote down the results. I plugged the keyboard into the Macintosh Classic and tested the voltage from the pins, and they matched what they should be. Basically, I got 4.8 V from the classic instead of -4.8 V like if my pins were reversed. I did get the data pin wrong, so I switched that. But its not working still :X. Honestly, I think it has something to do with how I am compiling it, or how I am uploading it, or my Digital pin, or the code itself. Everything is wired how it should.
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Mon, 24 March 2014, 21:40:38
When I get home I’ll try to take a picture showing how I connect this up on a breadboard using a Teensy 2.0.
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Mon, 24 March 2014, 21:42:42
When I get home I’ll try to take a picture showing how I connect this up on a breadboard using a Teensy 2.0.
Okay, thank you very much! May I ask for an ETA? It is late here in the CST.
EDIT: It works now. I changed my pin and it works!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 25 March 2014, 09:54:19
See this. D0 in Arduino Micro is not PD0.  PD0 is D3 in marking of Arduino Macro PCB. Very confusing, huh.
http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Tue, 25 March 2014, 10:19:11
See this. D0 in Arduino Micro is not PD0.  PD0 is D3 in marking of Arduino Macro PCB. Very confusing, huh.
http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
Wow! Seriously!?! Well, note that on GitHub and the main page.
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Tue, 25 March 2014, 13:55:58
Hmm. Could someone help me change the key codes? I don't quite understand how to do it. My keyboard has the option and cmd key codes switched and I want to change the ` key to esc, any suggestions?
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Tue, 25 March 2014, 14:06:45
Which type of keyboard do you have? I updated some of the ADB converter code to use the newer features of Hasu’s firmware a few months ago, and should probably make some pull requests. Basically though you need to edit keymap.c, and maybe config.h.
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Tue, 25 March 2014, 14:45:55
Which type of keyboard do you have? I updated some of the ADB converter code to use the newer features of Hasu’s firmware a few months ago, and should probably make some pull requests. Basically though you need to edit keymap.c, and maybe config.h.
Its the M0487 Apple Keyboard II
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Tue, 25 March 2014, 14:52:57
So yeah, okay, take a look at keymap.c
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap.c

As you can see it’s currently set up with a layout that looks like an Apple Extended Keyboard. You can leave that part if you like, or you can try to make it look more like your M0487 layout.

Here’s the part which sets which characters get sent:
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap.c#L196

You can replace:
LGUI -> LALT
RGUI -> RALT (though your keyboard doesn’t have one of these)
LALT -> LGUI

to swap command and option back to normal.

Then you can do GRV -> ESC and ESC -> GRV to swap those two.
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Tue, 25 March 2014, 15:27:19
So yeah, okay, take a look at keymap.c
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap.c

As you can see it’s currently set up with a layout that looks like an Apple Extended Keyboard. You can leave that part if you like, or you can try to make it look more like your M0487 layout.

Here’s the part which sets which characters get sent:
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap.c#L196

You can replace:
LGUI -> LALT
RGUI -> RALT (though your keyboard doesn’t have one of these)
LALT -> LGUI

to swap command and option back to normal.

Then you can do GRV -> ESC and ESC -> GRV to swap those two.

Okay, the GUI and ALT worked! But switching the GRV and ESC doesn't work. Hmm.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Wed, 09 April 2014, 20:31:06
it occurs to me that it should be possible to detect the type of keyboard at ADB startup, by looking at the original handler id the keyboard has, and swap layouts dynamically.  Useful for people building external converter boxes that need to handle both "standard" and "extended" keyboards.
I added detection of extended and compact keyboard (https://github.com/gblargg/adb-v-usb/commits/master) and have it use a different keymap for each to the version on github.

I'm still fuzzy on what layers give in the absence of support for media keys (I'd like to add those at some point, but I don't have the motivation so far to figure out how to do so).
Title: Re: ADB to USB keyboard converter
Post by: MAR82 on Fri, 25 April 2014, 07:24:50
Hi guys I’ve been a bit of a lurker for some time gaining information on cool keyboards.

But here is my issue, I’ve got myself an Apple Extended II (but it’s an AZERTY) and I’d like to convert it over to USB. The only problem is that I tried looking at the files that are provided at the beginning of this post, and I have no idea what to do with them. I've never done much more than simple single file sketches on an Arduino   :-[

I don’t know how to build the HEX file or how to modify the keymap to be AZERTY. If anyone can point me to a guide that will take me through the steps of doing it, or explain it to me themselves (or even better send me the HEX file  ;D )

I don’t think it really make a difference, but I’ll be flashing this to a 32u4 with the Sparkfun bootloader.

Any help is appreciated, thanks

Edit: I also have an Arduino Micro and two USBASP v2.0 if that can help
Title: Re: ADB to USB keyboard converter
Post by: MAR82 on Tue, 29 April 2014, 14:31:49
OK guys I was able to figure it out.(I'm typing this with it) :thumb:
It turns out I was downloading just the files for the ADB converter, and not the whole project. (stupid me :rolleyes:)
So now I got it working, the only thing I'm having a problem with is that I have two keys that are inverted. The "²" key is giving me "<", and vice versa. I guess I'll have to understand how to modify the keymap.
The only other issue is my page up key isn't working but that's because the switch isn't working  :mad:. Does anyone knows where I can find one switch (or clone)?
Title: Re: ADB to USB keyboard converter
Post by: jacobolus on Tue, 29 April 2014, 22:40:28
The only other issue is my page up key isn't working but that's because the switch isn't working  :mad:. Does anyone knows where I can find one switch (or clone)?
I’m out of the country for another 2 weeks, or I’d send you one. If you get your post count up, you could try the 'classifieds' section. ("[WTB] One dampened tactile Alps switch" or whatever)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 30 April 2014, 21:50:30
MAR82, great. The key swap problem is an unfixed old bug. Yes, you just swap two keycodes.

This is that issue on github and my thoughs.
https://github.com/tmk/tmk_keyboard/issues/35
Title: Re: ADB to USB keyboard converter
Post by: MAR82 on Mon, 05 May 2014, 12:57:52
Sorry I've been so busy with work and stuff around the house, to be able to get back to this.
But thanks to you and to everyone one that has contributed to the project, I can now use this lovely ADB Apple Extended II.
I looked at the link that you gave me and yes I can also confirm that the keys work properly on a Mac. So what I think I'll do is just use AutoHotkey for when ever I want to use it on a Windows machine.

Here is what it looks like for now (http://imgur.com/a/JM52n) I think I'll get some Sugru to wrap it in; I don't think the converter will ever get to hot so it should be safe.

I know the power key does what the names says (it powers down a Windows PC, but does nothing on a Mac). But it would be nice if in the future it could be used for selecting different layout layers, or something cool like that.

But once again thanks for the code  :thumb:
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 12 May 2014, 19:52:28
I think so, it is no problem about Sugru wrapping, AVR chip does not get hot much.

Hmm, I didn't know Mac doens't accept power key(PWR). There are two kind of power key, KC_PWR and KC_POWER. KC_PWR is used often in Windows keyboard  and works with Windows and Linux, while KC_POWER works with Linux and OSX but doesn't with Windows.

In short, just replace PWR with POWER in you keymap.c POWER key will work with your Mac.
Title: Re: ADB to USB keyboard converter
Post by: 125ml on Sat, 21 June 2014, 16:21:28
Has anyone had success with the Adafruit ATmega32u4 chip for an ADB-USB converter. I seem to be having some problems.

So far I have the GND and VCC connected to GND and VCC (as you would expect) and the Data line connected to F0 and 10k pull-up resistor between the data and VCC lines.
Since i connected up the data line my Mac now recognises the chip as an ADB keyboard converter, but doesn't register any key presses. So I'm thinking that the data port is wrong.
I've followed (as best I can, I'm quite new to coding in C) the instructions from the Git pages but only get an error when I try to change the ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT #define statements in the config.h file.
Most likely I am missing something.

Any chance of a pointer?

Thanks.

Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 21 June 2014, 17:44:37
By default this converter uses D0 pin for data line now. Check README.md and first post of this thread.
If you want to use F0 instead you can edit config.h.
Title: Re: ADB to USB keyboard converter
Post by: 125ml on Sun, 22 June 2014, 01:56:54
thanks Hasu,
I still couldn't get config.h to compile when I tried to change the port.
So, I've moved the data line over to D0 and it is working.
Thanks for the guidance.

I now have another fantastic keyboard in my collection and the tools to get more and annoy my wife.
Cheers to everyone who has contributed to the code on this. Great work.
Title: Re: ADB to USB keyboard converter
Post by: gustavQ on Sun, 06 July 2014, 17:57:39
Hi guys,

i'm having here a weird situation. I managed to put working the converter with a pro micro with a breadboard just to try out. Then I did these connections in the pro micro:
(http://s15.postimg.org/nx5n6gjqf/WP_20140706_001.jpg) (http://postimg.org/image/nx5n6gjqf/)

I added a button between the gnd and the rst to be able to enter into the boot loader when I want. It is working, because I already upload the hex file twice using this mechanism. The resistance is an 1k and is the same I used in the prototype circuit. Also in both cases I use a ADB cable leaving the brown (Power ON) cable to connect.
Now, with all the connections, the converter is not working. I can't figure out why. Can be the button? It shouldn't be.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 06 July 2014, 19:12:43
Tact switch and resistor look to me ok.
Not sure how you connected ADB cable. No photo of another side?
Title: Re: ADB to USB keyboard converter
Post by: urbanredfox on Wed, 16 July 2014, 23:45:22
Wow this is quite impressive. I skimmed the 10 pages a few months ago and decided to get a teensy and try it out instead of my iMate deal since some of the keys don't work. I just finished reading all 10 pages today and I must say awesome work! I plugged in my Apple Adjustable keyboard and now have a power button that pulls up the shutdown menu.

I did notice one thing that was interesting however I have not investigated yet. On the Adjustable keyboard if I press any of the media keys, volume up, volume down, mute, microphone (what ever this button did) the I no longer can type from this keyboard. Computer seems to respond from other keyboard. I'll pull up the debugger later this week and see what the output looks like as well as look deeper into the code. All I've done so far is verified that the ExtraKey_Enable is set to yes in the Make file.

I'll report back what I find and maybe post some photos when I make a more permanent solution. After all who doesn't like photos.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 20 July 2014, 10:04:20
I confirmed the issue you mentioned on Adjustable Keyboard, the keyboard stops working and only replys with error code 'FFEF' instead of keycode after those media keys are pressed.

Hmm, those media keys  don't yield a keycode unlike other keys, it may need some special initialization or procedure to get keycode of the keys. we'll need to look for the information among old apple documentations.


https://github.com/tmk/tmk_keyboard/issues/130
Title: Re: ADB to USB keyboard converter
Post by: urbanredfox on Sun, 20 July 2014, 22:46:46
Glad to hear it's not just me. I started reading up on the basics of ADB in the hackipedia tech notes, I haven't run across anything related to special/media keys yet but I'll keep digging.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 21 July 2014, 08:10:10
With oscilloscope I found Adjustable keyboard uses 'Service Request' after a media key is pressed. 'Service Request' is used for 'multiple devices' support in ADB. Tmk ADB converter doesn't support 'Service Request' because it is limited to handle *only one keyboard* at same time. This casues the issue that the keyboard stops working after using media keys.

I pushed this commit to fix the problem but note that this does not add support for the mediakeys, they are just ignored. Try the latest version of master branch. https://github.com/tmk/tmk_keyboard/commit/79840c678

Adjustable keyboard behaves as if two devices exists for some reason, one is normal alpha-numeric keyboard and other is media buttons device. To use the media button part we need to add 'multiple devices' support and this will be somewhat hard work. I don't have a plan for this currently.
Title: Re: ADB to USB keyboard converter
Post by: Tomin8or on Mon, 21 July 2014, 14:38:40
Ok, so I have an Apple Extended Keyboard 2 and a teensy 2.0.  I followed this guide almost exactly, with the only deviation being that I ran the cable out the left side of the casing and cut off the ADB connector there.  the wires are soldered onto the exact same pins on both the ADB pcb and connected in the same place on the teensy as pictured on that guide.  Wehn the keyboard is pullged in onboth Windows 7 and OSX 10.9.2, the numlock and other 2 led's flash once and then nothing happens.  Is this something that could be fixed with the pullup resistor? What does the resistor do (ELI5 style please)?  I got the board from my parents, and it worked on the old Mac (SEII I think) they had it on.

Any help would be greatly appreciated, as I am really not sure where to go from here.

Edit: I have also tried multiple USB cables, to no avail.

Edit 2: The guide: http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 21 July 2014, 16:35:42
No photo?
which guide are you following? what is ELI5?

EDIT: Ah OK, urban dic helped me.
http://www.urbandictionary.com/define.php?term=ELI5
Title: Re: ADB to USB keyboard converter
Post by: Tomin8or on Mon, 21 July 2014, 20:42:48
Added the link to the guide, guess I just forgot to paste it in last time.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 21 July 2014, 21:10:35
You are always strongly recommended to add pull-up resistor, but in many cases it will work without this unless you are so unlucky. So I'm guess you are connected to data line wrongly. Power lines 5V and GND seems to be OK because it has LED flash when powering on.

Ah, the port was changed from PF0 to PD0 after that guide is written. You need to resolder data line to PD0, not PF0.
You should read README.md first...

Title: Re: ADB to USB keyboard converter
Post by: Tomin8or on Mon, 21 July 2014, 21:35:24
Tried this, still no dice. Just the lights and then nothing.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 21 July 2014, 22:02:20
hmm, you seems to be unlucky. Post photos of your connection if you need further help.
Title: Re: ADB to USB keyboard converter
Post by: Tomin8or on Mon, 21 July 2014, 22:18:56
Pic of relevant connections.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 21 July 2014, 23:18:30
Looks like wiring is OK but again, make sure red and black line should not touch each other.
Still no luck? It is time to add pullup resistor finally.

Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 22 July 2014, 20:30:48
You've got your ADB socket miswired. I have one like that and the one in the linked Hack It Better article both are wired with ground in the upper-left (white in the article), and data in the lower-right (blue in the article). You've got them swapped. I also highly recommend you use a pull-up resistor, otherwise you're just asking for rare problems that are hard to reproduce or diagnose. If you don't have a resistor (1K-10K is fine), you can run a few of the other port pins as pull-ups and connect them together with the data pin.
Title: Re: ADB to USB keyboard converter
Post by: Tomin8or on Fri, 25 July 2014, 18:50:38
Got mine working today, as I finally got proper resistors.  The nearest place I could buy them has weird hours and is overrun with vacationers this time of year, so I had to order them from Amazon, but hey it works.  Thanks a bunch for the help and for doing all the hard work for us in writing the code to make it work.  Stuff like this is why I am starting in on a Computer Engineering major next year.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Fri, 25 July 2014, 20:02:55
Was it miswired in your pictures or was I incorrect?
Title: Re: ADB to USB keyboard converter
Post by: Tomin8or on Fri, 25 July 2014, 23:01:31
It was properly wired.

Small gallery: http://imgur.com/a/GEYEB

Edit: For those doing this in the future, if you solder onto the adb connector's pcb, make sure you realize they are not the same on opposite sides.  The pins have different locations (I used the right side connector to solder to so I could run the cable out the left).
Title: Re: ADB to USB keyboard converter
Post by: urbanredfox on Tue, 05 August 2014, 23:11:32
Hi Hasu,

I tried the latest version of the master branch and it works great no more freezing of the keyboard. Thanks for all the help.

Just out of curiosity is the lack of Service Request due to hardware limitations or outside of the scope of this project?

With oscilloscope I found Adjustable keyboard uses 'Service Request' after a media key is pressed. 'Service Request' is used for 'multiple devices' support in ADB. Tmk ADB converter doesn't support 'Service Request' because it is limited to handle *only one keyboard* at same time. This casues the issue that the keyboard stops working after using media keys.

I pushed this commit to fix the problem but note that this does not add support for the mediakeys, they are just ignored. Try the latest version of master branch. https://github.com/tmk/tmk_keyboard/commit/79840c678

Adjustable keyboard behaves as if two devices exists for some reason, one is normal alpha-numeric keyboard and other is media buttons device. To use the media button part we need to add 'multiple devices' support and this will be somewhat hard work. I don't have a plan for this currently.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 05 August 2014, 23:30:10
Great!

It is just a limitation of current firmware, I think 'multi devices' or Service Request support is certainly possible but I hesitate to implement it due to my laziness.
Title: Re: ADB to USB keyboard converter
Post by: DamnDan on Thu, 02 October 2014, 06:27:47
Hello Geekhackers,

As I totally lack knowledge in terms of making key matrix and making hex files (i know...big newbie), and before I go long way to learn how to do this, I need to ask you a question:

Does anyone have a ready made HEX file for m0118 board? :(

This would help my Apple board to finally get some use :)

Thanks,
Damndan
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 02 October 2014, 13:41:27
M0118 will work with this converter, I have M0116 and it work. You'll have to use ISO keymap, see here.
https://github.com/tmk/tmk_keyboard/issues/35#issuecomment-43660429
Title: Re: ADB to USB keyboard converter
Post by: DamnDan on Sun, 05 October 2014, 03:47:26
M0118 will work with this converter, I have M0116 and it work. You'll have to use ISO keymap, see here.
https://github.com/tmk/tmk_keyboard/issues/35#issuecomment-43660429

Hey Hasu :)


Thank you for the tip :) Now I have a fully functioning M0118 :)

Have a great day! :)

Edit:
Found one small thing that I do not know how to change

Is there any way i could change the right command key into right alt?
(http://i.imgur.com/9bJ8sIB.jpg)

If there is....where do i change that O,o

I read somewhere that it is not possible with this converter, but it is always better to ask before you give up ;P
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 08 October 2014, 07:05:04
Apple Desktop keyboard(Apple IIGS) and Apple Standard keyboard including M0116 and M0118 can not discriminate between left and right modifier. Or those keyboard has same scan code for both left and right modifier key.
So both of those command keys in your pic are same key in reality. If you assign right Alt to the left Command key right Commad key also emits right Alt.

While Extended keyboard(AEK and AEKII) has discriminate between left and right modifier keys except Command keys.

This is ADB protocol limitation, not TMK converter one.
Title: Re: ADB to USB keyboard converter
Post by: DamnDan on Thu, 09 October 2014, 06:57:41
Apple Desktop keyboard(Apple IIGS) and Apple Standard keyboard including M0116 and M0118 can not discriminate between left and right modifier. Or those keyboard has same scan code for both left and right modifier key.
So both of those command keys in your pic are same key in reality. If you assign right Alt to the left Command key right Commad key also emits right Alt.

While Extended keyboard(AEK and AEKII) has discriminate between left and right modifier keys except Command keys.

This is ADB protocol limitation, not TMK converter one.

Thank you  :) I was going crazy with this trying to figure out how to make it work ;) I've decided to just sacrifice OS key and use it as right alt instead :)

Thank you for all your help :)
Title: Re: ADB to USB keyboard converter
Post by: blargg on Sun, 19 October 2014, 20:13:25
Assuming yours differentiates between left and right shift keys, you could swap right shift and right command traces on the PCB pretty easily. They should both share a common scan line, which you'd leave. You'd cut the trace just before the other line to each switch, and run jumpers to another point on the board where those lines connect to something. Then update the keymap in tmk and it will work flawlessly (though be comical if someone tried to use it in an old Mac). If you're interested I can provide further guidance.
Title: Re: ADB to USB keyboard converter
Post by: DamnDan on Tue, 21 October 2014, 04:46:44
Assuming yours differentiates between left and right shift keys, you could swap right shift and right command traces on the PCB pretty easily. They should both share a common scan line, which you'd leave. You'd cut the trace just before the other line to each switch, and run jumpers to another point on the board where those lines connect to something. Then update the keymap in tmk and it will work flawlessly (though be comical if someone tried to use it in an old Mac). If you're interested I can provide further guidance.

Thank you for your response :) Actually i would love to keep the board original in terms of innards, so that when I decide to sell it or i will die and someone else try to sell it, the board will be a great deal for both keyboard and Apple enthusiasts :) That is why i sacrificed the OS key in tmk :) I've learned that I don't use the OS key at all when I work or game so it was the only reasonable choice :)

Also i use both shifts while I work - Photoshop, coding, writing etc :)

Second key that i've sacrificed was the "<>" key near the left shift, and now it is used as an FN key to trigger the function row :)

At the moment, after all the modding of additional layers, I've stopped using any other boards :P So the sacrifices were for the good :) M0118 is a really nice small board for my gaming and work needs :)

Just a question, should there be any springs in space and enter key stabilisers? Mine came with none and these keys were acting all sticky (after pressing they remained in pushed position). After some verification it seems that this was happening due to these keys being held down by stabilisers. I modded my board wih cut pencil springs, but the question remains...am I missing any original stabiliser springs?

Once again thank you all for all your help with this :) This is as close as I can get to 60-75% boards without going through ALOT of expenses :P

After I will find some more time to construct a shell for the converter I will post some pictures :)

Thanks! :)
Title: Re: ADB to USB keyboard converter
Post by: Merc_Ragnar on Sun, 09 November 2014, 15:43:05
?Help?

Hey guys, I'm not a troll, but instead just an idiot who can not apply what I've read here to my keyboard (M0116) project.  I am truly appreciative of your time if you're willing to help. 

Disclaimer:  This is the first time I've attempted a project like this.

My first question:  Regarding the source code at  github/...converter/adb_usb (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb), I have read multiple references to edit keymap.c.  Currently, I can not locate a file called keymap.c.   Given that I need a hex for an M0116 (an iso layout to my knowledge), should I edit the keymap_iso.c file instead? 

ANY help (even just the necessary hex) would be incredibly appreciated. 

You guys do some incredible projects and I consider myself fortunate in being able to be along for the ride.  Thank you for your time.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Mon, 10 November 2014, 00:56:05
What you probably want to do is copy keymap_iso.c to keymap_ragnar.c (or, indeed, populate it with the contents of the M0116 map from keymap_common.c), modify to taste, and then do a

make KEYMAP=ragnar
Title: Re: ADB to USB keyboard converter
Post by: Merc_Ragnar on Mon, 10 November 2014, 09:13:15
What you probably want to do is copy keymap_iso.c to keymap_ragnar.c (or, indeed, populate it with the contents of the M0116 map from keymap_common.c), modify to taste, and then do a

make KEYMAP=ragnar

Thanks for the heads-up, I'll get back to work and give that a go.
Title: Re: ADB to USB keyboard converter
Post by: arfink on Mon, 10 November 2014, 16:20:44
Having a little problem compiling the latest. I'm running Mint with gcc-avr and avr-libc installed, so ought to have all necessary dependencies. Issuing "make" spews lots of proper output before this:

mkdir -p obj_adb_usb_lufa/common
Compiling C: ../../common/debug.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=8cec0bc -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_adb_usb_lufa/common/debug.lst -I. -I../.. -I../../protocol/lufa -I../../protocol/lufa/LUFA-120730 -I../../protocol -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_adb_usb_lufa_common_debug.o.d  ../../common/debug.c -o obj_adb_usb_lufa/common/debug.o
../../common/debug.c:7:5: error: unknown field ‘enable’ specified in initializer
../../common/debug.c:8:5: error: unknown field ‘matrix’ specified in initializer
../../common/debug.c:8:5: warning: excess elements in union initializer
../../common/debug.c:8:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:9:5: error: unknown field ‘keyboard’ specified in initializer
../../common/debug.c:9:5: warning: excess elements in union initializer
../../common/debug.c:9:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:10:5: error: unknown field ‘mouse’ specified in initializer
../../common/debug.c:10:5: warning: excess elements in union initializer
../../common/debug.c:10:5: warning: (near initialization for ‘debug_config’)
make: *** [obj_adb_usb_lufa/common/debug.o] Error 1

Not sure what's going on here, the last version I pulled from Git a couple months ago compiled without hiccups...
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 10 November 2014, 19:03:53
On my ubuntu 14.04 with AVR gcc 4.8.2 and avr-libc 1.8.0 I got no error while compile. But I have seen this error some time ago sowewhere. I don't remember how I did with the error.

What are your toolchain versions? And you are using HEAD of master branch, right?

Those 'unknown fields' of debug_config_t is defined in common/debug_config.h, I dont know why those are unknown.
My code may not conform with some C specifications. Am I doing something wrong?
Title: Re: ADB to USB keyboard converter
Post by: Merc_Ragnar on Mon, 10 November 2014, 21:10:47
Having a little problem compiling the latest. I'm running Mint with gcc-avr and avr-libc installed, so ought to have all necessary dependencies. Issuing "make" spews lots of proper output before this:

mkdir -p obj_adb_usb_lufa/common
Compiling C: ../../common/debug.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=8cec0bc -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_adb_usb_lufa/common/debug.lst -I. -I../.. -I../../protocol/lufa -I../../protocol/lufa/LUFA-120730 -I../../protocol -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_adb_usb_lufa_common_debug.o.d  ../../common/debug.c -o obj_adb_usb_lufa/common/debug.o
../../common/debug.c:7:5: error: unknown field ‘enable’ specified in initializer
../../common/debug.c:8:5: error: unknown field ‘matrix’ specified in initializer
../../common/debug.c:8:5: warning: excess elements in union initializer
../../common/debug.c:8:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:9:5: error: unknown field ‘keyboard’ specified in initializer
../../common/debug.c:9:5: warning: excess elements in union initializer
../../common/debug.c:9:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:10:5: error: unknown field ‘mouse’ specified in initializer
../../common/debug.c:10:5: warning: excess elements in union initializer
../../common/debug.c:10:5: warning: (near initialization for ‘debug_config’)
make: *** [obj_adb_usb_lufa/common/debug.o] Error 1

Not sure what's going on here, the last version I pulled from Git a couple months ago compiled without hiccups...

I can't figure out how to make this stupid thing, but I had to deal with the same obstacle just two days ago. 
Note:  I'm running Mint on my primary laptop.

CODE THAT FOLLOWS FOR LINUX MINT ONLY
Try
Code: [Select]
sudo apt-get install gcc-avr binutils-avr avr-libc

That resolved my errors.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Tue, 11 November 2014, 05:13:03
Okay, it's not tested, as I don't have a teensy spare at the moment, but I've just incorporated my M0116 keymap with hasu's latest code.

I've attached a binary.  Merc_ragnar, if you could test it, I'll submit a pull request to hasu.
Title: Re: ADB to USB keyboard converter
Post by: arfink on Tue, 11 November 2014, 12:28:43
Having a little problem compiling the latest. I'm running Mint with gcc-avr and avr-libc installed, so ought to have all necessary dependencies. Issuing "make" spews lots of proper output before this:

mkdir -p obj_adb_usb_lufa/common
Compiling C: ../../common/debug.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=8cec0bc -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_adb_usb_lufa/common/debug.lst -I. -I../.. -I../../protocol/lufa -I../../protocol/lufa/LUFA-120730 -I../../protocol -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_adb_usb_lufa_common_debug.o.d  ../../common/debug.c -o obj_adb_usb_lufa/common/debug.o
../../common/debug.c:7:5: error: unknown field ‘enable’ specified in initializer
../../common/debug.c:8:5: error: unknown field ‘matrix’ specified in initializer
../../common/debug.c:8:5: warning: excess elements in union initializer
../../common/debug.c:8:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:9:5: error: unknown field ‘keyboard’ specified in initializer
../../common/debug.c:9:5: warning: excess elements in union initializer
../../common/debug.c:9:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:10:5: error: unknown field ‘mouse’ specified in initializer
../../common/debug.c:10:5: warning: excess elements in union initializer
../../common/debug.c:10:5: warning: (near initialization for ‘debug_config’)
make: *** [obj_adb_usb_lufa/common/debug.o] Error 1

Not sure what's going on here, the last version I pulled from Git a couple months ago compiled without hiccups...

I can't figure out how to make this stupid thing, but I had to deal with the same obstacle just two days ago. 
Note:  I'm running Mint on my primary laptop.

CODE THAT FOLLOWS FOR LINUX MINT ONLY
Try
Code: [Select]
sudo apt-get install gcc-avr binutils-avr avr-libc

That resolved my errors.

I had already thought to install those too, and found that despite having them installed, it still borked on me. Is this just a Linux Mint problem? I am running v13 LTS, so it's a little behind.
Title: Re: ADB to USB keyboard converter
Post by: arfink on Tue, 11 November 2014, 13:12:46
For GCC-AVR I have 1:4.5.3-3
For avr-libc I have 1:1.7.1-2

I suppose for my next thing to try, I'll be seeing about updating those. I believe those are the newest in the Mint 13 repo though, so this might be a little beyond where I can/will go with this today. I might resort to compiling in my Windows VM to save having to upgrade a bunch of dependencies beyond the repos.
Title: Re: ADB to USB keyboard converter
Post by: Merc_Ragnar on Tue, 11 November 2014, 16:18:59
For GCC-AVR I have 1:4.5.3-3
For avr-libc I have 1:1.7.1-2

I suppose for my next thing to try, I'll be seeing about updating those. I believe those are the newest in the Mint 13 repo though, so this might be a little beyond where I can/will go with this today. I might resort to compiling in my Windows VM to save having to upgrade a bunch of dependencies beyond the repos.

I should probably simply shut my mouth as I have NO experience in hardware.  I did resolve the same error you had for Mint 17 by running an update and then the code I posted above.  I have no idea why I had the initial error as I already had GCC-AVR installed, but after the update and running the code above the error did resolve.


Okay, it's not tested, as I don't have a teensy spare at the moment, but I've just incorporated my M0116 keymap with hasu's latest code.

I've attached a binary.  Merc_ragnar, if you could test it, I'll submit a pull request to hasu.

Thank you so much I had all but given up and just resolved to grab an adapter.  I'll give her a go tonight.



EDIT:  Tuffy, I have no idea what to do with the .elf or how to test that on the Teensy.  I don't know how to convert/make a hex out of the elf and I am unable to load it onto my Teensy.  Anyway I can score the .hex from you?
Title: Re: ADB to USB keyboard converter
Post by: tufty on Tue, 11 November 2014, 23:48:05
Oh god I'm an idiot.  Attached.

Should work like this:

Code: [Select]
  /* Default layer : plain keymap
   *                     +-------+
   *                     | power |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Fn1|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  /* Layer 1 :
   *                     +-------+
   *                     | Eject |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |Capslock|   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
note that capslock is now the "layer" key (and works best with the locking mechanism removed), and actual capslock is on layer 1.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 13 November 2014, 17:36:56
Having a little problem compiling the latest. I'm running Mint with gcc-avr and avr-libc installed, so ought to have all necessary dependencies. Issuing "make" spews lots of proper output before this:

mkdir -p obj_adb_usb_lufa/common
Compiling C: ../../common/debug.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=8cec0bc -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_adb_usb_lufa/common/debug.lst -I. -I../.. -I../../protocol/lufa -I../../protocol/lufa/LUFA-120730 -I../../protocol -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_adb_usb_lufa_common_debug.o.d  ../../common/debug.c -o obj_adb_usb_lufa/common/debug.o
../../common/debug.c:7:5: error: unknown field ‘enable’ specified in initializer
../../common/debug.c:8:5: error: unknown field ‘matrix’ specified in initializer
../../common/debug.c:8:5: warning: excess elements in union initializer
../../common/debug.c:8:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:9:5: error: unknown field ‘keyboard’ specified in initializer
../../common/debug.c:9:5: warning: excess elements in union initializer
../../common/debug.c:9:5: warning: (near initialization for ‘debug_config’)
../../common/debug.c:10:5: error: unknown field ‘mouse’ specified in initializer
../../common/debug.c:10:5: warning: excess elements in union initializer
../../common/debug.c:10:5: warning: (near initialization for ‘debug_config’)
make: *** [obj_adb_usb_lufa/common/debug.o] Error 1

Not sure what's going on here, the last version I pulled from Git a couple months ago compiled without hiccups...

I can't figure out how to make this stupid thing, but I had to deal with the same obstacle just two days ago. 
Note:  I'm running Mint on my primary laptop.

CODE THAT FOLLOWS FOR LINUX MINT ONLY
Try
Code: [Select]
sudo apt-get install gcc-avr binutils-avr avr-libc

That resolved my errors.

I had already thought to install those too, and found that despite having them installed, it still borked on me. Is this just a Linux Mint problem? I am running v13 LTS, so it's a little behind.

For GCC-AVR I have 1:4.5.3-3
For avr-libc I have 1:1.7.1-2

I suppose for my next thing to try, I'll be seeing about updating those. I believe those are the newest in the Mint 13 repo though, so this might be a little beyond where I can/will go with this today. I might resort to compiling in my Windows VM to save having to upgrade a bunch of dependencies beyond the repos.


I confirmed this error occurs on WinAVR(avr-gcc 4.3.3) too. Seems like this GCC bug is involved with the error and **GCC 4.6 or later** will be able to compile without the error if I'm correct.
GCC Bug 10676 - Using unnamed fields in initializers: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676

Now we have two possible workarounds. Let me know whether these work for you.
WORKAROUND1: Update GCC to 4.6 or later
or
WORKAROUND2: Replace code
Code: [Select]
debug_config_t debug_config = {
    .enable = false,
    .matrix = false,
    .keyboard = false,
    .mouse = false,
};
with
Code: [Select]
debug_config_t debug_config = {};
Title: Re: ADB to USB keyboard converter
Post by: tufty on Fri, 14 November 2014, 01:15:49
I've just thrown you a pull request, which should fix the gcc < 4.6 issues and keep your code readable.

The commit before adds files with a trailing ~ in their names to .gitignore, which is useful, and the one before that adds my m0116 keymap (currently untested, as I noted before)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 14 November 2014, 03:16:04
Thank you for suggestion, tuffy.

I fixed the issue of debug.c compile at this commit.
https://github.com/tmk/tmk_keyboard/commit/818070913275349c3906e2c4cdc3d69da5b7e132
Code: [Select]
diff --git a/common/debug.c b/common/debug.c
index c4fa3a0..2ed1006 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -1,12 +1,15 @@
 #include <stdbool.h>
 #include "debug.h"
 
+#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
 
-//debug_config_t debug_config = { .enable = false, .matrix = false };
 debug_config_t debug_config = {
+#if GCC_VERSION >= 40600
+    /* GCC Bug 10676 - Using unnamed fields in initializers
+     * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 */
     .enable = false,
     .matrix = false,
     .keyboard = false,
     .mouse = false,
+#endif
 };
-
Title: Re: ADB to USB keyboard converter
Post by: tufty on Sun, 16 November 2014, 09:50:06
OK, I done a stupid.

As my ADB testing teensy (now hardwired into a wacom tablet) had ADB wired to C7, I had hacked my local branch to listen for ADB on that pin, rather than hasu's default D0.  And I didn't rectify that before building the binary I posted before.  Woops.

Here's one built with the aforementioned M0116 keymap and, crucially, listening on what should be the correct pin.

<hangs head in shame>
Title: Re: ADB to USB keyboard converter
Post by: tufty on Sun, 16 November 2014, 09:51:36
<and more shame>

It's been a long day.
Title: Re: ADB to USB keyboard converter
Post by: Merc_Ragnar on Mon, 17 November 2014, 20:27:15
<and more shame>

It's been a long day.

Thanks for all the help on this. 

Good news:  I got the Teeny reading as a keyboard on my windows laptop.
Bad news:  I could never use the keyboard and ended up smelling a burning plastic smell and discovered the large black chip on the keyboard was incredibly hot.

I'm now checking out my solders again, specifically the contact my resistor is making.

 
Title: Re: ADB to USB keyboard converter
Post by: blargg on Tue, 18 November 2014, 02:47:01
With the Teensy off, use a meter to be sure that GND actually connects to GND on the keyboard PCB when they're plugged together. Sounds like the polarity was backwards, and you've got Vcc from the Teensy going to GND on the keyboard.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Sat, 22 November 2014, 01:59:05
Good news:  I got the Teeny reading as a keyboard on my windows laptop.
Bad news:  I could never use the keyboard and ended up smelling a burning plastic smell and discovered the large black chip on the keyboard was incredibly hot.
Aaargh!

That's not good, but you probably guessed that anyway.  I concur with blargg, sounds an awful lot like you've got something messed up soldering-wise.  Any chance of a photo?  Also double-check you've got the ADB connection wired up correctly.  The plug is symmetrical, so it's easy to mix up which wire goes where based on a pinout, and there's seemingly no standard as to what colour the wires are.
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Mon, 01 December 2014, 10:00:30
Is there a preferred place to tie into the ADB circuitry when doing an internal Teensy mod? I've attached photos of three possibilities that occur to me.

1) tack solder to the back of the ADB connector PCB. This seems to be what Scotty did here: http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/ [attach=1]

2) shim into the connector between the ADB connector PCB and the keyboard PCB [attach=2]

3) desolder the ADB connector PCB and tie in directly to the keyboard PCB. [attach=3]

I don't plan on using the keyboard with a standard ADB-capable Mac, so I don't mind losing the ADB connectivity.

Incidentally, anyone know what the 5 pin(s) are there for?
Title: Re: ADB to USB keyboard converter
Post by: tufty on Mon, 01 December 2014, 10:15:32
There's only 4 pins - +5v, GND, data, PSW (power switch).  The 5th "pin" you're seeing on the AEK is "shield", which is usually synonymous with GND.
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Mon, 01 December 2014, 10:19:19
Right. That's why I was asking. But thanks, that clears it up anyway.
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Fri, 05 December 2014, 08:32:35
Back to the original question, though: Anyone want to chime in on how they wired up their AEKII? At this point, I'm planning on route #3 (desoldering the ADB connector entirely, and running the wires from the keyboard directly to the Teensy 2.0.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Fri, 05 December 2014, 08:41:59
That's what I'd do, replacing the ADB connector with a B or mini-B USB connector on a flying lead.
Title: Re: ADB to USB keyboard converter
Post by: blargg on Fri, 05 December 2014, 18:36:52
I keep my keyboards unmodified (other than making caps lock a momentary key), so that I can easily plug the adapter into another ADB keyboard, debug problems by testing on another keyboard, sell the keyboard later, etc. I like flexibility. A common S-video cable can be used to connect to the keyboard.
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Thu, 11 December 2014, 11:46:41
For the AEKII, is it sufficient to remove the physical locking mechanism on the Caps Lock switch, and use the tmk code to grant it momentary behavior (versus combined keydown/keyup) in order to be able to treat Caps Lock as Control? Anyone with a step-by-step on this procedure?
Title: Re: ADB to USB keyboard converter
Post by: ocodo on Thu, 11 December 2014, 12:33:41
Is there a preferred place to tie into the ADB circuitry when doing an internal Teensy mod? I've attached photos of three possibilities that occur to me.

1) tack solder to the back of the ADB connector PCB. This seems to be what Scotty did here: http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/ (Attachment Link)

2) shim into the connector between the ADB connector PCB and the keyboard PCB (Attachment Link)

3) desolder the ADB connector PCB and tie in directly to the keyboard PCB. (Attachment Link)

I don't plan on using the keyboard with a standard ADB-capable Mac, so I don't mind losing the ADB connectivity.

Incidentally, anyone know what the 5 pin(s) are there for?

Does anyone have the pinouts of that ribbon cable? Looks like the perfect place to patch from.  3D print a mount for the teensy and we have a nice mini USB connector to replace one ADB and a remaining ADB on the other side, for backwards compatibility. 


Edit:  This looks more than adequate. https://geekhack.org/index.php?topic=14290.msg1409902#msg1409902

[attach=1]

ADB Pin outs left - to - right

Code: [Select]
5 : 4 (Gnd) : 5 : 3 (VCC) : 5 : 2 (Pwr) : 5 : 1 (Data) : 5
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Mon, 15 December 2014, 10:39:53
SUCCESS

Turned out to be a 1 hour project, once I had all the components in place. Ultimately, I went with an external connector for three reasons:

  1) Fear of working in cramped conditions

  2) Can more easily fall back on one of the other spare keyboards if something goes wrong

  3) DAT original ADB cable!

Process writeup:

So, I bought the keyboards together on eBay from a single seller (he discounted the lot of 4 for $112 - $28 a pop!). He sent me serial numbers, confirming that all had the Alps switches. They had no cables, though, so I was originally planning on an internal mod with a pretty stock USB cable. I looked at the Zeal PC custom cables, and considered getting a grey coiled cable, but man, it'd be more than the keyboard! I planned for a bit of redundancy, so I ordered two of the Teensy 2.0 boards, and started collecting some other bits and bobs. Got some various soldering bits off Amazon and Adafruit, and got a batch of 10 S-Video connectors off eBay for $5. Also came across two coiled ADB cables on eBay, one NOS, each for ~$5. So, I was set. Easy peasy lemon squeezy.

Now to come up with some sort of housing for it.

Thanks for the inspiration, GeekHack, and thanks for the code, Hasu!

Happy clackety clack
Title: Re: ADB to USB keyboard converter
Post by: MontyElephant on Mon, 15 December 2014, 19:44:31
Ok so I'm really new to all of this. I decided to go with an Arduino micro since I could get it locally. I am stuck at how to load the hex file on to the chip. When I select Connection > USB > Open in FLIP it says "Could not open USB device." The arduino shows up in the device manager under Ports > Arduino Micro (COM 3). What am I doing wrong?

Thanks
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 15 December 2014, 20:20:29
zacbir, nice write up!

MontyElephant, FLIP cannot work with Arduino bootloader, you will need to use avrdude instead.

EDIT: command like this will work for you, device name varies depending on your system.
Code: [Select]
avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:adb_usb.hex -P/dev/ttyACM0
Title: Re: ADB to USB keyboard converter
Post by: MontyElephant on Mon, 15 December 2014, 20:34:56

MontyElephant, FLIP cannot work with Arduino bootloader, you will need to use avrdude instead.

EDIT: command like this will work for you, device name varies depending on your system.
Code: [Select]
avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:adb_usb.hex -P/dev/ttyACM0

Ok so I was able to upload the hex (i think) using Arduino Builder. I then plugged it into the breadboard with all the wires and then plugged it all into the computer aannnd nothing... I took it back out of the breadboard and now when I plug it in the blue LED turns on but neither of the LEDs on top blink as before. If I press reset, the top LEDs will blink briefly and the device will show up temporarily in the same spot under COM4 and then disappear. Did I do something wrong?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 15 December 2014, 20:42:35
you will see keyboard device of vid:feed and pid:0adb if your board is programmed with tmk firmware. My converter doesn't control any LED on Arduino.
Title: Re: ADB to USB keyboard converter
Post by: MontyElephant on Mon, 15 December 2014, 20:56:37
you will see keyboard device of vid:feed and pid:0adb if your board is programmed with tmk firmware. My converter doesn't control any LED on Arduino.

Ok so when I plug the device in (without being plugged into the breadboard), it shows up as you specified. However, as soon as I put it in the breadboard, when I connect it, it connects momentarily (I can hear the windows "device connected" sound) but then immediately disconnects (again indicated by the sound). Would this imply an issue with my wiring?

EDIT: Ok so it stays on until I plug in the keyboard (M0116). And if I unplug the keyboard it turns on again...

EDIT 2: I'm retarded. I was reading the wiring diagram as if I was looking down at the male end of the cable and not the female end... IT WORKS NOW.. TYPING WITH AN M0116 from my dad's old SE/30
Title: Re: ADB to USB keyboard converter
Post by: Blaise170 on Tue, 16 December 2014, 01:04:21
Nevermind.
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Fri, 19 December 2014, 13:33:04
Hey, fellow hackers.

I wrote up my experience this morning converting the Caps Lock to a momentary key. The highlight was that I accidentally pried the actual switch off the base! Luckily, it just broke the solder. I cleaned it up with my solder wick and re-situated it and soldered it back, good as new, but I got the lock pin out successfully.

http://zacbir.net/blog/2014/12/19/getting-control-over-caps-lock/ (http://zacbir.net/blog/2014/12/19/getting-control-over-caps-lock/)

Maybe it'll help anyone else stumped on this little procedure.
Title: Re: ADB to USB keyboard converter
Post by: loudaslife on Wed, 24 December 2014, 01:11:58
You can use PJRC Teensy or other dev board with ATMega32U4.

Does that mean it will work with the Leonardo Pro Micro? I'm worried the Arduino bootloader might mess something up. For the ultra-thrifty, a Pro Micro can be found for about half the cost of a teensy.

Edit: I am an idiot and somehow missed that part of the thread while I was skimming through. Disregard that.
Title: Re: ADB to USB keyboard converter
Post by: hwood34 on Mon, 05 January 2015, 21:21:53
Does anyone have a picture of a finished mod on an M0116? I'm seeing lots of pictures, but the cables on all them seem to have 3 wires, while mine has 4, differently colored wires
Title: Re: ADB to USB keyboard converter
Post by: tufty on Tue, 06 January 2015, 00:27:46
Expect 4 wires internally.  +5v, GND, ADB and PWR.  There will be 5 connections to the connector (it's shielded).  You want +5, GND and ADB.  PWR is the hard-wired power switch connection, ignore it.
Title: Re: ADB to USB keyboard converter
Post by: hwood34 on Tue, 06 January 2015, 13:50:35
Expect 4 wires internally.  +5v, GND, ADB and PWR.  There will be 5 connections to the connector (it's shielded).  You want +5, GND and ADB.  PWR is the hard-wired power switch connection, ignore it.
Ah, now looking back over this I get it. Ugh, still such a noob with this kind of stuff :))
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Wed, 07 January 2015, 14:30:54
I suspect this is doable, but am a bit lost amid the fragments of documentation in hasu's github code.

If you were to remap the Print Screen key to be a Fn key, would OS X interpret <Print Screen>-<F8> as Play/Pause automatically? If so, which key code would you use to represent the Fn key on an Apple USB/Bluetooth keyboard? There are KC_FN0 - KC_FN31, but nothing that seems to be a sole Fn key.

EDIT: To clarify, I know that I could simply wire up Scroll Lock to VOLD and Pause to VOLU, but I'm wondering about setting up a key as a modifier key to basically get media keys (and other OS X specific keys) using the AEKII.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 07 January 2015, 19:58:00
Not sure exactly what you want, but I guess you want to make Print Screen a momemtary'Layer switching' and have Play/Pause keycode on F8 key in another layer.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#31-momentary-switching
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Thu, 08 January 2015, 08:46:42
Not sure exactly what you want, but I guess you want to make Print Screen a momemtary'Layer switching' and have Play/Pause keycode on F8 key in another layer.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#31-momentary-switching


That's exactly what I was looking for! Thanks, hasu!
Title: Re: ADB to USB keyboard converter
Post by: zacbir on Fri, 09 January 2015, 09:14:29
Thanks, hasu!

Successfully reintroduced the media keys to my AEKII, and wrote it up: http://zacbir.net/blog/2015/01/08/in-media-res/
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Sat, 10 January 2015, 13:15:04
You wrote that any controller, based on ATMega32U4, can be used.

Do you happen to know if Arduino Leonardo http://arduino.cc/en/Main/arduinoBoardLeonardo suitable for this purpose?

It's just I can get it a lot cheaper than teensy in my country.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 10 January 2015, 13:25:10
You can use Leonardo without problem.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Sat, 10 January 2015, 13:43:17
You can use Leonardo without problem.

Thank you, hasu. It's just it's pins are marked somewhat different... you don't happen to know what pin I need to use for data? Analog a0? I won't have any problem with +5v and GND, but data...
(http://arduino.cc/en/uploads/Main/ArduinoLeonardoFront_2_450px.jpg)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 10 January 2015, 13:56:40
I don't remember. Just check its schematic yourself.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Sat, 10 January 2015, 15:30:22
I don't remember. Just check its schematic yourself.

OK. When I'll check it, I'll write if it's true :) I just hope I won't need to edit config... even if it's seems pretty easy.

P.S. Thank you for a great work.
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Mon, 12 January 2015, 16:44:16
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.
Title: Re: ADB to USB keyboard converter
Post by: Blaise170 on Mon, 12 January 2015, 19:20:34
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.

You'll need to compile the code on your own to get a .hex file. If you need a .hex file to load onto your Teensy I can try to look for mine but no guarantees.
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Mon, 12 January 2015, 20:05:40
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.

You'll need to compile the code on your own to get a .hex file. If you need a .hex file to load onto your Teensy I can try to look for mine but no guarantees.

I'd like to try doing that myself, but I don't know where to start or how :/
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Tue, 13 January 2015, 02:07:39
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.

You'll need to compile the code on your own to get a .hex file. If you need a .hex file to load onto your Teensy I can try to look for mine but no guarantees.

I'd like to try doing that myself, but I don't know where to start or how :/

I think this link is a beginning:

https://www.pjrc.com/teensy/gcc.html
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Tue, 13 January 2015, 03:03:38
Also, if anyone wants to use Arduino Leonardo, I found this pinout...

Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Tue, 13 January 2015, 03:07:57
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.

You'll need to compile the code on your own to get a .hex file. If you need a .hex file to load onto your Teensy I can try to look for mine but no guarantees.

I'd like to try doing that myself, but I don't know where to start or how :/

I think this link is a beginning:

https://www.pjrc.com/teensy/gcc.html
On second thought, if someone could find me the required code, that would be nice :P
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Tue, 13 January 2015, 10:02:23
OK, I flashed my Arduino Leonardo, and got ADB Keyboard converter in my devices (and keyboard with correct vid and pid), so I assume flash was OK... Tried to connect my AEKII with wires and pins to controller, and got nothing. Well... I suppose I'll try to do some soldering inside. And I guess Leonardo doesn't have any internal pull-out, so I'll get this 1 kohm resistor...
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 13 January 2015, 13:53:02
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.

Click to see video.
(http://i.imgur.com/Al956JGm.gif) (http://i.imgur.com/Al956JG.gif)
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Tue, 13 January 2015, 21:00:32
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.

Click to see video.
(http://i.imgur.com/Al956JGm.gif) (http://i.imgur.com/Al956JG.gif)
Is this being done in git shell?
Also, I'm confused what happens after the git clone has been made, when I type in $ cd and press enter after that step nothing happens
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 14 January 2015, 02:15:32
It is just bash.

Ah, maybe confusing. It is bash completion, I was pressing 'Ctrl-i' to get directory listing, not 'Enter'.
Video is not always useful, reading text is more clear in some situation.

https://github.com/tmk/tmk_keyboard/blob/master/README.md
https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Wed, 14 January 2015, 03:52:55
So I've got my teensy all soldered up, I ran the test program that makes the LED blink rapidly, and I'm ready to download the code. One problem: How do I do that? I can't seem to find a definitive "download here" button on the github page. I'm completely new to this, so if someone could make/find a video of someone downloading the code and uploading it to their teensy, I would be forever in their debt.
Oh, and I'm converting an M0116, if that's important.

Click to see video.
(http://i.imgur.com/Al956JGm.gif) (http://i.imgur.com/Al956JG.gif)
Is this being done in git shell?
Also, I'm confused what happens after the git clone has been made, when I type in $ cd and press enter after that step nothing happens

You can go there https://github.com/tmk/tmk_keyboard

And download zip-file with all project.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Thu, 15 January 2015, 11:21:20
Yes! It's alive! Thank you, Hasu.

Now I'm just need to solder my makeshift mock-up contraption together :)
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Sat, 17 January 2015, 12:34:46
I have a question. I have AEKII with AZERTY layout, and on this keyboard I have two buttons producing "\" symbol, first left of "1" button and producing scancode 226, and second right of " button, with scancode 220. Can I use one of them as fn button? And If I can, could anyone explaine, how?

UPDATE. I SHOULD have read all readme files first :) Got the second layer setted up with no problems (almost).

Again, thank you, hasu.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Sun, 18 January 2015, 12:16:13
Oh, when I tried to upload new hex file to my Arduino Leonardo, there were some troubles - i discovered that hasu's firmware, despite being great, caused arduino's serial port to conplete vanish from the system, so I had no way to upload newly conpiled hex-file (so I thought), but I found solution eventually. Here it is:

I reset the board so that the arduino bootloader appeared as a com port in my Device manager

I set the arduino IDE to use the port that appeared for the bootloader (by editing settings file)

I uploaded a simple sketch (led blinking) and pressed reset during the "upload phase" so that the port appeared during the upload

The upload completed successfully and the arduino was back in the com port list - after that I uploaded hex file successfully with Arduino Builder
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 18 January 2015, 17:16:29
Glad to hear it works for you!

Leonardo and its variants like pro micro uses software serial(USB CDC) unlike other normal Arduino's. If you use firmware makde by other than Arduino IDE you'll lose the serial connection during firmware is running. The software serial depends on fact that you are using Arduino library.

Meanwhile its bootloader can offer software serial line for flashing firmware. You can start bootloader by pressing reset button on the board whenever you like. Note that after 8 seconds the bootloader disappears and firmware starts automatically.

With Arduino firmware you can start bootloader from Arduino IDE without pressing reset button, Arduino IDE sends sepecial signal upon the serial line. With tmk firmware it is not useful to use Arduino IDE to flash firmware, use avrdude instead, or other tools.

Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Sun, 18 January 2015, 17:29:13
I'm still stuck :/
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 18 January 2015, 17:56:30
Go for it!

Or buy Griffin iMate to save your time. It is really a good option seriously.
Title: Re: ADB to USB keyboard converter
Post by: ShawnMeg on Mon, 19 January 2015, 00:39:28
https://drive.google.com/file/d/0By-yXJDisUbyTTFKUW1Scl9TUVE/view?usp=sharing (https://drive.google.com/file/d/0By-yXJDisUbyTTFKUW1Scl9TUVE/view?usp=sharing)

For what it's worth, here's my attempt at compiling and the resultant .hex file.  I hope this will help someone out.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 19 January 2015, 01:45:52
Glad to hear it works for you!

Leonardo and its variants like pro micro uses software serial(USB CDC) unlike other normal Arduino's. If you use firmware makde by other than Arduino IDE you'll lose the serial connection during firmware is running. The software serial depends on fact that you are using Arduino library.

Meanwhile its bootloader can offer software serial line for flashing firmware. You can start bootloader by pressing reset button on the board whenever you like. Note that after 8 seconds the bootloader disappears and firmware starts automatically.

With Arduino firmware you can start bootloader from Arduino IDE without pressing reset button, Arduino IDE sends sepecial signal upon the serial line. With tmk firmware it is not useful to use Arduino IDE to flash firmware, use avrdude instead, or other tools.

Thank you, hasu, now I understand. Yes, it's exactly so - after flashing firmware there were no Leonardo serial ports in system, so I had to flash it after pressing reset buttons. I just thought it not obvious, so I wrote about it here.

I use Arduino Builder for flashing - it's pretty easy to use.
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Mon, 19 January 2015, 10:09:59
GOT IT!!!!!
I have a fully working Apple M0116 now!!!!!
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 19 January 2015, 13:38:44
GOT IT!!!!!
I have a fully working Apple M0116 now!!!!!

Enjoy :) But why you couldn't compile the source? It's pretty easy, both on Linux and Windows.
Title: Re: ADB to USB keyboard converter
Post by: ShawnMeg on Mon, 19 January 2015, 14:40:11
GOT IT!!!!!
I have a fully working Apple M0116 now!!!!!

Enjoy :) But why you couldn't compile the source? It's pretty easy, both on Linux and Windows.

It's easy if you know what you are doing, but for novices it's not as straightforward.  I just happen to have some Linux and terminal/command line experience.  The initial post was a little confusing in that the github link didn't have a download link.  I had to click "tmk_keyboard" to get to a page where there was a link to download the zip. 
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Mon, 19 January 2015, 14:45:50
GOT IT!!!!!
I have a fully working Apple M0116 now!!!!!

Enjoy :) But why you couldn't compile the source? It's pretty easy, both on Linux and Windows.

It's easy if you know what you are doing, but for novices it's not as straightforward.  I just happen to have a some Linux and terminal/command line experience.  The initial post was little confusing in that the github link didn't have a download link.  I had to click "tmk_keyboard" to get to a page where there was a link to download the zip.
+1
If you've never done this before, it is extremely confusing.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Tue, 20 January 2015, 01:51:38
GOT IT!!!!!
I have a fully working Apple M0116 now!!!!!

Enjoy :) But why you couldn't compile the source? It's pretty easy, both on Linux and Windows.

It's easy if you know what you are doing, but for novices it's not as straightforward.  I just happen to have some Linux and terminal/command line experience.  The initial post was a little confusing in that the github link didn't have a download link.  I had to click "tmk_keyboard" to get to a page where there was a link to download the zip.

Well, that is true. Also, for compining it on windows you need some tools. I got them here:

https://www.pjrc.com/teensy/gcc.html

It's a good link for adding to the first post ;)

Oh, and if you using Windows 8 or 8.1 and keep getting errors instead of conpiling, you'll probably need to replace this file in compiler directory somewhere:
Title: Re: ADB to USB keyboard converter
Post by: ShawnMeg on Tue, 20 January 2015, 09:01:47
GOT IT!!!!!
I have a fully working Apple M0116 now!!!!!

Enjoy :) But why you couldn't compile the source? It's pretty easy, both on Linux and Windows.

It's easy if you know what you are doing, but for novices it's not as straightforward.  I just happen to have some Linux and terminal/command line experience.  The initial post was a little confusing in that the github link didn't have a download link.  I had to click "tmk_keyboard" to get to a page where there was a link to download the zip.

Well, that is true. Also, for compining it on windows you need some tools. I got them here:

https://www.pjrc.com/teensy/gcc.html

It's a good link for adding to the first post ;)

Oh, and if you using Windows 8 or 8.1 and keep getting errors instead of conpiling, you'll probably need to replace this file in compiler directory somewhere:

Thanks.  That's a great link, and should be added to the original post about compiling.  Or someone should make a sticky about how to compile, for beginners.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Fri, 23 January 2015, 12:03:34
Hmm... Anyone knows if I can to power on my PC with the power key on AEKII keyboard, or this is just not possible?
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Fri, 23 January 2015, 12:33:56
Hmm... Anyone knows if I can to power on my PC with the power key on AEKII keyboard, or this is just not possible?
I don't think so, I was wondering the same thing about my m0116.
On another note, does anyone know of a way to fix the fact that the m0116 only has 2 key rollover?
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Fri, 23 January 2015, 14:11:00
Hmm... Anyone knows if I can to power on my PC with the power key on AEKII keyboard, or this is just not possible?
I don't think so, I was wondering the same thing about my m0116.
On another note, does anyone know of a way to fix the fact that the m0116 only has 2 key rollover?

Nope. It's not IBM Model F... 2KRO is all you get.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Sun, 25 January 2015, 13:16:31
Hmm... Anyone knows if I can to power on my PC with the power key on AEKII keyboard, or this is just not possible?
Nope.  Power on functionality was done using the power key as a hard wired "on" switch for the PSU. That's what that extra wire in the ADB cable is all about.

On another note, does anyone know of a way to fix the fact that the m0116 only has 2 key rollover?
Not without manually rewiring the matrix to incorporate diodes, completely removing the ADB controller, and wiring the new matrix direct to the teensy, then using either hasu or soarer's firmware.  Totally do-able, the PCB is single sided so all you'd need to do is cut some traces and solder some diodes in, but you'd remove any way of ever making it "authentic" again if you care about that.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 26 January 2015, 09:28:34
Hmm... Anyone knows if I can to power on my PC with the power key on AEKII keyboard, or this is just not possible?
Nope.  Power on functionality was done using the power key as a hard wired "on" switch for the PSU. That's what that extra wire in the ADB cable is all about.

I know about original functionality, but in all other ways it works like regular key and I use it for powering my PC off (as I included this function in my layout).
It's just I had one USB keyboard with power key I could power my PC with... But I guess with USB you stick to option your motherboard gives you :)
Title: Re: ADB to USB keyboard converter
Post by: Hak Foo on Tue, 27 January 2015, 23:24:09
You can also use that kind of key to power the PC on... but the BIOS has to support it.  You might want to check for a "wake on USB" option .
Title: Re: ADB to USB keyboard converter
Post by: neex on Wed, 18 February 2015, 21:00:16
I'm trying to get this to work with a couple of Apple Extended Keyboards (M0115).

When I connect the keyboard to my computer through the Teensy 2.0, all three LEDs on the keyboard light up for a brief moment.  Then they go dim (about half brightness) and remain at that level indefinitely.  The keyboard is totally unresponsive.

Thanks.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 19 February 2015, 00:10:49
It is worth checking your wiring again.
Title: Re: ADB to USB keyboard converter
Post by: neex on Thu, 19 February 2015, 09:48:12
Ok, I did.  I re-soldered it to the Teensy and, this time, pushed the stripped ends of the wires directly into the appropriate holes of the ADB socket (which I can confirm works with my Griffin iMate).  Still behaving the same: all three LED lights steady dim and keyboard unresponsive (and, by the way, this is happening with both of my M0115s).

Needless to say I'm confident the wiring is good (but I'm willing to play with it some more if there are no other options).

A question about compiling:

I installed Crosspack (and restarted computer/Terminal), but when I tried to execute the "make" command in Terminal the output told me I needed to install Xcode.  I then installed Xcode and compiled (seemingly successfully).  So what's the point of Crosspack if Xcode is what is needed (or, are they both needed)?  Could it have compiled incorrectly?

Thanks.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Thu, 19 February 2015, 11:48:16
Ok, I did.  I re-soldered it to the Teensy and, this time, pushed the stripped ends of the wires directly into the appropriate holes of the ADB socket (which I can confirm works with my Griffin iMate).  Still behaving the same: all three LED lights steady dim and keyboard unresponsive (and, by the way, this is happening with both of my M0115s).

Needless to say I'm confident the wiring is good (but I'm willing to play with it some more if there are no other options).

A question about compiling:

I installed Crosspack (and restarted computer/Terminal), but when I tried to execute the "make" command in Terminal the output told me I needed to install Xcode.  I then installed Xcode and compiled (seemingly successfully).  So what's the point of Crosspack if Xcode is what is needed (or, are they both needed)?  Could it have compiled incorrectly?

Thanks.

Hmm, are you sure you put wires into appropriate holes? Maybe you had +5v and Data reversed?

And do you have pull-up resistor?
Title: Re: ADB to USB keyboard converter
Post by: MontyElephant on Thu, 19 February 2015, 21:35:56
Is it possible to add macros built into the converter. Such as for the F keys so I don't need to transfer hotkey scripts to each computer?

Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 20 February 2015, 16:08:49
neex, you can see device whose VID:PID is FEED:0ADB on your system if firmware is uploaded properly.

MontyElephant, see these.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#23-macro-action
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L219
Title: Re: ADB to USB keyboard converter
Post by: neex on Sun, 22 February 2015, 15:34:07
Hmm, are you sure you put wires into appropriate holes? Maybe you had +5v and Data reversed?

Yes, everything is wired correctly, including the vcc and data.

And do you have pull-up resistor?

Yes-- it's a 1000 ohm 1/2 watt.  Thanks for prompting me to check this connection, though--it was not solid, but I fixed it.  Unfortunately, the keyboard still isn't working.  Without the resistor, the three lights on the keyboard are steady dim.  With the resistor, they are off, but the keyboard still is not functional.

neex, you can see device whose VID:PID is FEED:0ADB on your system if firmware is uploaded properly.

Thanks.  I was able to verify the the firmware did upload correctly.  I just can't get any response from the keyboard.

(https://farm9.staticflickr.com/8610/16430780099_bbb75de4e3.jpg)
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 23 February 2015, 00:54:35
Hmm, are you sure you put wires into appropriate holes? Maybe you had +5v and Data reversed?

Yes, everything is wired correctly, including the vcc and data.

And do you have pull-up resistor?

Yes-- it's a 1000 ohm 1/2 watt.  Thanks for prompting me to check this connection, though--it was not solid, but I fixed it.  Unfortunately, the keyboard still isn't working.  Without the resistor, the three lights on the keyboard are steady dim.  With the resistor, they are off, but the keyboard still is not functional.

neex, you can see device whose VID:PID is FEED:0ADB on your system if firmware is uploaded properly.

Thanks.  I was able to verify the the firmware did upload correctly.  I just can't get any response from the keyboard.


Did you try this with a single keyboard, or several ones?
Title: Re: ADB to USB keyboard converter
Post by: neex on Mon, 23 February 2015, 08:47:06
Did you try this with a single keyboard, or several ones?

I have two (2) Apple M0115s.  I've tried both.  Same results.

Again, both work properly with the Griffin iMate.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 23 February 2015, 09:41:07
Did you try this with a single keyboard, or several ones?

I have two (2) Apple M0115s.  I've tried both.  Same results.

Again, both work properly with the Griffin iMate.

Then it's something with your wiring, your firmware or your Mac. I'd recommend you try it with another computer - it it works, then it's something with your Mac.

I include my compiled hex file which definitely works, so you can try to load it, if step one woudn't work.

P.S. Heh, you're lucky one to get two AEK - so far I couldn't get one in my country and it's too expensive to ship overseas :)
Title: Re: ADB to USB keyboard converter
Post by: neex on Tue, 24 February 2015, 18:59:16
Then it's something with your wiring, your firmware or your Mac. I'd recommend you try it with another computer - it it works, then it's something with your Mac.

I include my compiled hex file which definitely works, so you can try to load it, if step one woudn't work.

It's still not working.  I uploaded your copy of the hex file (thanks for that).  I also tried it with both my MacBook Air and Mac mini.

So, for good measure I'll check/re-solder the wiring in the morning.  Although, I remain confident my wiring is good.

In the meantime, is there anyone who can confirm whether they've gotten this to work specifically with the M0115 model?

One other thing... I did run the HID Listen program.  It printed the following over and over until I terminated:

adb_host_kbd_recv: ERROR(-30)

I appreciate the ongoing help.  I really hope to figure this out!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 24 February 2015, 19:23:14
That error occurs in case converter cannot comminicate with keyboard.
With all due respect, I'm suspecting your wiring, post detailed photos of your work(Teensy and connector) so that we can double check it.
Title: Re: ADB to USB keyboard converter
Post by: neex on Tue, 24 February 2015, 19:55:34
That error occurs in case converter cannot comminicate with keyboard.
With all due respect, I'm suspecting your wiring, post detailed photos of your work(Teensy and connector) so that we can double check it.

(https://farm8.staticflickr.com/7284/16639722665_12379513ba.jpg)

(https://farm8.staticflickr.com/7286/16639722115_169e86ecd5.jpg)

(https://farm8.staticflickr.com/7289/16017422554_fbea741b0f.jpg)

(https://farm9.staticflickr.com/8670/16432427097_9562b5c6b3.jpg)

(https://farm8.staticflickr.com/7282/16017420794_4d52320354.jpg)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 24 February 2015, 20:05:32
Use D0 pin unless you want to edit config.h yourself.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Wed, 25 February 2015, 02:40:29
That error occurs in case converter cannot comminicate with keyboard.
With all due respect, I'm suspecting your wiring, post detailed photos of your work(Teensy and connector) so that we can double check it.

De-solder wire from F0 on Teensy and solder it to D0. It should work right after that.

Or, if you want, you can edit file config.h in directory adb_usb. Find the section

/* ADB port setting */
#define ADB_PORT        PORTD
#define ADB_PIN         PIND
#define ADB_DDR         DDRD
#define ADB_DATA_BIT    0

And replace PORTD PIND and DDRD with PORTF PINF and DDRF respectively, then recompile firmware and upload it.

(that if you don't want to re-solder)

But - it was written about PD0 pin by default right in the first post.
Title: Re: ADB to USB keyboard converter
Post by: neex on Wed, 25 February 2015, 17:53:58
Thanks!  Working now!  Don't know why I used F0... sorry to have wasted anyone's time.

BTW, this is a great hack.  I can't wait to get my keyboard back together!  Since I had everything disassembled, I started the process of doing a retrobright to the case (but it's taking a while because the weather here has been dreary and I do not have a UV lamp).  I also got a nicer braided nylon USB cable that I plan to run through one of the two round holes for the original ADB jacks.  So that the hole would more snugly fit the narrower USB cable, I made a custom small black plastic bushing, which I hope will help keep dust and critters out of my keyboard.  I'll post pics when I'm finished.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 25 February 2015, 21:32:34
Great.

Yes, post the result of your work. People including me like to see pics of DIY keyboard work.
Title: Re: ADB to USB keyboard converter
Post by: neex on Sat, 14 March 2015, 15:17:57
Finished!! Retrobright turned out looking good:
(https://farm9.staticflickr.com/8623/16786074426_9715e93996.jpg)

Closed off left side where ADB jack used to be:
(https://farm9.staticflickr.com/8745/16810848141_56d160215f.jpg)

Smaller hole on right side for USB cable:
(https://farm9.staticflickr.com/8754/16811949005_383aae61ea.jpg)

Short nylon USB cable:
(https://farm8.staticflickr.com/7584/16810843992_7852f8d6b5.jpg)

New rubber feet:
(https://farm8.staticflickr.com/7633/16624571220_e6066a1111.jpg)

The guts:
(https://farm8.staticflickr.com/7604/16624394088_75f9cb23c5.jpg)
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Sat, 14 March 2015, 15:41:47
Finished!! Retrobright turned out looking good:

Not bad at all. It's a pity you had to remove adb sockets... but I guess it's easer to conceal controller inside of keyboard case. I made an external one, but so far didn't made a case for it :)

By the way - it's a pretty good retrobright. What you used for it?
Title: Re: ADB to USB keyboard converter
Post by: neex on Sun, 15 March 2015, 09:48:22
Retrobright was a mix of Oxy Clean, over-the-counter hydrogen peroxide, and glycerine.  It actually took about 5-6 half-day long treatments.

I wanted to remove the ADB sockets from this one since I just don't think I'd ever use them again—but from a purist standpoint, I understand the regret.  I got this keyboard, however, from an elementary school, and it was really abused before I got it.  You wouldn't notice it from my photos, but it was obviously dropped more than once.  One corner has a significant crack.  There are other significant scratches and scuffs on the case.  For me, there was little incentive to preserve the original condition of the keyboard.

Plus, like I said, I have another, which is in far better cosmetic condition.  I plan to make a ADB-to-USB cable for it... eventually.  I've got an old AlphaSmart USB/ADB cable that has a nice little case in-line that I plan to gut and use to house the Teensy (the unmodified AlphaSmart doesn't work with keyboards, in case you were wondering).

Now I need to get to the bottom of a new problem: one key is unresponsive (specifically the "1/!").  Another (the "+" on the numpad) types 1-3 characters per keypress.  Thoughts?

EDIT: Pics of the AlphaSmart:
(https://farm8.staticflickr.com/7639/16202886013_848b8e387f.jpg)
(https://farm9.staticflickr.com/8573/16200463244_5febf0e3bd.jpg)
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Sun, 15 March 2015, 11:00:45
Now I need to get to the bottom of a new problem: one key is unresponsive (specifically the "1/!").  Another (the "+" on the numpad) types 1-3 characters per keypress.  Thoughts?

Switches are dirty inside. Or there are something bended inside. Or there are some problems with soldering. Or there are something happened with traces on PCB.

Well, I almost sure there are some conductive dirt inside Numpad +.
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Tue, 17 March 2015, 05:03:17

EDIT: Pics of the AlphaSmart:
Show Image
(https://farm8.staticflickr.com/7639/16202886013_848b8e387f.jpg)

Show Image
(https://farm9.staticflickr.com/8573/16200463244_5febf0e3bd.jpg)


Oh, nice one. You can solder inside Teensy or Arduino, and get your own universal ADB adapter.
Title: Re: ADB to USB keyboard converter
Post by: Papkee on Sun, 29 March 2015, 20:24:11
Okay, so I've got the hardware side of my A9M0330 (which I believe is the same as the M0116?) wired up. I'm clueless to the software side - I know my way around C decently but I cannot for the life of me figure out how to set up the library so that it works with this keyboard.

Here's what I already tried. The readme seems outdated and mentions files that don't exist, and doesn't tell you how to specify what keyboard you're compiling for.

Navigate to adm_usb directory and make - compiled OK

Upload code to teensy - uploaded OK

But I get no response from the keyboard. I checked with HID_Listen and it shows that a keyboard is connected and does not throw any errors at me. (earlier I was getting -30 due to a bad connection) However, typing does not produce any response.

EDIT:

I made my own keymap, named it keymap_papkee and used make KEYMAP=papkee

No keys work still, EXCEPT for the power key up top, which actually does put my computer to sleep.

Now things are getting really weird.

Would really appreciate some help with this.
Title: Re: ADB to USB keyboard converter
Post by: ch3wt0ys on Mon, 30 March 2015, 07:25:45
I need a bit of help with this. Found a Apple Extended Keyboard II (amongst other Apple keyboards and computers) in my garage, but this was the only one with switches and got lucky with it being the USA made with Cream Alps switches.

But, seems every tutorial I see on making a ADB -> USB converter is based around the Teensy and I happen to have a Arduino Micro ATMEGA32u4, which was given to me while back.

Bit of a novice I suppose lol. Any help would be appreciated, just want to get this keyboard working so I can get back to my finger workouts that have been put on hold since elementary school.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 30 March 2015, 14:17:05
Papkee,
post pic of you hardware, pics are always useful and save time of both side of us.
Which part of README is outdated? Let me know, I'll fix it.
hmm, power key only works? weird.

ch3wt0ys,
Arduino Mircro works, but I dont think tutorial is available. You need to learn yourself.
Title: Re: ADB to USB keyboard converter
Post by: Papkee on Mon, 30 March 2015, 15:36:39
Papkee,
post pic of you hardware, pics are always useful and save time of both side of us.
Which part of README is outdated? Let me know, I'll fix it.
hmm, power key only works? weird.

Without changing any wiring or code, it seems to just work now. All keys function fine, and I can use custom keymaps perfectly.

The outdated part I was referring to was the way in which keymaps are made and used - the readme mentions keymap.c inside of adb_usb which is not used any more. Additionally I feel it could be a bit more explanatory as to how keymaps are selected and used. It took me a while before I figured out what parts of what files needed to be changed.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 30 March 2015, 16:11:43
I see, I'll fix.
To me writing English sentences takes much more time than coding. Could you make idea of the explation?
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Tue, 31 March 2015, 15:41:13
I need a bit of help with this. Found a Apple Extended Keyboard II (amongst other Apple keyboards and computers) in my garage, but this was the only one with switches and got lucky with it being the USA made with Cream Alps switches.

But, seems every tutorial I see on making a ADB -> USB converter is based around the Teensy and I happen to have a Arduino Micro ATMEGA32u4, which was given to me while back.

Bit of a novice I suppose lol. Any help would be appreciated, just want to get this keyboard working so I can get back to my finger workouts that have been put on hold since elementary school.

I've used Arduino Pro Micro and wrote about it. If you need help with pins, read the thread.
Title: Re: ADB to USB keyboard converter
Post by: doodersbrother on Sun, 05 April 2015, 21:07:32
I just got a apple adjustable keyboard (m1242) and built this converter! It works well although it seems to requires the numpad be plugged in to be used, is there something that I am missing??
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 05 April 2015, 22:37:39
hmm, I'm a bit confused. You mean, adjustable keyboard doesn't work without numpad? This is against what I expect.(EDIT: or I read you wrongly)

This converter doesn't support ADB 'daisy chain' connection. So you cannot use both adjustable keyboard and numpad at a time. And buttons at righ side of adjustable keyboard also aren't supported.

Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 06 April 2015, 02:12:40
hmm, I'm a bit confused. You mean, adjustable keyboard doesn't work without numpad? This is against what I expect.(EDIT: or I read you wrongly)

This converter doesn't support ADB 'daisy chain' connection. So you cannot use both adjustable keyboard and numpad at a time. And buttons at righ side of adjustable keyboard also aren't supported.

My friend, who sold me my AEKII, has this Apple adjustable KB. He made two converters to be able use Numpad and KB simultaneously.
Title: Re: ADB to USB keyboard converter
Post by: Yoe on Mon, 06 April 2015, 05:08:42
Just throwing some pictures in if anyone is interested in seeing finished stuff.. :) Pro Micro clone and an ADB connector from a M0118. Housing is from a RJ45 F-F connector thing.

[attach=1][attach=2]
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 06 April 2015, 05:29:13
Just throwing some pictures in if anyone is interested in seeing finished stuff.. :) Pro Micro clone and an ADB connector from a M0118. Housing is from a RJ45 F-F connector thing.

(Attachment Link) (Attachment Link)

Thats... Cool. Of course we're interested!
Title: Re: ADB to USB keyboard converter
Post by: doodersbrother on Mon, 06 April 2015, 09:10:12
hmm, I'm a bit confused. You mean, adjustable keyboard doesn't work without numpad? This is against what I expect.(EDIT: or I read you wrongly)

This converter doesn't support ADB 'daisy chain' connection. So you cannot use both adjustable keyboard and numpad at a time. And buttons at righ side of adjustable keyboard also aren't supported.

Daisy chaining the keyboard and the numpad is the only way that I have been able to get it to work. Both will work at the same time off of one converter!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 06 April 2015, 23:53:37
Hmm, very interesting.
I have an adjustable keyboard but no numpad and confirmed that the keyboard solely works with converter.
Adjustable keyboard should work without numpad.
Title: Re: ADB to USB keyboard converter
Post by: doodersbrother on Tue, 07 April 2015, 16:06:58
What ohm resistor are you using?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 07 April 2015, 17:41:12
I dont' remember, maybe 1K?

Post pic of your converter and its wiring so that I and the community can double-check.
It doesn't seems like your problem is that simple but posting pic is still very helpful on both side of us.


From the first post,
Quote
NEED HELP?
Your converter doesn't work?
Frist, post pics of your hardware and wriring this really save time of us. Don't save your time by omitting this.

If you edit code
Post your code. Don't hesitate to show your dirty code!
Title: Re: ADB to USB keyboard converter
Post by: doodersbrother on Tue, 07 April 2015, 18:17:08
http://imgur.com/Y5NxKWx
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 07 April 2015, 18:32:25
From the pic I'm not sure that resistor works properly as pull-up.
Are you sure about the pull-up resistor? Pull-up resistor should be connected between 5V and signal line, not inline of singal line.

Title: Re: ADB to USB keyboard converter
Post by: doodersbrother on Tue, 07 April 2015, 18:40:03
That sounds like it's it! Thanks tons! Any idea why that made daisy chaining work??
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 07 April 2015, 18:51:33
I've never tested multiple keyboard with 'daisy chain' connection and though it desn't work so far.
But I'm testing two ADB keyboards and it looks like they work, against my expectation, LOL.

This converter does not assign/change device's address to handle multiple devices and use default address instead. This means multiple keyboards have same address and I thought this causes some error in ADB communication, but it seems like I was wrong. At least two keyboads work with daisy chain.
Title: Re: ADB to USB keyboard converter
Post by: XMIT on Mon, 13 April 2015, 14:43:21
I'm more active on "the other forum" but did spend some time this weekend playing with TMK for ADK keyboards.

Keyboards I tried:
IIGS - Apple Desktop Bus keyboard (IIgs keyboard)
AK - Apple Keyboard (Macintosh SE keyboard)
AEK II - Apple Extended Keyboard II
AAK - Apple Adjustable Keyboard

Findings:
- AAK works okay without pullup resistors. All others work okay with 10k pullup.
- "Sparkfun Pro Micro" is an inexpensive ATmega32u4 board that works great here. I had to make sure this was in my Makefile:
Code: [Select]
MCU = atmega32u4- To program from a Mac I added this to my Makefile (and yes your port will probably differ)
Code: [Select]
# Program Sparkfun Pro Micro using avrdude
PROGRAM_CMD = avrdude -p $(MCU) -P /dev/cu.usbmodem1421 -c avr109 -U flash:w:$(TARGET).hex
- AAK's volume adjust buttons do not work. I wonder if they can be remapped.
- AK's numeric keypad is all wrong. It may need a special key map. Pressing numeric keypad buttons gets letters instead of numbers.

Overall I'm ecstatic that this works and willing to deal with / fix these last quirks. I'm going to try the M0110 converter as soon as my RJ10 cable arrives. Thank you hasu for the great work!

I'd also like to add support for additional protocols once I work my way through my collection. I have a bunch of weird old terminal keyboards that I would like to convert.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 13 April 2015, 18:50:49
Quote
- AAK's volume adjust buttons do not work. I wonder if they can be remapped.
- AK's numeric keypad is all wrong. It may need a special key map. Pressing numeric keypad buttons gets letters instead of numbers.
IIRC, Adjustable keyboard has logically two keyboard instances, one for main alpha part and other for those buttons. As I said previously TMK doesn't support handling multiple ADB keyboards properly, I think you need to implement proper ADB address management.

AK is M0116? M0116 including numpad works well at least on my side.
Title: Re: ADB to USB keyboard converter
Post by: NoahBC on Mon, 20 April 2015, 17:03:58
I have an M0116, and I'd like to map the numpad to F keys by default, and use the locking capslock switch as a numlock instead. Is this possible? If I map that key to FN0 instead of LCAP, will anything bad happen?

I.e. this code:

EDIT: This works! If you have an m0116 or similar (i.e. IIGS or ADB 2) this should work for you too! Save it to keymap_m0116.c and compile with "make KEYMAP=m0116"

Code: [Select]
#include "keymap_common.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Default Layer: plain keymap
     *                     +-------+
     *                     | power |
     *                     +-------+
     * |----------------------------------------------------------.   ,---------------.
     * |ESC|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa|   |Ins|Hom|End|Mut|
     * |-----------------------------------------------------------|   |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|     |   | F7| F8| F9|Vl+|
     * |-----------------------------------------------------|     |   |---------------|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return  |   | F4| F5| F6|Vl-|
     * |-----------------------------------------------------------|   |---------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |   | F1| F2| F3|   |
     * |-----------------------------------------------------------|   |-----------|Ent|
     * | FN0| Alt| Gui| ` |       Space        | \ |Lef|Rig|Up |Dwn|   |  F10  | . |   |
     * `-----------------------------------------------------------'   `---------------'
     */
    KEYMAP_M0116_ANSI(
            PWR,
    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS,HOME, END,MUTE,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,          F7,  F8,  F9,  VOLU,
    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,      F4,  F5,  F6,  VOLD,
    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,     F1,  F2,  F3,
    FN0,LALT,LGUI,GRV,         SPC,               BSLS,LEFT,RIGHT,DOWN,UP,     F10,      PDOT,PENT
    ),

    /* Default Layer: plain keymap
     *                     +-------+
     *                     | power |
     *                     +-------+
     * ,-----------------------------------------------------------.   ,---------------.
     * |ESC|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa|   |Ins| = | / | * |
     * |-----------------------------------------------------------|   |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|     |   |  7|  8|  9| + |
     * |-----------------------------------------------------|     |   |---------------|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return  |   |  4|  5|  6| -|
     * |-----------------------------------------------------------|   |---------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |   |  1|  2|  3|   |
     * |-----------------------------------------------------------|   |-----------|Ent|
     * | FN0| Alt| Gui| ` |       Space        | \ |Lef|Rig|Up |Dwn|   |  0    | . |   |
     * `-----------------------------------------------------------'   `---------------'
     */
    KEYMAP_M0116_ANSI(
            PWR,
    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, EQL, PSLS,PAST,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,          P7,  P8,  P9,  PMNS,
    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,      P4,  P5,  P6,  PPLS,
    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,     P1,  P2,  P3,
    FN0,LALT,LGUI,GRV,         SPC,               BSLS,LEFT,RIGHT,DOWN,UP,     P0,       PDOT,PENT
    ),
};

const uint16_t PROGMEM fn_actions[] = {
    [0] = ACTION_LAYER_MOMENTARY(1),                // Layer activate!
};

edit: hah nope that doesn't work at all. Capslock now gives me this character for some reason: ΕΕΕΕΕΕΕΕΕΕΕΕΕΕΕ

edit2: oh, I guess it would help if I actually told it what FN0 was supposed to do, huh? Updated code, now it works!!

Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 20 April 2015, 18:03:23
I'm sure this is completely possible, read keymap document.
It doesn't seems your keymap is correct, you will need to have FN0 definition, at least.
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Mon, 27 April 2015, 09:57:07
Mf dad just bought a storage locker with a bunch of old ADB keyboards, so I'm trying to build converters. However, while I have basic functionality working great whenever I hit the caps lock key it causes both keyboards (the ADB board and my custom board that also uses TMK) to start go crazy and send random keys. Here's what I built using a teensy 2.0:

(http://i.imgur.com/WyPHZ1B.jpg)

All I changed in the code is what pin the DATA wire is connected to and I made sure that all keymaps use LCAP.

Code: [Select]
diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h
index 5ce5c22..9c325d5 100644
--- a/converter/adb_usb/config.h
+++ b/converter/adb_usb/config.h
@@ -48,7 +48,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define ADB_PORT        PORTD
 #define ADB_PIN         PIND
 #define ADB_DDR         DDRD
-#define ADB_DATA_BIT    0
+#define ADB_DATA_BIT    5
 //#define ADB_PSW_BIT     1       // optional

 /* key combination for command */
diff --git a/converter/adb_usb/keymap_hasu.c b/converter/adb_usb/keymap_hasu.c
index f2e59b3..a0b3f1f 100644
--- a/converter/adb_usb/keymap_hasu.c
+++ b/converter/adb_usb/keymap_hasu.c
@@ -22,7 +22,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
     GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,FN0,      DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
-    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
+    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
     LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
     LCTL,LGUI,LALT,          SPC,                               RGUI,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
     ),
@@ -47,7 +47,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
     ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,      INS, HOME,PGUP,    NLCK,BTN1,BTN2,BTN3,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   PSCR,SLCK,PAUS,UP,  INS, FN0,      DEL, END, PGDN,    WH_D,MS_U,WH_U,WH_D,
-    CAPS,VOLD,VOLU,MUTE,F,   G,   H,   J,   HOME,PGUP,LEFT,RGHT,     ENT,                         MS_L,MS_D,MS_R,WH_U,
+    LCAP,VOLD,VOLU,MUTE,F,   G,   H,   J,   HOME,PGUP,LEFT,RGHT,     ENT,                         MS_L,MS_D,MS_R,WH_U,
     LSFT,Z,   X,   C,   V,   B,   N,   M,   END, PGDN,DOWN,          RSFT,          PGUP,         WH_L,MS_D,WH_R,
     LCTL,LGUI,LALT,          SPC,                               RGUI,RCTL,     HOME,PGDN,END,     BTN1,     BTN2,BTN3
     ),

I don't get any messages in hid_listen when I do this, and at this point am at a loss. This happens with an M3501 and an M0487. Any ideas?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 27 April 2015, 16:28:50
Lokcing Capslock(LCAP) works with M0116 and IIGS keyboard on my side.

To get help message press  Power + h.
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Mon, 27 April 2015, 20:02:40
Is there any way to change the magic key? On my mac the power key actually does something, making it impractical to use for this purpose.

I also attempted to wire a different teensy up directly with the same result:

(http://i.imgur.com/yF4SanH.jpg)

So I replaced the locking switch with a matias switch, loaded a firmware with locking turned off, and I have the same problem. When I press caps lock the keyboard goes crazy.

Next I decided to start eliminating variables, so I unplugged my custom keyboard that also uses the TMK firmware... and now everything works perfectly. I can use both converters with either locking or non-locking keys. Any idea why having another TMK keyboard plugged in would be interfering?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 27 April 2015, 20:18:57
Ah I see, probably LOCKING_RESYNC is the cause. Comment out LOCKING_RESYNC_ENABLE.

I think you both of two keyboards are configured with enabling locking resync. This feature doesn't work in situation that  multiple keyboards with the function are connected, I found this fact just now :D
One keyboard sends capslock then other finds capslock state was changed against its will and sends capslock to correct the state and vice vesa. This continues endlessly. LOL I'll file the problem in gihtub issue tracker.


EDIT:
I'm curious about what it happens actually in this situation. Can you explain it and what is your OS?
Quote
When I press caps lock the keyboard goes crazy.
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Mon, 27 April 2015, 20:44:43
That makes sense, but I still have the problem even after I #undef LOCKING_SUPPORT_ENABLE and LOCKING_RESYNC_ENABLE for both keyboards. The problem goes away if I change CAPS to LCTL on the adb converter, so it's definitely something related to the behavior of CAPS/LCAPS. Could those defines be getting turned on somewhere else in TMK, overriding my config.h?

If we can't solve this I can live with only having one or the other plugged in at once. I appreciate your time looking into it.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 27 April 2015, 21:09:29
Hmm, I got into the conclusion too quickly. After checking source code closely 'Locking resync' feature seems to work correctly in that situation.

OK. We will need to start over to check the problem from the begining.

Can you describe the problem in the detail?
Quote
When I press caps lock the keyboard goes crazy.


What is your OS? Don't you use keymap softwares on OS?

The custom keyboad seems to be a cause of the problem.
How does your custom keyboards look like in fact? Posting pics and source github code repository will be very helpful.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 27 April 2015, 21:52:19
Mouse is supported by mek-apelsin (https://github.com/tmk/tmk_keyboard/pull/207) NOW


(http://i.imgur.com/WNOhMbwh.jpg?1)


Enjoy!
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Mon, 27 April 2015, 22:15:29
I'm on Maverics (OS X 10.9) and I do have Karabiner running, but I don't think that would interfere. I only have a few rules:

(http://i.imgur.com/3flc0Pn.png)

My custom keyboard is a modification of the gh60 firmware. I haven't gotten it onto github yet but here's a diff between the gh60 and mine:

https://gist.github.com/anonymous/b3d6e0654a1e03c37f43

The problem, as best as I can describe it:

When you have both keyboards plugged in, everything works great until you press caps lock. At that point the keyboard starts sending a sequence of keys over and over, most often something similar to this:

^[[D]=

Here's what I was able to capture with a bit of hid_listen, but keep in mind that the computer went to sleep several times during this session because the mac actually listens to the power button and went to sleep.

https://gist.github.com/anonymous/cf0db36bef87a7d50f64
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 27 April 2015, 22:56:52
I'm wondering  what the trigger of the problem is.
Both LCAP and CAPS of ADB keyboard can cause the problem? If so Locking feature doesn't seems to be a culprit.
Can LCAP or CAPS of the custom keyboard also cause the problem?

Are you having NKRO enabled on keyboards? If so disable it and see if the problem sitll appears.
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Mon, 27 April 2015, 23:10:55
Yes, both LCAP and CAPS can trigger this. I don't have any CAPS on my custom keyboard, I will try adding one tomorrow to see what happens. Tonight is family time and while we're all on laptops in the living room, that's not in my office where I can repro this. :)

I did not specifically enable or disable NKRO, it's whatever the default is. I will try that out in the morning.
Title: Re: ADB to USB keyboard converter
Post by: Red_dino on Tue, 05 May 2015, 21:52:26
This works with Windows 7, right? In my first attempt this evening I was unable to get it working. The lights on my Apple Extended (m0115) came on but Windows wasn't recognizing it as a keyboard. If I can't figure it out by this weekend, I'll post code and pics.
Title: Re: ADB to USB keyboard converter
Post by: Red_dino on Wed, 06 May 2015, 15:52:24
Typing this on my Apple now! I went to read what exactly a pull up resistor does and realized I had put the resistor from vcc to ground instead of vcc to data. >.< Thanks for making this happen hasu!
Title: Re: ADB to USB keyboard converter
Post by: afischer on Sat, 16 May 2015, 19:26:29
Hey everyone,

First want to say thanks to everyone who has contirbuted to this project. It's awesome.

I'm trying to build a ADB to USB converter using a teensy 2.0 for the AEKII. After building and using the teensy loader, the only thing I can get the keyboard to do is flash it's LEDs and make my mouse move to the upper left corner of the screen... Any help would be appreciated.

I love the keyboard and would like to get it working asap!
Title: Re: ADB to USB keyboard converter
Post by: Blaise170 on Sat, 16 May 2015, 19:40:59
Hey everyone,

First want to say thanks to everyone who has contirbuted to this project. It's awesome.

I'm trying to build a ADB to USB converter using a teensy 2.0 for the AEKII. After building and using the teensy loader, the only thing I can get the keyboard to do is flash it's LEDs and make my mouse move to the upper left corner of the screen... Any help would be appreciated.

I love the keyboard and would like to get it working asap!

Post your pictures of the wiring.
Title: Re: ADB to USB keyboard converter
Post by: afischer on Sat, 16 May 2015, 21:08:20
Here are some photos. Yeah, my soldering isn't great, but all the wires are making contact.

(http://imgur.com/iqMWJba)
(http://i.imgur.com/Sml0Xft.jpg)

Running hid_listen.mac, I get the following:

adb_host_kbd_recv: ERROR(-30)

Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 16 May 2015, 21:32:56
Pin usage of Teensy side looks OK. And soldering is not great but it also looks OK to me.
Probably you have wrong/bad connection of wire and resistor. Check it again. Or post pic of ADB connector side.

Many people have had wrong wirings for some reason so far. So we usually suspect your wiring first :D
Title: Re: ADB to USB keyboard converter
Post by: afischer on Sun, 17 May 2015, 08:42:21
Hey hasu,

Thanks for the awesome work. Thanks for checking my work.

I'm actually just using male jumper pins  as shown in the photos. I wanted to test that it would work before soldering.

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: afischer on Sun, 17 May 2015, 12:17:00
So I just attempted to build and upload to the teensy on a PC to see If the same thing happens - it does. Even **Without** the keyboard plugged into the teensy, the teensy moves my computers mouse to the top left corner over and over again.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 17 May 2015, 16:17:10
Looks like the wiring is wrong. And it better has resistor. Did you read readme and see this figure?


Code: [Select]
female socket from the front:
  ,--_--.                 
 / o4 3o \      1: DATA
| o2   1o |     2: Power SW
 -  ===  -      3: VCC
  `-___-'       4: GND
Title: Re: ADB to USB keyboard converter
Post by: afischer on Sun, 17 May 2015, 17:24:17

Looks like the wiring is wrong. And it better has resistor. Did you read readme and see this figure?


Code: [Select]
female socket from the front:
  ,--_--.                 
 / o4 3o \      1: DATA
| o2   1o |     2: Power SW
 -  ===  -      3: VCC
  `-___-'       4: GND

Yeah, I looked at the readme.

I don't see what's wrong with the wiring? It still does the mouse thing with or without the resistor The image is rotated.
Title: Re: ADB to USB keyboard converter
Post by: afischer on Mon, 18 May 2015, 15:46:06
I Found the problem!!

It was a badly soldered pull up resistor. Re-soldering it did the trick!  :p

Now all I have to do is fix the broken period and "f" keys.... :(
Title: Re: ADB to USB keyboard converter
Post by: taiwanesekid05 on Thu, 21 May 2015, 05:55:11
When I try to compile the converter in Cygwin, I get this error:

Code: [Select]
/usr/bin/sh: dfu-programmer: command not found
/usr/bin/sh: dfu-programmer: command not found

-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


mkdir -p obj_adb_usb_lufa/common
Compiling C: ../../tmk_core/common/keymap.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DADB_MOUSE_MAXACC=8 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DADB_MOUSE_ENABLE -DMOUSE_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_adb_usb_lufa/common/keymap.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/protocol -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_adb_usb_lufa_common_keymap.o.d  ../../tmk_core/common/keymap.c -o obj_adb_usb_lufa/common/keymap.o
../../tmk_core/common/keymap.c: In function 'action_for_key_default':
../../tmk_core/common/keymap.c:37: error: parameter 'keycode' is initialized
../../tmk_core/common/keymap.c:37: error: 'layer' undeclared (first use in this function)
../../tmk_core/common/keymap.c:37: error: (Each undeclared identifier is reported only once
../../tmk_core/common/keymap.c:37: error: for each function it appears in.)
../../tmk_core/common/keymap.c:37: error: 'key' undeclared (first use in this function)
../../tmk_core/common/keymap.c:38: error: expected declaration specifiers before 'switch'
../../tmk_core/common/keymap.c:109: error: expected declaration specifiers before '}' token
../../tmk_core/common/keymap.c:113: error: expected declaration specifiers before '__attribute__'
../../tmk_core/common/keymap.c:120: error: expected declaration specifiers before '__attribute__'
../../tmk_core/common/keymap.c:129: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
../../tmk_core/common/keymap.c:162: error: expected declaration specifiers before '__attribute__'
../../tmk_core/common/keymap.c:170: error: expected declaration specifiers before '__attribute__'
../../tmk_core/common/keymap.c:190: error: old-style parameter declarations in prototyped function definition
../../tmk_core/common/keymap.c:189: error: expected '{' at end of input
../../tmk_core/common/keymap.c:189: warning: no return statement in function returning non-void
make: *** [obj_adb_usb_lufa/common/keymap.o] Error 1

Anyone know why this might be happening?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 21 May 2015, 06:34:07
Get the latest source from github again.

Pull request I merged today caused that error and I reverted it.
Title: Re: ADB to USB keyboard converter
Post by: taiwanesekid05 on Thu, 21 May 2015, 16:07:43
Ah, it complies now.  Thank you Hasu!

Edit: I seem to have another problem now.  After I load the .hex onto the Teensy 2.0 and restart it, my cursor immediately goes to the top left hand corner of my screen and continues to go back up there even after I move the mouse.  And the keyboard doesn't work.  Any idea why this might be happening?
Title: Re: ADB to USB keyboard converter
Post by: urbanredfox on Mon, 25 May 2015, 00:24:12
taiwanesekid05,

Do you use a mouse? I had this issue while doing some coding and didn't have one plugged in. I downloaded a fresh copy from git hub at it worked so I'm not sure what exactly is going on there. If you don't use an ADB mouse you could also try commenting out the MOUSE_KEY_ENABLE option in the Makefile and see if it goes away.
Title: Re: ADB to USB keyboard converter
Post by: FattyFatty2by4 on Tue, 26 May 2015, 16:42:34
Sorry, I had a problem but it's sorted out now.
Title: Re: ADB to USB keyboard converter
Post by: taiwanesekid05 on Thu, 28 May 2015, 09:25:16
taiwanesekid05,

Do you use a mouse? I had this issue while doing some coding and didn't have one plugged in. I downloaded a fresh copy from git hub at it worked so I'm not sure what exactly is going on there. If you don't use an ADB mouse you could also try commenting out the MOUSE_KEY_ENABLE option in the Makefile and see if it goes away.

I tried commenting out MOUSEKEY_ENABLE with no avail.  I make'd while having my mouse plugged in and that did nothing.  And a fresh download from GitHub didn't help either.  I should also add that not only does plugging in the Teensy force the keyboard to go to the upper lefthand corner, but also that none of the keys on my Apple Extended Keyboard II work. 
Title: Re: ADB to USB keyboard converter
Post by: tufty on Thu, 28 May 2015, 09:36:12
Did you try reading the previous page of the thread?  Specifically, the post immediately before your first post on the thread?
Title: Re: ADB to USB keyboard converter
Post by: superbia on Sun, 14 June 2015, 15:19:40
My homebrew attempt to make my own adb-usb converter using an stm32 micro gloriously failed :rolleyes:

Now I just ended up ordering an arduino clone with 32u4 for 5$...
I hope everything will work this time  :eek: while waiting it to arrive...
Title: Re: ADB to USB keyboard converter
Post by: mougrim on Mon, 15 June 2015, 03:11:10
My homebrew attempt to make my own adb-usb converter using an stm32 micro gloriously failed :rolleyes:

Now I just ended up ordering an arduino clone with 32u4 for 5$...
I hope everything will work this time  :eek: while waiting it to arrive...

It will.
Title: Re: ADB to USB keyboard converter
Post by: phosphoric on Mon, 15 June 2015, 11:57:29
no clue about c language or anything at all, but ghosting with jkl; is pretty common - was mashing these keys in notepad just to play with the 3-key rollover and p popped up a couple of times. thought i would leave a note here - not sure if i'm contributing at all, but documentation is documentation
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 15 June 2015, 19:30:25
I can't know why you leave the note here :D
Ghost occurs in matrix of keyboard not converter, keyboard has responsibility for handling ghost.

BTW, I never noticed phantom keys on my ADB keyboards, I think they have decent ghost block.
Title: Re: ADB to USB keyboard converter
Post by: phosphoric on Tue, 16 June 2015, 16:50:03
haha! this is why i post here. i'm still fairly new to the world of mechanical keyboards (and keyboard tech in general) so i learn from peoples' replies  ;D
Title: Re: ADB to USB keyboard converter
Post by: FattyFatty2by4 on Tue, 16 June 2015, 20:52:49
Apologies for the rather long reply.

Apparently this is a new problem and it may have been sorted out for other people.
I've already soldered all of the components to the teensy and keyboard, I've checked my soldering and it's all clean, (I even tested it with a multimeter.) So then I do all of the technical steps, get my .hex file and upload it to the teensy through teensyloader. It goes asking around through windows update and all that, then once it's found the device, my mouse cursor moves to the top left of my monitor. I cannot move it back unless I unplug the teensy. I've tried it with 3 other mice but the problem persists. No LEDs on the keyboard light up, even though there's a current going through. It also does not type any keystrokes. I've tried it with 2 other proven-working .hex files and the same thing happens, except the mouse cursor works fine.

I have soldered wires directly to the PCB as seen in the pictures below. (The green wire is not connected to anything.) Here's the wiring:
RED: Data (Connected to D0)
WHITE: +5v (Connected to lower VCC)
BLACK: Ground (Connected to lower GND)
There is a 1k resistor connected on the bottom of the board to +5v and Data.
*UPDATE* I have taken off the 1k resistor to see if that was causing the problem. It still happens even when there's no resistor connected.

I'm fairly sure that my soldering is fine and I've even resoldered them because my previous attempt was poorly done. Just to be on the safe side, would you mind telling me if my soldering has any faults in it?

Unfortunately, the keyboard is from a brand that doesn't exist now and I cannot find much info about it. It's a Mac-101 E keyboard from DataDesk International. 1 month before attempting this project, it worked quite well with the Mac Quadra 660AV it was connected to.

Back to the issue, I used Cygwin to make a .hex file and I think I did it right. Here's the code:
$ cd /cygdrive/c/users/admin/desktop/tmk_keyboard/converter/adb_usb
$ make clean
$ make

I got a .hex file which I mounted onto the Teensy, and then my cursor goes to the top left and the keyboard doesn't work. I saw the previous posts and I've tried every single thing there. Still doesn't work... :(

Thanks in advance.
Title: Re: ADB to USB keyboard converter
Post by: tufty on Wed, 17 June 2015, 12:34:03
If you're not seeing LEDs on the keyboard, my guess would be that you're not connected correctly at the keyboard end.  Specifically, IIRC, the Mac101 should have a power indicator LED.  If that's not lighting up, you're not giving the keyboard power, or, more correctly, are giving it power at the wrong pin.

That otherwise unconnected green wire, for example, looks like it goes to the ground plane.  Check the keyboard end, paying careful attention to where the ADB connectors are and where the pins connect to.  A good bet would be to wire your teensy to a cut-in-half ADB or S-video cable, and then connect it externally to the board via its built-in ADB ports.

It's easy to read the ADB pinout back to front.  If you're tracing from a back-to-front pinout, you would expect things to fail interestingly; that swaps power with gnd, and adb with the power switch.
Title: Re: ADB to USB keyboard converter
Post by: FattyFatty2by4 on Wed, 17 June 2015, 19:28:40
I think you may be right. I'll try to reverse the pins and see what happens.

*UPDATE*
Thank you so much. I reversed the pins and it works great. Funny I hadn't thought of that before.
Title: Re: ADB to USB keyboard converter
Post by: chuchana on Sun, 21 June 2015, 10:28:13
Does uploading the firmware change the bootloader? I wanted to upload a new version of the firmware to the Arduino and I cannot see the port anymore (it used to be /dev/cu.usbmodem1421).
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 21 June 2015, 16:52:57
It depends on how you upload, with ISP connector bootloader will be removed while it will be there if you upload with normal Aruduino method.
Title: Re: ADB to USB keyboard converter
Post by: chuchana on Fri, 03 July 2015, 12:35:16
Thank you for your answer and for the project!

I have uploaded it directly as I could not find how to upload it via Arduino. Is there documentation on how to do that?
Title: Re: ADB to USB keyboard converter
Post by: superbia on Fri, 03 July 2015, 15:10:55
Quick start for people who bought 32u4 arduino clones on ebay (5$):

1. get avrdude (for flashing)  :thumb:
2. make the software, as hasu sugested  :thumb:
2. use avrdude to flash the firmware
2.b note: you need to press "reset" once, than fast 2 times to get into bootloader (or if you dont have the button short RST and GND pins), so you need to short it total of 3 times  :thumb:
2.c dont wait long and use this command to flash it $ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_lufa.hex:i          ( replace /dev/ttyACM0 with your port)  :thumb:

After that, you may will find some keys working and some not, i suggest you make your own layout, as hasu documented.
I had to try my layout like 4 times to get it right, because half of modifier keys wer either swaped or not working, and i also decided to swap caps and ctrl in the end....
Pretty easy, i hope i helped somebody... Btw. i used it on french azerty aekii  :thumb:
Title: Re: ADB to USB keyboard converter
Post by: 88slides on Mon, 06 July 2015, 11:24:13
After spending about a week testing things, I still have the same issue. Whenever I attach the +5V cable from the teensy to the keyboard, my Macbook Pro shuts down the connection with a popup saying "Unplug the device using too much power to re-enable USB devices." The keyboard is the only thing plugged into my computer.

Any ideas?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 06 July 2015, 13:28:55
Seems like something goes wrong on connection of power line and it makes short circuit.
Or perhpas the keyboard is extremely power hog. What is your keyboard?

From first post...
Quote
NEED HELP?
Your converter doesn't work?
Frist, post pics of your hardware and wriring this really save time of us. Don't save your time by omitting this.

If you edit code
Post your code. Don't hesitate to show your dirty code!
Title: Re: ADB to USB keyboard converter
Post by: ShawnMeg on Mon, 06 July 2015, 17:05:04
Quick start for people who bought 32u4 arduino clones on ebay (5$):

1. get avrdude (for flashing)  :thumb:
2. make the software, as hasu sugested  :thumb:
2. use avrdude to flash the firmware
2.b note: you need to press "reset" once, than fast 2 times to get into bootloader (or if you dont have the button short RST and GND pins), so you need to short it total of 3 times  :thumb:
2.c dont wait long and use this command to flash it $ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_lufa.hex:i          ( replace /dev/ttyACM0 with your port)  :thumb:

After that, you may will find some keys working and some not, i suggest you make your own layout, as hasu documented.
I had to try my layout like 4 times to get it right, because half of modifier keys wer either swaped or not working, and i also decided to swap caps and ctrl in the end....
Pretty easy, i hope i helped somebody... Btw. i used it on french azerty aekii  :thumb:

http://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html (http://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html)

According to this tutorial, you may not need to do step 2b above if the pro Micro is new and hasn't been flashed before.  The tutorial says that it'll go into bootloader mode once plugged in.  I'm about to make a converter, but awaiting for all the parts to arrive.
Title: Re: ADB to USB keyboard converter
Post by: ShawnMeg on Sun, 12 July 2015, 21:57:39
--
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 12 July 2015, 22:33:17
I don't thnk it breaks your keyboard and converter but not completely sure.
I guess It works as far as you don't use power key, which is normally pulled-up to VCC and pulled down to GND when pressed.

Title: Re: ADB to USB keyboard converter
Post by: taiwanesekid05 on Sat, 18 July 2015, 00:14:23
Did you try reading the previous page of the thread?  Specifically, the post immediately before your first post on the thread?

I did put in a 1K resistor, it produced the same problem.  So I removed the resistor, same problem.  Resoldered the resistor, same problem.  I'm not sure if it's something I'm doing wrong, or something worse.  I've attached some photos so maybe someone can let me know what I'm doing wrong.  Nothing is currently permanently soldered from the Teensy to the keyboard, so that's why I just have wires sticking out of the ADB plug.  I think I've put everything in the right place (Data to the 1 hole, VCC to the 3 hole, and Ground to the 4 hole) but I'm not 100% sure. 
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 19 July 2015, 04:27:55
Did you check README and the first post of this thread? The latest source is configured to use D0 for data. If you want to use F0 you have to change config.h.
Title: Re: ADB to USB keyboard converter
Post by: taiwanesekid05 on Sun, 19 July 2015, 17:29:07
Did you check README and the first post of this thread? The latest source is configured to use D0 for data. If you want to use F0 you have to change config.h.

Ahh... that was the issue... I based my soldering off of photos I saw and wasn't 100% sure if that was the issue.  The converter works perfectly now.  Thanks a lot Hasu!
Title: Re: ADB to USB keyboard converter
Post by: applekey2 on Sun, 30 August 2015, 11:43:09
I have about 400 ADB keyboards and about 400 adb mice in brand new condition. I need to design and make a adb to usb converter that has an adb plug on one side and a usb plug on the other side. I need to make something in bulk and cost efficient.  Anyone have suggestions? I want to make something similar to the ps2 to usb converter ? Would the same chip work? Any suggestions?
Title: Re: ADB to USB keyboard converter
Post by: superbia on Mon, 31 August 2015, 11:06:28
I have about 400 ADB keyboards and about 400 adb mice in brand new condition. I need to design and make a adb to usb converter that has an adb plug on one side and a usb plug on the other side. I need to make something in bulk and cost efficient.  Anyone have suggestions? I want to make something similar to the ps2 to usb converter ? Would the same chip work? Any suggestions?

First, you are doing something commercial.

Secondly, you can't just assume people will design the pcb, write the software, arrange the manufacturing and ship 400 converters to you.
Thirdly, check the licencing on the firmwares/tools you gonna use, best of luck.
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Mon, 07 September 2015, 23:58:20
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?
Title: Re: ADB to USB keyboard converter
Post by: Yoe on Tue, 08 September 2015, 01:10:13
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?

You can use the tap key function in TMK and use a non modifier key of choice. I have used the escape key for this in my keyboards and adapters. When just pressing and releasing the escape key, you get escape, but keep it pressed and you activate the fuction layer. As an example, this is what keymap_iso.c looks like in my ADB to USB adapters:

Code: [Select]
#include "keymap_common.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_EXT_ISO(
    FN0, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   PWR,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PEQL,PSLS,PAST,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,ENT,      DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,                             P4,  P5,  P6,  PPLS,
    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RSFT,          UP,           P1,  P2,  P3,
    LCTL,LALT,LGUI,          SPC,                               RALT,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),


    KEYMAP_EXT_ISO(
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,           TRNS, TRNS, TRNS,                      TRNS,
    TRNS, F1,   F2,   F3,   F4,   F5,   F6,   F7,   F8,   F9,   F10,  F11,  F12,   DEL,     TRNS, TRNS, TRNS,    TRNS, TRNS, TRNS, TRNS,
    PWR,  TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,     TRNS, TRNS, TRNS,    TRNS, TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                                TRNS, TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPRV, MNXT, MUTE, VOLD, VOLU, TRNS,       TRNS,           PGUP,          TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS,             MPLY,                               TRNS, TRNS,           HOME, PGDN, END,     TRNS,       TRNS, TRNS
    ),

};

const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_TAP_KEY(1, KC_ESC),
};
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Tue, 08 September 2015, 10:46:38
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?

Personally I plan to replace the caps lock switch with a non-locking switch and that can be my fn key. Then it's just a matter of configuring a function layer in keymap_<whatever>.c.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 09 September 2015, 18:37:44
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?

Current default keymap is very plain and has no function layer, you need to define your own keymap.

Instead you can use my keymap, you can access function layer by holding down backslash key.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap_hasu.c

Build firmware like this.
Code: [Select]
make KEYMAP=hasu
Title: Re: ADB to USB keyboard converter
Post by: tufty on Fri, 11 September 2015, 02:28:39
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?

Personally I plan to replace the caps lock switch with a non-locking switch and that can be my fn key. Then it's just a matter of configuring a function layer in keymap_<whatever>.c.
Thats what I did.  Numbers row -> function keys, arrows -> home end pgup pgdn, keypad +- -> volume keys, etc.

(well out of date) https://github.com/tufty/tmk_keyboard/blob/master/converter/adb_usb/keymap_tufty.c

2 key rollover is hardware level.  You won't beat that without rewiring the matrix
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Sat, 12 September 2015, 14:10:26
I designed an adaptor that fits inside the AEKII case and replaces one of the ADB ports. I just got my prototypes back however it looks like I made a mistake and specified .1uf instead of 1uf for the UCAP cap, and I left out the VBUS/VCC cap entirely. I can program the board but when I attempt to use it I get this from hid_listen:

Code: [Select]
adb_host_kbd_recv: ERROR(-30)

When I run the teensy blinky program on my board the LED blinks too quickly to make out the morse code. This leads me to believe that specifying an incorrect cap and leaving out one cap has thrown off the timing the atmega uses enough to break the ADB protocol. I have ordered some 1uf caps and will attempt to replace them, but while I wait for that can anyone tell me if my hypothesis seems correct?

My schematic, if that will help in answering, can be found here (http://i.imgur.com/iUNXulO.png).
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 12 September 2015, 19:58:21
Sorry if I'm treating you as a too noob.

First did you read the first post of this thread?

Your schematic looks good to me and you should have correct caps on UVCC pin. Check chip datasheet, I think you need 10% tolerant good caps I usually use a 10% X5R cap. But I dont think the caps causes your problem.

Teensy has a LED on different port from your board. Did you change blinky code properly?

Probably your wiring of ADB lines have someting wrong.
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Sat, 12 September 2015, 22:40:44
Sorry if I'm treating you as a too noob.

First did you read the first post of this thread?

I never mind when people check the basics. It saves times if there's something I missed. I have read the first post and the tmk_keyboard/converter/adb_usb/README.md many times.

Your schematic looks good to me and you should have correct caps on UVCC pin. Check chip datasheet, I think you need 10% tolerant good caps I usually use a 10% X5R cap. But I dont think the caps causes your problem.

Thanks for double-checking. That's the updated schematic with corrected caps, so it's good to know that it looks good to you. The caps are YAGEO2/CC0603KRX7R9BB104 CAP CER 0.1UF 50V 10% X7R 0603 so should be within spec. The 1uf's I have on the way are also 10%.

Teensy has a LED on different port from your board. Did you change blinky code properly?

I did change the blinky code properly, the LED turns on it just flashes with improper timing. These are the only differences between the two blinky.hex's I tried:

Code: [Select]
--- blinky-teensy.c 2015-09-12 20:06:23.000000000 -0700
+++ blinky-adaptor.c 2015-09-12 19:49:58.000000000 -0700
@@ -30,8 +30,8 @@

 // Teensy 2.0: LED is active high
 #if defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB1286__)
-#define LED_ON (PORTD |= (1<<6))
-#define LED_OFF (PORTD &= ~(1<<6))
+#define LED_ON (PORTF |= (1<<0))
+#define LED_OFF (PORTF &= ~(1<<0))

 // Teensy 1.0: LED is active low
 #else

Probably your wiring of ADB lines have someting wrong.

The only thing I can think of here is that for some reason my pull-up resistor doesn't work in the current configuration. You can see the trace for the DATA line very clearly, it's the one to the right of the U1 silkscreen text, and on the back of the board are the traces that go to the via's that connect R4 between that pin and VCC:

(http://i.imgur.com/5M9bgAq.jpg)

(http://i.imgur.com/lPlXvAI.jpg)

I'm using this resistor: VD2/CRCW06031K00FKEA RES SMD 1K OHM 1% 1/10W 0603

My meter reads perfect continuity between the pin on the atmega and pin 1 on the adb connector on the other side.
Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Sat, 12 September 2015, 23:01:20
One more quick data point, I have a teensy I wired up to the same pin as my adaptor (F4) and the teensy works perfectly, while my adaptor does not.

(http://i.imgur.com/JDIoDAj.jpg)

When I measured I had continuity between F4 on the teensy and F4 on my adaptor's atmega while plugged in that way. I also had continuity between VCC and GND on the teensy and various points on the adaptor.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 13 September 2015, 01:26:31
As for blinky you'll also need to set   the pin as output with DDRF somewhere.

And F4-F7 pins are not used as general IO by default. They are used for JTAG interface . You have to disable JTAG before use.
See tmk FAQ entry on github or check datasheet.
Teensy chip is configured with chip fuse settings at factory so you don't have to.

Title: Re: ADB to USB keyboard converter
Post by: skullydazed on Sun, 13 September 2015, 08:55:10
That was it! Thanks for helping me get this going.

I didn't even know that TMK had that FAQ or the wiki, and I've been looking at these pages for months now. Change blindness or similar I suppose. It might help to put a link to the FAQ and/or wiki in the README.md rather than only in the first page of this post, after a while I started to assume the content was the same between that and the first page of this thread.

(And now I have a bunch of NOTEs to read in the issue tracker, lots of great background there.)
Title: Re: ADB to USB keyboard converter
Post by: powaa on Wed, 16 September 2015, 05:43:29
Hi,

I managed to get my M0116 working with this adapter through a pro micro, wiring is all correct. Infact I'm typing this post on it. So thankyou so much for the firmware

I was wondering if I could get help with my keymap. EVerything works except for the 1st function layer that changes the numberpad to mimic the home cluster and the arrow keys, the second function layer for Fkeys works beautifully so I dont understand what I'm doing wrong.

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  /* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Ctrl|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,   DEL, EQL, PSLS,NLCK,
    TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC,       P7,  P8,  P9,  PPLS,
    LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,   ENT,  P4,  P5,  P6,  PMNS,
    LSFT,  Z, X, C, V, B, N, M, COMM,  DOT, SLSH, RSFT,  P1,  P2,  P3,
    FN1,LALT,LGUI,GRV,   SPC,   BSLS,LEFT,RGHT,DOWN,UP,  P0,       FN2,PENT
  ),
  /* Layer 1 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,   TRNS,                 INS, HOME, PGUP, MUTE,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                      DEL, END,PGDN, VOLU,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,                  TRNS, UP, TRNS,   VOLD,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,                   LEFT,DOWN,RGHT,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, CALC,PSCR,SLCK,BRK,                            TRNS,     TRNS,    TRNS
  ),
 
    /* Layer 2 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12,          TRNS,                 TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,      TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,   TRNS, TRNS, TRNS,   TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,      TRNS,TRNS, TRNS,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,              TRNS,     TRNS,    TRNS
  ),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1),
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
/*copied and edited from tufty's keymap
*/

Thanks in advance.

Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 16 September 2015, 15:30:47
I didn't even know that TMK had that FAQ or the wiki, and I've been looking at these pages for months now. Change blindness or similar I suppose. It might help to put a link to the FAQ and/or wiki in the README.md rather than only in the first page of this post, after a while I started to assume the content was the same between that and the first page of this thread.

Indeed, I'll update README and check other documentations again some later.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 16 September 2015, 15:38:17
FN1 should be ACTION_LAYER_MOMENTARY(1) because the left bottom key of M0116 has mechanical locking switch and it toggles layer with its own function, you don't need TOGGLE action in this case.

Hi,

I managed to get my M0116 working with this adapter through a pro micro, wiring is all correct. Infact I'm typing this post on it. So thankyou so much for the firmware

I was wondering if I could get help with my keymap. EVerything works except for the 1st function layer that changes the numberpad to mimic the home cluster and the arrow keys, the second function layer for Fkeys works beautifully so I dont understand what I'm doing wrong.

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  /* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Ctrl|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,   DEL, EQL, PSLS,NLCK,
    TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC,       P7,  P8,  P9,  PPLS,
    LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,   ENT,  P4,  P5,  P6,  PMNS,
    LSFT,  Z, X, C, V, B, N, M, COMM,  DOT, SLSH, RSFT,  P1,  P2,  P3,
    FN1,LALT,LGUI,GRV,   SPC,   BSLS,LEFT,RGHT,DOWN,UP,  P0,       FN2,PENT
  ),
  /* Layer 1 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,   TRNS,                 INS, HOME, PGUP, MUTE,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                      DEL, END,PGDN, VOLU,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,                  TRNS, UP, TRNS,   VOLD,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,                   LEFT,DOWN,RGHT,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, CALC,PSCR,SLCK,BRK,                            TRNS,     TRNS,    TRNS
  ),
 
    /* Layer 2 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12,          TRNS,                 TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,      TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,   TRNS, TRNS, TRNS,   TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,      TRNS,TRNS, TRNS,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,              TRNS,     TRNS,    TRNS
  ),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1),
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
/*copied and edited from tufty's keymap
*/

Thanks in advance.


Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Wed, 16 September 2015, 16:25:33
Oh that's cool, I wish I had function keys. Is there any way I can update or reflash my teensy while it is already soldered into a project? I'd love to reflash it to include the right code to make the power button a function key so that I can finally use F keys.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 16 September 2015, 18:29:47
Yes, Teensy(and many alternatives) is still reflashable via USB even after soldered and assembled.
Title: Re: ADB to USB keyboard converter
Post by: powaa on Thu, 17 September 2015, 00:27:01
Sorry, I think you misunderstand

the caps lock latch has been removed and currently works as tap (see code) (although I have swapped caps and ctrl it swaps them itself, I dont know but it works). My issue is that when the power button is pressed (FN2) it is meant to toggle the numberpad so it has arrow keys and home cluster, however this does not happen. it works fine otherwise .
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Thu, 17 September 2015, 12:49:57
Thanks Hasu, Blargg and everyone else on this thread that helped.

I'm typing on a lovely condition AEKII thanks to this lovely converter.

:)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 17 September 2015, 15:41:22
Confused.

Quote
EVerything works except for the 1st function layer that changes the numberpad to mimic the home cluster and the arrow keys, the second function layer for Fkeys works beautifully so I dont understand what I'm doing wrong.

It says '1st function layer'(Layer 1) is issue and 'the second function layer'(Layer 2) works, right?
Did I read incorectly? Long English sentese is hard to understand to me :p


Sorry, I think you misunderstand

the caps lock latch has been removed and currently works as tap (see code) (although I have swapped caps and ctrl it swaps them itself, I dont know but it works). My issue is that when the power button is pressed (FN2) it is meant to toggle the numberpad so it has arrow keys and home cluster, however this does not happen. it works fine otherwise .

Your issue is Layer 2(FN2) now?
But I think I understand your problem, In default config.h 'Power button' is used as 'magic command' trigger key, you can't use it for your usage unless you change the config.
https://github.com/tmk/tmk_keyboard#magic-commands

Easy workaround is disable 'magic command' in Makefile. Comment out the following line with '#'.
Code: [Select]
COMMAND_ENABLE = yes

Other is that you define your own IS_COMMAND macro in config.h. See the file in other projects also.
Code: [Select]
#define IS_COMMAND() ( \
    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) \
)
Title: Re: ADB to USB keyboard converter
Post by: powaa on Thu, 17 September 2015, 21:50:51
Sorry, Its a bit confusing because computers start at 0 while the real world starts counting at 1.

I have moved FN2 to the period on the numberpad so I don't have to play around with the power key.

In my code I have commented in all caps what I think it is meant to do and where (obviously not because its not working) :P.

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  /* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Ctrl|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   *FROM WHAT I UNDERSTAND FN2 (WHICH IS CURRENTLY SET AS PERIOD ON THE NUMBERPAD) ACTIVATES THE TOGGLE COMMAND I HAVE LABELED AT THE BOTTOM
   */
  KEYMAP_M0116_ANSI(
    NO,
    ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,   DEL, EQL, PSLS,NLCK,
    TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC,       P7,  P8,  P9,  PPLS,
    LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,   ENT,  P4,  P5,  P6,  PMNS,
    LSFT,  Z, X, C, V, B, N, M, COMM,  DOT, SLSH, RSFT,  P1,  P2,  P3,
    FN1,LGUI,LALT,GRV,   SPC,   BSLS,LEFT,RGHT,DOWN,UP,  P0,       FN2,PENT
  ),
  /* Layer 1 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   *THIS LAYER IS MEANT TO ACTIVATE WHEN I TOGGLE FN2
   */
  KEYMAP_M0116_ANSI(
    TRNS,
    ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,   TRNS,                 INS, HOME, PGUP, MUTE,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                      DEL, END,PGDN, VOLU,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,                  TRNS, UP, TRNS,   VOLD,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,                   LEFT,DOWN,RGHT,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, CALC,PSCR,SLCK,BRK,                            TRNS,     TRNS,    TRNS
  ),
 
    /* Layer 2 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    NO,
    ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12,          TRNS,                 TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,      TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,   TRNS, TRNS, TRNS,   TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,      TRNS,TRNS, TRNS,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,              TRNS,     TRNS,    TRNS
  ),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
/*copied from tufty's keymap
*/

sorry for the confusion
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 17 September 2015, 22:13:51
Ah, you alreadly answered your problem yourself :D
You define only FN0 and FN1 but you are using undefined FN2.

I'd recommend you use this GCC C language extenstion in your keymap definition.
https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html#Designated-Inits

Voila, far less confusing now.
Code: [Select]
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Layer 0 */
    [0] =  KEYMAP_M0116_ANSI(.....

    /* Layer 1 */
    [1] =  KEYMAP_M0116_ANSI(.....
    ....
};

const uint16_t PROGMEM fn_actions[] = {
    [1] = ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
    [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
Title: Re: ADB to USB keyboard converter
Post by: tominabox1 on Fri, 18 September 2015, 06:44:22
Hasu - I'd like to use Scroll Lock as a layer indicator, can you help? I have not found anyone who has done this.
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Fri, 18 September 2015, 09:48:52
Hasu - I'd like to use Scroll Lock as a layer indicator, can you help? I have not found anyone who has done this.

Oh, that would be handy.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 18 September 2015, 11:49:25
This helps you?
http://deskthority.net/viewtopic.php?t=11569
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Fri, 18 September 2015, 12:09:11
This helps you?
http://deskthority.net/viewtopic.php?t=11569

It appears that it will, I'll look this weekend.

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Fri, 18 September 2015, 23:12:20
Anybody have a hex code for the firmware with the power button used to switch layers and the number row F keys? I've been staring at the page for a few hours and its like I'm trying to read Greek, I'm so utterly lost. I have no idea how you people do this stuff, it is so confusing to me.
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Sat, 19 September 2015, 19:25:15
Anybody have a hex code for the firmware with the power button used to switch layers and the number row F keys? I've been staring at the page for a few hours and its like I'm trying to read Greek, I'm so utterly lost. I have no idea how you people do this stuff, it is so confusing to me.

What are you attempting to do?

I have my power button acting as a layer toggle, but I don't understand what you wrote:
Quote
...power button used to switch layers and the number row F keys?

Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Sun, 20 September 2015, 00:26:15
Anybody have a hex code for the firmware with the power button used to switch layers and the number row F keys? I've been staring at the page for a few hours and its like I'm trying to read Greek, I'm so utterly lost. I have no idea how you people do this stuff, it is so confusing to me.

What are you attempting to do?

I have my power button acting as a layer toggle, but I don't understand what you wrote:
Quote
...power button used to switch layers and the number row F keys?
Yeah, my power button acts currently acts as a power button. What I'm trying to do is have it switch layers to another layer that changes the number row to F1-F12
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Sun, 20 September 2015, 10:29:37

Anybody have a hex code for the firmware with the power button used to switch layers and the number row F keys? I've been staring at the page for a few hours and its like I'm trying to read Greek, I'm so utterly lost. I have no idea how you people do this stuff, it is so confusing to me.

What are you attempting to do?

I have my power button acting as a layer toggle, but I don't understand what you wrote:
Quote
...power button used to switch layers and the number row F keys?
Yeah, my power button acts currently acts as a power button. What I'm trying to do is have it switch layers to another layer that changes the number row to F1-F12

Oh ok, no problem.

I'll write up what you need when I'm back at my machine.
Easy fix. 
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Sun, 20 September 2015, 12:45:44

Anybody have a hex code for the firmware with the power button used to switch layers and the number row F keys? I've been staring at the page for a few hours and its like I'm trying to read Greek, I'm so utterly lost. I have no idea how you people do this stuff, it is so confusing to me.

What are you attempting to do?

I have my power button acting as a layer toggle, but I don't understand what you wrote:
Quote
...power button used to switch layers and the number row F keys?
Yeah, my power button acts currently acts as a power button. What I'm trying to do is have it switch layers to another layer that changes the number row to F1-F12

Oh ok, no problem.

I'll write up what you need when I'm back at my machine.
Easy fix.
Really? oh my word thank you so much! You are a life saver! Also, I dont want to ask too much, but is there any way you can keep the Alt Key intact in the layer with the F keys? I need it so I can use shortcuts and stuff
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Sun, 20 September 2015, 19:18:14
Layout is here (that what you wanted?):
https://github.com/tjweir/octagon_hex/blob/master/mrsquishy/keymap_squishy.c

.hex of above layout:
https://github.com/tjweir/octagon_hex/blob/master/mrsquishy/adb_usb_lufa.hex

Cool?

Edit: Derp, I noticed I swapped GUI and ALT on the layer.  I'll change that now and update.
Edit 2: Fixed.
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Sun, 20 September 2015, 19:58:17
I don't know if I did that right but whatever I did would cause the keyboard to spit out different characters than what I pressed when I press the magic key and it wont switch back
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Sun, 20 September 2015, 20:48:43

I don't know if I did that right but whatever I did would cause the keyboard to spit out different characters than what I pressed when I press the magic key and it wont switch back

Can you reflash?
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Sun, 20 September 2015, 22:59:47

I don't know if I did that right but whatever I did would cause the keyboard to spit out different characters than what I pressed when I press the magic key and it wont switch back

Can you reflash?
Yeah, I went back to my original firmware. I'm going to have my programmer friend look at it tomorrow
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Mon, 21 September 2015, 08:50:03
How are you flashing?  Using the Teensy Loader?

What characters are getting spit out?

Can you fork my repo and edit the layout, and I'll build the firmware again?
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Mon, 21 September 2015, 15:44:53
How are you flashing?  Using the Teensy Loader?

What characters are getting spit out?

Can you fork my repo and edit the layout, and I'll build the firmware again?
yeah I'm using teensy loader.
I'm too lazy to figure it out myself, I'll troubleshoot it later.
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Thu, 24 September 2015, 08:19:31
How are you flashing?  Using the Teensy Loader?

What characters are getting spit out?

Can you fork my repo and edit the layout, and I'll build the firmware again?
yeah I'm using teensy loader.
I'm too lazy to figure it out myself, I'll troubleshoot it later.

Did you get it sorted out?
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Thu, 24 September 2015, 16:26:11
How are you flashing?  Using the Teensy Loader?

What characters are getting spit out?

Can you fork my repo and edit the layout, and I'll build the firmware again?
yeah I'm using teensy loader.
I'm too lazy to figure it out myself, I'll troubleshoot it later.

Did you get it sorted out?
I haven't had time so no.
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Wed, 30 September 2015, 16:20:16
Anybody have issues with their m0116's spacebar? Mine keeps getting stuck and it is super annoying.
Title: Re: ADB to USB keyboard converter
Post by: Hzza on Wed, 30 September 2015, 16:39:32
Yeah, they're pretty sticky. I took mine off, cleaned and lubed the hole/peg thing and put it back on which helped but it still binds every now and then (though nowhere near as bad as the enter key).
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Wed, 30 September 2015, 16:48:25
Yeah, they're pretty sticky. I took mine off, cleaned and lubed the hole/peg thing and put it back on which helped but it still binds every now and then (though nowhere near as bad as the enter key).
My issue is that the stabilizer bar comes off the little pegs on the lefthand side and then I have to take it apart to fix it and it's super annoying.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 30 September 2015, 19:32:33
We'd seen poeple suffered from a mouse-going-top-left problem. Some of them had clearly hardware problems like bad connection and wiring but I didn't know exact reason actually.
https://geekhack.org/index.php?topic=14290.msg1754134#msg1754134

But now I finaly got it. You must have a pull-up resistor in the end, mouse function doesn't work without it. If you build firmware without mouse feature it may work without pull-up resistor.

Anyway pull-up resistor is a must-have.

https://github.com/tmk/tmk_keyboard/issues/249
Title: Re: ADB to USB keyboard converter
Post by: Hzza on Thu, 01 October 2015, 03:14:36
Yeah, they're pretty sticky. I took mine off, cleaned and lubed the hole/peg thing and put it back on which helped but it still binds every now and then (though nowhere near as bad as the enter key).
My issue is that the stabilizer bar comes off the little pegs on the lefthand side and then I have to take it apart to fix it and it's super annoying.
Oh, maybe try putting a shim between the stabilizer clip in the plate and the stabilizer wire to make it tighter or something? It might be worth taking the spacebar off, the clips out of the plate and trying to reseat everything, I know I had a massive pain getting mine properly in place when I first got it.
Title: Re: ADB to USB keyboard converter
Post by: DamnDan on Thu, 01 October 2015, 04:12:43
Hello All,

Just sharing pinout for M0118, might be useful for people performing internal mod:

(http://i.imgur.com/j9duRZN.jpg)

and this is my completed road warrior:
(http://i.imgur.com/1BkxwZu.jpg)

Thanks Hasu! :)
Title: Re: ADB to USB keyboard converter
Post by: Hzza on Thu, 01 October 2015, 04:21:45
Very nice. I've been on the lookout for an M0118 for ages, we only seem to get M0116's over here though.
Title: Re: ADB to USB keyboard converter
Post by: DamnDan on Thu, 01 October 2015, 04:34:07
Very nice. I've been on the lookout for an M0118 for ages, we only seem to get M0116's over here though.

Heheh, that is quite funny :) Cause I would kill for a M0116 (Poland is using US ANSI, although the typewriters were in ISO QWERTZ).
M0116 has more potential since the right modifier on m0118 is the same as left modifier (one with apple logo).
In Poland we use the right alt for non-latin characters, and having an M0116 you have 5 switches on the right to transform into modifiers if needed :)

But slight mods to the Hasu's converter and I have double right alt on both sides of the space :) Which works.

BTW: Is it normal that the enter on the M0118 gets stuck on it's stabiliser? Shoudn't there be a spring in the stabiliser insert to spring key back up?
Currently that is the only issue I have with M0118...
Title: Re: ADB to USB keyboard converter
Post by: powaa on Thu, 01 October 2015, 09:37:09
Hi!

thanks for the help. My keyboard has been great. however tonight I tried to make the keyboards function buttons as the power key, even following what was said it still doesn't work.

I changed the magic command in config.h :
Code: [Select]
/*
Copyright 2011 Jun Wako <wakojun@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H


#define VENDOR_ID       0xFEED
#define PRODUCT_ID      0x0ADB
#define DEVICE_VER      0x0101
#define MANUFACTURER    t.m.k.
#define PRODUCT         Apple
#define DESCRIPTION     M0116 Apple Keyboard

/* matrix size */
#define MATRIX_ROWS 16  // keycode bit: 3-0
#define MATRIX_COLS 8   // keycode bit: 6-4

#define MATRIX_ROW(code)    ((code)>>3&0x0F)
#define MATRIX_COL(code)    ((code)&0x07)


/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE


/* legacy keymap support */
#define USE_LEGACY_KEYMAP


/* ADB port setting */
#define ADB_PORT        PORTD
#define ADB_PIN         PIND
#define ADB_DDR         DDRD
#define ADB_DATA_BIT    0
//#define ADB_PSW_BIT     1       // optional

/* key combination for command */
#ifndef __ASSEMBLER__
#include "adb.h"
#include "matrix.h"
/*#define IS_COMMAND() ( \
    matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \
)
*/

/* key combination for command */
#define IS_COMMAND() ( \
    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/*#define IS_COMMAND() ( \
    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) \
)
*/


#endif

#endif

and I disabled it as well in makefile
Code: [Select]
#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
#                Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
#               (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
#            have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
#             have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
#               (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
#                (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
#              with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
#                   bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------

# Target file name (without extension).
TARGET = adb_usb_lufa

# Directory common source filess exist
TMK_DIR = ../../tmk_core

# Directory keyboard dependent files exist
TARGET_DIR = .

# project specific files
SRC = keymap_common.c \
matrix.c \
led.c \
adb.c

ifdef KEYMAP
    SRC := keymap_$(KEYMAP).c $(SRC)
else
    SRC := keymap_ansi.c $(SRC)
endif

CONFIG_H = config.h


# MCU name
#MCU = at90usb1287
MCU = atmega32u4

# Processor frequency.
#     This will define a symbol, F_CPU, in all source code files equal to the
#     processor frequency in Hz. You can then use this symbol in your source code to
#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
#     automatically to create a 32-bit value in your source code.
#
#     This will be an integer division of F_USB below, as it is sourced by
#     F_USB after it has run through any CPU prescalers. Note that this value
#     does not *change* the processor frequency - it should merely be updated to
#     reflect the processor speed set externally so that the code can use accurate
#     software delays.
F_CPU = 16000000


#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8

# Input clock frequency.
#     This will define a symbol, F_USB, in all source code files equal to the
#     input clock frequency (before any prescaling is performed) in Hz. This value may
#     differ from F_CPU if prescaling is used on the latter, and is required as the
#     raw input clock is fed directly to the PLL sections of the AVR for high speed
#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
#     at the end, this will be done automatically to create a 32-bit value in your
#     source code.
#
#     If no clock division is performed on the input clock inside the AVR (via the
#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)

# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Boot Section Size in *bytes*
#   Teensy halfKay   512
#   Teensy++ halfKay 1024
#   Atmel DFU loader 4096
#   LUFA bootloader  4096
#   USBaspLoader     2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096


# Build Options
#   comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
#MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
#COMMAND_ENABLE = yes    # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
#ADB_MOUSE_ENABLE = yes

# ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8


# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax

# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)

include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

and obviously changed the keymap from the caps key to the power key.
Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  /* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Ctrl|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   *FROM WHAT I UNDERSTAND FN2 (WHICH IS CURRENTLY SET AS PERIOD ON THE NUMBERPAD) ACTIVATES THE COMMAND I HAVE LABLED AT THE BOTTOM
   */
  [0] = KEYMAP_M0116_ANSI(
    FN2,
    ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,   DEL, EQL, PSLS,NLCK,
    TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC,       P7,  P8,  P9,  PPLS,
    LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,   ENT,  P4,  P5,  P6,  PMNS,
    LSFT,  Z, X, C, V, B, N, M, COMM,  DOT, SLSH, RSFT,  P1,  P2,  P3,
    CAPS,LGUI,LALT,GRV,   SPC,   BSLS,LEFT,RGHT,DOWN,UP,  P0,       FN1,PENT
  ),
  /* Layer 1 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   *THIS LAYER IS MEANT TO ACTIVATE WHEN I HIT FN2
   */
   [1] = KEYMAP_M0116_ANSI(
    TRNS,
    ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,   TRNS,                 DEL, HOME, PGUP, MUTE,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                      INS, END,PGDN, VOLU,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,                  TRNS, UP, TRNS,   VOLD,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,                   LEFT,DOWN,RGHT,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,                            TRNS,     FN1,    TRNS
  ),
 
    /* Layer 2 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  [2] = KEYMAP_M0116_ANSI(
    TRNS,
    ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12,          TRNS,                 TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,      TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,   TRNS, TRNS, TRNS,   TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,      TRNS,TRNS, TRNS,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,              TRNS,     TRNS,    TRNS
  ),
};

const uint16_t PROGMEM fn_actions[] = {
    [1] = ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
    [2] = ACTION_LAYER_TAP_KEY(2,1),
};
/*
const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1), THIS LAYER IS MEANT TO ACTIVATE WHEN I PRESS FN2, WHICH GOES TO LAYER 1 WHICH IS THE SECOND LAYER BECAUSE COMPUTERS COUNT FROM 0
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};

copied from tufty's keymap
*/

any Ideas? thanks.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 01 October 2015, 14:32:20
TAP_KEY(2,1) is not correct, I'm not sure what you want but you mean TAP_KEY(2, KC_1) ????

Just test with ACTION_LAYER_MOMENTARY(2).

Code: [Select]
const uint16_t PROGMEM fn_actions[] = {
    [1] = ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
    [2] = ACTION_LAYER_TAP_KEY(2,1),
};
Title: Re: ADB to USB keyboard converter
Post by: powaa on Fri, 02 October 2015, 06:37:35
Code: [Select]
const uint16_t PROGMEM fn_actions[] = {
    [1] = ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
    [2] = ACTION_LAYER_TAP_KEY(2,KC_FN1),
};

sorry, this code might make more sense

anyway that isnt the issue. the issue is that the power key doesn't do anything after changing the magic command keys and disabling the magic command.
Title: OS X 10.11
Post by: neex on Fri, 02 October 2015, 16:14:35
So I upgraded to OS X El Capitan (10.11) today.  My keyboard/converter setup (M0115 w/ Teensy) stopped working... sort of.  It works at the login screen when I startup the computer (I can use it to type my password), but it does not work after logging in.

Any suggestions on how to fix?  Thanks.
Title: Re: OS X 10.11
Post by: tominabox1 on Fri, 02 October 2015, 16:18:53
So I upgraded to OS X El Capitan (10.11) today.  My keyboard/converter setup (M0115 w/ Teensy) stopped working... sort of.  It works at the login screen when I startup the computer (I can use it to type my password), but it does not work after logging in.

Any suggestions on how to fix?  Thanks.

Thats odd. Using the exact same set up and I have not had a problem.  I have been using the 10.11 betas for weeks though so maybe you can just recompile the hex and reset the teensy and all will be well?
Title: Re: OS X 10.11
Post by: neex on Fri, 02 October 2015, 16:38:53
Thats odd. Using the exact same set up and I have not had a problem.  I have been using the 10.11 betas for weeks though so maybe you can just recompile the hex and reset the teensy and all will be well?

Making progress... My keyboard is usually plugged into a USB HUB.  To make sure there would be no glitches in the upload, I plugged directly into my laptop.  First thing I noticed was that the keyboard was working.

So, the HUB is the issue -- although, it wasn't an issue with OS X 10.10 and it is not an issue at the login screen.  I realize the purpose of this thread isn't about the particular issue I'm having, but I respect the knowledge of the people here and I would really appreciate any quick thoughts or suggestions you might have.

Edit: The ADB keyboard controller is showing up in System Information under USB, even when plugged into the HUB.  Also... I just noticed that, if I plug in the HUB to the computer... OS X opens the Photos app.  Plugging the keyboard into the HUB also opens the photos app.

Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 02 October 2015, 16:49:49
powaa,
hmm, OK. I tried Layer change with power button on my M0116, it works as what I expected.
THen I don't know your problem. I think you can solve your problem in the end if you take time enough with patience.

Let us know what your problem was once you can solve it!

This is my change on the latest source` for the test.
Code: [Select]
diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h
index 5ce5c22..21c9470 100644
--- a/converter/adb_usb/config.h
+++ b/converter/adb_usb/config.h
@@ -55,9 +55,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef __ASSEMBLER__
 #include "adb.h"
 #include "matrix.h"
+/*
 #define IS_COMMAND() ( \
     matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \
 )
+*/
+// NumLock/Clear */
+#define IS_COMMAND() ( \
+    matrix_is_on(MATRIX_ROW(0x47), MATRIX_COL(0x47)) \
+)
 #endif
 
 #endif
diff --git a/converter/adb_usb/keymap_hasu.c b/converter/adb_usb/keymap_hasu.c
index a0b3f1f..5d20963 100644
--- a/converter/adb_usb/keymap_hasu.c
+++ b/converter/adb_usb/keymap_hasu.c
@@ -19,7 +19,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * `-----------------------------------------------------------' `-----------' `---------------'
      */
     KEYMAP_EXT_ANSI(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
+    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    FN0,
     GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,FN0,      DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
     LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
@@ -44,7 +44,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * `-----------------------------------------------------------' `-----------' `---------------'
      */
     KEYMAP_EXT_ANSI(
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
+    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    TRNS,
     ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,      INS, HOME,PGUP,    NLCK,BTN1,BTN2,BTN3,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   PSCR,SLCK,PAUS,UP,  INS, FN0,      DEL, END, PGDN,    WH_D,MS_U,WH_U,WH_D,
     LCAP,VOLD,VOLU,MUTE,F,   G,   H,   J,   HOME,PGUP,LEFT,RGHT,     ENT,                         MS_L,MS_D,MS_R,WH_U,
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 02 October 2015, 17:11:36
Wierd.
I'll skim source and search any clue later once they place it in public. I guess they changed something on keyboard or USB.
http://www.opensource.apple.com/

Thats odd. Using the exact same set up and I have not had a problem.  I have been using the 10.11 betas for weeks though so maybe you can just recompile the hex and reset the teensy and all will be well?

Making progress... My keyboard is usually plugged into a USB HUB.  To make sure there would be no glitches in the upload, I plugged directly into my laptop.  First thing I noticed was that the keyboard was working.

So, the HUB is the issue -- although, it wasn't an issue with OS X 10.10 and it is not an issue at the login screen.  I realize the purpose of this thread isn't about the particular issue I'm having, but I respect the knowledge of the people here and I would really appreciate any quick thoughts or suggestions you might have.

Edit: The ADB keyboard controller is showing up in System Information under USB, even when plugged into the HUB.  Also... I just noticed that, if I plug in the HUB to the computer... OS X opens the Photos app.  Plugging the keyboard into the HUB also opens the photos app.


Title: Re: ADB to USB keyboard converter
Post by: neex on Sat, 03 October 2015, 08:09:56
Wierd.
I'll skim source and search any clue later once they place it in public. I guess they changed something on keyboard or USB.
http://www.opensource.apple.com/

Yeah, they definitely changed something.  I just found out that, if I want the computer to crash and force a restart, I only need to tap the caps lock on my M0115 2-3 times.

Google told me that some of the dev builds had some sort of USB issues:

http://www.insanelymac.com/forum/topic/306777-guide-usb-fix-el-capitan-1011/

Not sure what all that means, but, if my experience counts for anything, it seems USB "issues" might still a problem in the public release.

Has anyone else had issues with keyboards/hubs/USB drives/etc.?
Title: Re: ADB to USB keyboard converter
Post by: tominabox1 on Sat, 03 October 2015, 08:24:51
Wierd.
I'll skim source and search any clue later once they place it in public. I guess they changed something on keyboard or USB.
http://www.opensource.apple.com/

Yeah, they definitely changed something.  I just found out that, if I want the computer to crash and force a restart, I only need to tap the caps lock on my M0115 2-3 times.

Google told me that some of the dev builds had some sort of USB issues:

http://www.insanelymac.com/forum/topic/306777-guide-usb-fix-el-capitan-1011/

Not sure what all that means, but, if my experience counts for anything, it seems USB "issues" might still a problem in the public release.

Has anyone else had issues with keyboards/hubs/USB drives/etc.?

Here's my setup - I have my teensy wired up via a cable to the pinout at the ADB header on the daughter card.  Then USB mini cable to an unpowered hub to the Mac Mini.  I have not had any issues with my computer on 10.11 or 10.11.1.  You do have the 1k pullup resistor in place right?   Maybe try to do an EFI/PRAM reset.
Title: Re: ADB to USB keyboard converter
Post by: RavenII on Sat, 03 October 2015, 19:02:18
Sorry, I thought this was the TMK thread...
Title: Re: ADB to USB keyboard converter
Post by: neex on Sun, 04 October 2015, 07:55:43
Here's my setup - I have my teensy wired up via a cable to the pinout at the ADB header on the daughter card.  Then USB mini cable to an unpowered hub to the Mac Mini.  I have not had any issues with my computer on 10.11 or 10.11.1.  You do have the 1k pullup resistor in place right?   Maybe try to do an EFI/PRAM reset.

Good to know yours is working.  I have the resistor wired properly!  Only 2 differences here: (1) I'm not running 10.11.1 yet (but yours works with 10.11, so that shouldn't matter), and (2) My hub is powered--it's a 7-port Inateck brand.  I don't have another hub laying around but I'll try to borrow one from work tomorrow just to eliminate the HUB as the problem.  Thanks!
Title: Re: ADB to USB keyboard converter
Post by: superbia on Fri, 09 October 2015, 06:37:07
Hi.. this may be of some help for AEKII users (atleast the azerty owners)

The two highlighted keys in the layout are actually swapped, but you can go around it like i did.


LAYOUT
More
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_EXT_ISO(
    ESC,    F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   NO,
    Z,      1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PEQL,PSLS,PAST,
    TAB,    Q,   W,   F,   P,   B,   J,   L,   U,   Y,   SCLN,LBRC,RBRC,ENT,      DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    LCTL,   A,   R,   S,   T,   G,   M,   N,   E,   I,   O,     QUOT,NUHS,                             P4,  P5,  P6,  PPLS,
    LSFT,   GRV, X,   C,   D,   V,   NO,  K,   H,   COMM,DOT, SLSH,     RSFT,          UP,           P1,  P2,  P3,
    CAPS,   LGUI,LALT,          SPC,                               RCTL,RALT,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),
};

edit: dont mind other keys, im using colemak
Title: Re: ADB to USB keyboard converter
Post by: Hzza on Fri, 09 October 2015, 07:37:47
This is mentioned in one of the docs, the ADB scancode is different for those keys in ISO and ANSI (comments at the bottom of the page (https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap_common.h)). It's good to point it out though, it took me a while to figure out what was going on :D.
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Fri, 09 October 2015, 12:36:00
Would anyone with an Apple Adjustable Keyboard (this one: http://sandy55.fc2web.com/keyboard/adjustable/front_m.jpg) help me out and add their layout here please?
I'd rather start from a good keymap.

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: superbia on Fri, 09 October 2015, 13:07:46
Would anyone with an Apple Adjustable Keyboard (this one: http://sandy55.fc2web.com/keyboard/adjustable/front_m.jpg) help me out and add their layout here please?
I'd rather start from a good keymap.

Thanks!

wow, nice keyboard :)

You can try the layout hasu provides.
You will quickly figure if everything works (or something needs to be switched).

Its really easy... If you made a controller yourself, you will fix all eventual problems that might come.
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Fri, 09 October 2015, 13:11:08
Would anyone with an Apple Adjustable Keyboard (this one: http://sandy55.fc2web.com/keyboard/adjustable/front_m.jpg) help me out and add their layout here please?
I'd rather start from a good keymap.

Thanks!

wow, nice keyboard :)

You can try the layout hasu provides.
You will quickly figure if everything works (or something needs to be switched).

Its really easy... If you made a controller yourself, you will fix all eventual problems that might come.

Yes, I know I can do it myself, but if someone had already done it and I could simply copy it, I'd appreciate it. :)
Title: Re: ADB to USB keyboard converter
Post by: superbia on Fri, 09 October 2015, 14:09:47
Would anyone with an Apple Adjustable Keyboard (this one: http://sandy55.fc2web.com/keyboard/adjustable/front_m.jpg) help me out and add their layout here please?
I'd rather start from a good keymap.

Thanks!

wow, nice keyboard :)

You can try the layout hasu provides.
You will quickly figure if everything works (or something needs to be switched).

Its really easy... If you made a controller yourself, you will fix all eventual problems that might come.

Yes, I know I can do it myself, but if someone had already done it and I could simply copy it, I'd appreciate it. :)

Its just opening a default keymap file with notepad and swaping letters (the file has 30 lines of "code") ...

Afterwards you make & flash it.. if you want, you can take a look at a post i wrote here previously (where i described the steps i made to get mines working).
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Fri, 09 October 2015, 14:31:34
Its just opening a default keymap file with notepad and swaping letters (the file has 30 lines of "code") ...

Afterwards you make & flash it.. if you want, you can take a look at a post i wrote here previously (where i described the steps i made to get mines working).

Ok, maybe I'm not being clear.
I know what to do, and how to do it and I have done it for my AEKIIs, my Octagons and Viper (sold it before I finished), so that's not the issue.

All I was looking for was someone to paste in their existing layout.c for an AAK so I could copy it.
Please don't take any of your time on my behalf.
Title: Re: ADB to USB keyboard converter
Post by: neex on Fri, 09 October 2015, 16:25:22
Here's my setup - I have my teensy wired up via a cable to the pinout at the ADB header on the daughter card.  Then USB mini cable to an unpowered hub to the Mac Mini.  I have not had any issues with my computer on 10.11 or 10.11.1.  You do have the 1k pullup resistor in place right?   Maybe try to do an EFI/PRAM reset.

Good to know yours is working.  I have the resistor wired properly!  Only 2 differences here: (1) I'm not running 10.11.1 yet (but yours works with 10.11, so that shouldn't matter), and (2) My hub is powered--it's a 7-port Inateck brand.  I don't have another hub laying around but I'll try to borrow one from work tomorrow just to eliminate the HUB as the problem.  Thanks!

I finally got a chance to try a different hub (powered Anker brand).  Still not working.  Very frustrating.  Again, the keyboard is not working when I am logged in and using a hub (computer-->hub-->teensy-->kb).  It always works fine when plugged directly into my laptop.  It also works if I'm at the login screen after a restart (but not after logging in).  Like I said, it always worked under OS X 10.10, just started having this problem after upgrading to 10.11)...
Title: Re: ADB to USB keyboard converter
Post by: superbia on Fri, 09 October 2015, 17:37:20
Here's my setup - I have my teensy wired up via a cable to the pinout at the ADB header on the daughter card.  Then USB mini cable to an unpowered hub to the Mac Mini.  I have not had any issues with my computer on 10.11 or 10.11.1.  You do have the 1k pullup resistor in place right?   Maybe try to do an EFI/PRAM reset.

Good to know yours is working.  I have the resistor wired properly!  Only 2 differences here: (1) I'm not running 10.11.1 yet (but yours works with 10.11, so that shouldn't matter), and (2) My hub is powered--it's a 7-port Inateck brand.  I don't have another hub laying around but I'll try to borrow one from work tomorrow just to eliminate the HUB as the problem.  Thanks!

I finally got a chance to try a different hub (powered Anker brand).  Still not working.  Very frustrating.  Again, the keyboard is not working when I am logged in and using a hub (computer-->hub-->teensy-->kb).  It always works fine when plugged directly into my laptop.  It also works if I'm at the login screen after a restart (but not after logging in).  Like I said, it always worked under OS X 10.10, just started having this problem after upgrading to 10.11)...

Probably some security rules to "prevent bad hardware" to pwn your machine ?
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Fri, 09 October 2015, 19:45:25
Here's my setup - I have my teensy wired up via a cable to the pinout at the ADB header on the daughter card.  Then USB mini cable to an unpowered hub to the Mac Mini.  I have not had any issues with my computer on 10.11 or 10.11.1.  You do have the 1k pullup resistor in place right?   Maybe try to do an EFI/PRAM reset.

Good to know yours is working.  I have the resistor wired properly!  Only 2 differences here: (1) I'm not running 10.11.1 yet (but yours works with 10.11, so that shouldn't matter), and (2) My hub is powered--it's a 7-port Inateck brand.  I don't have another hub laying around but I'll try to borrow one from work tomorrow just to eliminate the HUB as the problem.  Thanks!

I finally got a chance to try a different hub (powered Anker brand).  Still not working.  Very frustrating.  Again, the keyboard is not working when I am logged in and using a hub (computer-->hub-->teensy-->kb).  It always works fine when plugged directly into my laptop.  It also works if I'm at the login screen after a restart (but not after logging in).  Like I said, it always worked under OS X 10.10, just started having this problem after upgrading to 10.11)...

Probably some security rules to "prevent bad hardware" to pwn your machine ?
I've looked at your problem and after assessing everything you have said, I have realized what your problem is:
Apple sucks.
Title: Re: ADB to USB keyboard converter
Post by: Toorop on Wed, 11 November 2015, 03:06:15
Hi everyone,

First thanks for your works :thumb:
Second: excuse my poor english and my lack of knowledge, i try to do my best but when you are noob... you are noob.

That's said, i've found a M0118 azerty iso, it working perfectly (i'm typing with it currently) except that i do not find how to do a @ (for those asking themselves: "but wait you just have done it so you can ?!" i've just done a copy/paste ;))

Thanks for your help
Title: Re: ADB to USB keyboard converter
Post by: Blaise170 on Wed, 11 November 2015, 20:00:28
Hi everyone,

First thanks for your works :thumb:
Second: excuse my poor english and my lack of knowledge, i try to do my best but when you are noob... you are noob.

That's said, i've found a M0118 azerty iso, it working perfectly (i'm typing with it currently) except that i do not find how to do a @ (for those asking themselves: "but wait you just have done it so you can ?!" i've just done a copy/paste ;))

Thanks for your help

Mauvais! Have you checked the layout to make sure it is proper for your M0118?
Title: Re: ADB to USB keyboard converter
Post by: yomammary on Fri, 13 November 2015, 10:53:09
Does anyone have one that he could sell me or will I have to make one? :'(
Title: Re: ADB to USB keyboard converter
Post by: Toorop on Sun, 15 November 2015, 03:43:17
Mauvais! Have you checked the layout to make sure it is proper for your M0118?

The main problem is that the m0118 azerty doesn't have the "`" key (which is normally, on modern mac kb, on the upper left or at the left of spacebar on older kb) and which is used on mac layout for the "@".

(http://i.imgur.com/RXeWfmi.jpg)

An easy workaround is to switch from "mac layout" to 'pc layout" on the MacOs control panel and use "alt + 0".
When i'll be more familiar with tmk fw, i'll probably add another layout with Fn functions && a direct @ access.

Thanks ;)
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Sun, 15 November 2015, 06:01:15
Does anyone have one that he could sell me or will I have to make one? :'(

There's this: https://geekhack.org/index.php?topic=75213.msg1864261#msg1864261

Unsure of it's current state.

I cut an ADB cable so I had a connector and about 2inches of internal wires.  I then stripped those and soldered them and the 1K resistor to the teensy.
It's only three solder locations, give it a shot. :)
Title: Re: ADB to USB keyboard converter
Post by: yomammary on Mon, 16 November 2015, 07:38:29
Does anyone have one that he could sell me or will I have to make one? :'(

There's this: https://geekhack.org/index.php?topic=75213.msg1864261#msg1864261

Unsure of it's current state.

I cut an ADB cable so I had a connector and about 2inches of internal wires.  I then stripped those and soldered them and the 1K resistor to the teensy.
It's only three solder locations, give it a shot. :)
Yeah I think I will :)
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Mon, 16 November 2015, 08:51:20
This may help, just ignore the gross soldering, could not find my fine tip, so I had to ham-fist it. :)

Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 16 November 2015, 15:40:56
Does anyone have one that he could sell me or will I have to make one? :'(

You can buy an preassembled converter here.
https://geekhack.org/index.php?topic=72052.0
Title: Re: ADB to USB keyboard converter
Post by: yomammary on Tue, 17 November 2015, 08:02:32
Does anyone have one that he could sell me or will I have to make one? :'(

You can buy an preassembled converter here.
https://geekhack.org/index.php?topic=72052.0
Thanks, I've bought a teensy 2.0 to try doing it myself. :confused:
Title: Re: ADB to USB keyboard converter
Post by: superbia on Wed, 25 November 2015, 04:03:32
I see people paying 20$ for a teensy
while you can buy this converter for 30$ (made by hasu)
(https://i.imgur.com/iLMqfslh.jpg)

However you can use microcontrollers with same chip as teensy has that cost 6$ (pictured bellow)
(https://i.imgur.com/iHk29lj.jpg)

I am just confused, if you want to DIY why don't you pay 6$ for the chip (it doesn't need to be a teensy),
or just pop 30$ for a pro grade converter (hassle free, it works, its tidy, it looks nice) and support the maker
Title: Re: ADB to USB keyboard converter
Post by: yomammary on Mon, 30 November 2015, 11:19:20
I see people paying 20$ for a teensy
while you can buy this converter for 30$ (made by hasu)
Show Image
(https://i.imgur.com/iLMqfslh.jpg)


However you can use microcontrollers with same chip as teensy has that cost 6$ (pictured bellow)
Show Image
(https://i.imgur.com/iHk29lj.jpg)


I am just confused, if you want to DIY why don't you pay 6$ for the chip (it doesn't need to be a teensy),
or just pop 30$ for a pro grade converter (hassle free, it works, its tidy, it looks nice) and support the maker
I get it, it's just fun doing it myself. Money is no object ;)
Title: Re: ADB to USB keyboard converter
Post by: yomammary on Mon, 30 November 2015, 13:23:20
Here is my work so far, everything worked great. The soldering job is not that good mostly because I've soldered a couple of times before. You can also see that I've fixed some things in place with hot glue.
I used Windows + Cygwin for the generation of the Hex file.
Tested the keys (because I was unsure) with EK' switch hitter and it's working great.
The only this remaining is to clean the keycaps.

(http://i.imgur.com/O6Nnb2T.jpg)
(http://i.imgur.com/pryjjYX.jpg)
(http://i.imgur.com/WnUpSPd.jpg)

I'll post more pics when I'm done.
Title: Re: ADB to USB keyboard converter
Post by: asaturn on Sat, 05 December 2015, 05:24:04
can anyone help me out?

I have a teensy 2.0 wired to the board on an apple A9M 0330 keyboard

I know the teensy works (I can send the flashing light program and it works) but I get zero output when flashing the adb hex program.

do the pin numbers on the keyboard circuit correspond to the pin numbers assigned here to the ADB connection?

see photos

(http://i.imgur.com/XQKMYJV.jpg)

(http://i.imgur.com/Cm6nO4h.jpg)

(http://i.imgur.com/2w72BEx.jpg)
Title: Re: ADB to USB keyboard converter
Post by: asaturn on Sat, 05 December 2015, 05:37:57
PS I originally read this site:

http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/jhjgjhcxzczc

but then I found this forum and thread, so I made sure to use D0 instead of F0.

I ran "make" just like the site says... but I'm not sure if I have to change anything else? new to this stuff.
Title: Re: ADB to USB keyboard converter
Post by: asaturn on Sat, 05 December 2015, 14:03:50
so I don't know what I did wrong, but I deleted, resync'd, recompiled, and now it works! I do get the mouse going to the upper left, but that's known -- I'll throw the resistor on there.

THANKS!
Title: Re: ADB to USB keyboard converter
Post by: stoic-lemon on Mon, 07 December 2015, 11:27:05
Another noob to all this just dropping by to say thanks to everyone for sharing successes and failures. They are so helpful. I managed to get my M0116 up and running. Most difficult parts were setting up the software on Windows and getting round a few C based confusions. Being back on the command line has me feeling nostalgic for when I was Linux only.

Next things to do are to make it all look presentable. I think I will put the Teensy in the case and have a USB cable running out the side of the case.

Thanks again!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 17 December 2015, 21:38:19
REQUEST FOR HELP: Extended mouse protocol support
It is required for more buttons and movement resolution of mouse/trackball.
Do you have multiple button mouse? Implement it!
https://github.com/tmk/tmk_keyboard/issues/274

This converter currently supports only 'classic mouse protrocol' which allows only one or two buttons, while 'extended protocol' can support multiple-button devices up to eight buttons.

Thanks
Title: Re: ADB to USB keyboard converter
Post by: Stabilized on Tue, 22 December 2015, 17:24:52
I was wondering if anyone could help me use a Pro Micro as the controller for this firmware.

I have read the post a couple of pages ago (https://geekhack.org/index.php?topic=14290.msg1789587#msg1789587) and also the post on Deskthority (http://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html) about using a Pro Micro instead of a Teensy.

I used both guides and soldered up my controller and successfully flashed it, but it doesn't work with either my Apple Extended keyboard or my Apple Adjustable keyboard and I can't work out what I have done wrong!

This is my first time using and flashing the TMK firmware, so I do assume that it is something to do with that. I have flashed soarer's converter on about 3 Pro Micros without any problem. Also when I look in my Mac's keyboard menu in the settings, the converter doesn't come up as a recognised keyboard, should it?

Anyway here's a picture of my soldering job, I originally connected the Power SW line to PD1 because I wasn't thinking, but I don't think should effect the functionality right?

(http://i.imgur.com/O2MQXjn.jpg)(http://i.imgur.com/o4CPpkF.jpg)

The resistor is 1.16K and I am using a short 4 pole s-video cable.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 22 December 2015, 18:59:21
Yes, it is recognized as keyboard once firmware runs on controller.
Right, Power switch line won't affect unless the wiring is mess.
Title: Re: ADB to USB keyboard converter
Post by: Stabilized on Wed, 23 December 2015, 05:34:32
I think it is a problem with me building it, I tried with v1.12 soarer's converter using the same pro micro and that works without problems in Mac OS X (10.11).
For some reason when I flash the TMK ADB hex it doesn't come up in my device list on Mac OS.

I have tried different cables, building it multiple times, and I can't get it work! I follow all the build instructions over on this page (https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md), but it still isn't shown on either Mac OS or Windows 10.

Would really appreciate help or maybe a pre-compiled .hex file if you have one handy?
Title: Re: ADB to USB keyboard converter for Teensy
Post by: merlin64 on Sun, 10 January 2016, 22:20:05
The upper solution could solve almost multiple key stroke problem but not all.

By setting USB device as low speed device, this problem could be solved.(I didn't tried)

I made USB controller for Apple desktop bus keyboard(IIgs) with Teensy++2.0 and this multiple key stroke problem exists also. I tried in many ways but I couldn't find what is wrong but I could expect there is some timing issue between USB host and firmware. As a work around, by setting this controller as low speed device this problem has gone.

Here is my work picture
Show Image
(http://cfile7.uf.tistory.com/image/1947915A4D651B381E3C0D)


Anyone know where Jeffrey got that mini usb connector? Been looking for one like it, but haven't been successful.
Title: Re: ADB to USB keyboard converter for Teensy
Post by: MAR82 on Mon, 11 January 2016, 03:04:49
The upper solution could solve almost multiple key stroke problem but not all.

By setting USB device as low speed device, this problem could be solved.(I didn't tried)

I made USB controller for Apple desktop bus keyboard(IIgs) with Teensy++2.0 and this multiple key stroke problem exists also. I tried in many ways but I couldn't find what is wrong but I could expect there is some timing issue between USB host and firmware. As a work around, by setting this controller as low speed device this problem has gone.

Here is my work picture
Show Image
(http://cfile7.uf.tistory.com/image/1947915A4D651B381E3C0D)


Anyone know where Jeffrey got that mini usb connector? Been looking for one like it, but haven't been successful.

Looking for something like this?
http://www.ebay.com/itm/10pcs-Mini-USB-Female-5Pin-180-Socket-Connector-vertical-Legs-HW-MU-5F-23-/170961675619?hash=item27ce1c2563:g:jhEAAMXQMmJRNBRi
Because it looks like Jeffrey used one, and then just hot glued it into the ADB port housing
Title: Re: ADB to USB keyboard converter
Post by: merlin64 on Mon, 11 January 2016, 10:18:47
I wish he was still active on the forum, It almost looks like he just soldered his teensy 2.0++ to some pins shared by the original microcontroller.
Title: Re: ADB to USB keyboard converter
Post by: mastermachetier on Mon, 11 January 2016, 17:43:49
Hey Guys,

I am copying my message from the tmk_keyboard main thread . I fell that it is more relevant here



Quote
Hey first of all thank you for the awesome firmware its beautiful. I am pretty new to the world of hardware and also coding. I have a apple standard keyboard M0116 that i converted from adb using the tmk firmware. It is working beautifully, the next step i would like to do is convert it to bluetooth. I saw the bluetooth protocol in the repo this is just if you are using serial. I have a bluefruit ez-link that supports serial , but i also have a bluefruit le spi that supports bluetooth hid. https://learn.adafruit.com/introducing-the-adafruit-bluefruit-spi-breakout/hidkeyboard  . So after all that my questions are

1. Is there an advantage to using the bluetooth hid instead of serial ? If so how hard would it be to implement and where would I begin.
2. How do I add the bluefruit protocol in the firmware to the makefile for the adb converter .

Thanks !
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Wed, 03 February 2016, 16:50:59
Ok so I'm trying to go through this whole process again because I have more time now, and i really could use ,y function layer, but I seem to be stuck on the very first step! I'm using a Teensy btw. So my problem is that when I open cygwin and type in:
cd tmk_keyboard/converter/adb_usb
nothing happens!
I downloaded the zip archive and made sure to extract it as well. My problem might be the Atmel AVR toolchain, I'm not really sure how that one works, but I downloaded it and all I got was a zip file, no executable or anything.
When I run the command in Cygwin, I get an output saying that there is no such file or directory. I'm at aloss here, any help would be appreciated.
Title: Re: ADB to USB keyboard converter
Post by: mastermachetier on Thu, 11 February 2016, 12:15:38
Hey guys and Hasu. I have been using this firmware for about a month now everyday on my m0116 as a matter of fact I am typing with it right now. I am having an issue though were If I do not use the keyboard for a little bit of time It stops responding until I unplug it both from the adbport on the keyboard and the usb from the teensy. The way i wired this was by getting a spare adb cable stripping the ends and soldering it directly to a teensy. I was wondering you could lead me in the correct direction of troubleshooting this issue.

Thank you,
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Thu, 11 February 2016, 13:34:27
Hey guys and Hasu. I have been using this firmware for about a month now everyday on my m0116 as a matter of fact I am typing with it right now. I am having an issue though were If I do not use the keyboard for a little bit of time It stops responding until I unplug it both from the adbport on the keyboard and the usb from the teensy. The way i wired this was by getting a spare adb cable stripping the ends and soldering it directly to a teensy. I was wondering you could lead me in the correct direction of troubleshooting this issue.

Thank you,
Weird,I've been using the code on an M0116 as well for about a year and I haven't ever had this issue. Do you have the stock configuration or did you add a function layer? I'm starting to get annoyed  by the lack of F keys
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 11 February 2016, 15:38:37
Hey guys and Hasu. I have been using this firmware for about a month now everyday on my m0116 as a matter of fact I am typing with it right now. I am having an issue though were If I do not use the keyboard for a little bit of time It stops responding until I unplug it both from the adbport on the keyboard and the usb from the teensy. The way i wired this was by getting a spare adb cable stripping the ends and soldering it directly to a teensy. I was wondering you could lead me in the correct direction of troubleshooting this issue.

Thank you,

Check first post, again. In particular, "NEED HELP?" section.
Title: Re: ADB to USB keyboard converter
Post by: mastermachetier on Thu, 11 February 2016, 15:58:03
Hey guys and Hasu. I have been using this firmware for about a month now everyday on my m0116 as a matter of fact I am typing with it right now. I am having an issue though were If I do not use the keyboard for a little bit of time It stops responding until I unplug it both from the adbport on the keyboard and the usb from the teensy. The way i wired this was by getting a spare adb cable stripping the ends and soldering it directly to a teensy. I was wondering you could lead me in the correct direction of troubleshooting this issue.

Thank you,
Weird,I've been using the code on an M0116 as well for about a year and I haven't ever had this issue. Do you have the stock configuration or did you add a function layer? I'm starting to get annoyed  by the lack of F keys

I am using the default layout still i wrote a layout yesterday but missed something as it is not compiling but I have yet to go over it again .

Code: [Select]
#include "keymap_common.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
    * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
    * +-----------------------------------------------------+   | +---+---+---+---+
    * | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
    * +---------------------------------------------------------+ +-------+---|ent|
    * |fn0|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
    * +---------------------------------------------------------+ +-------+---+---+
    */
  KEYMAP_M0116_ANSI( \
                                     POWER,                                                          \
       ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,   NLCK,EQL, PSLS,PAST, \
       TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,        P7,  P8,  P9,  PMNS, \
       LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,    P4,  P5,  P6,  PPLS, \
       LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,   P1,  P2,  P3,        \
       FN0, LALT,LGUI,GRV,           SPC,      BSLS,LEFT,RGHT,DOWN,UP,          P0,       PDOT,PENT),

    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +----+----+--+-+---+
    * |esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| - | = | del | |    |    |    |   |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | |    |    |    | + |
    * +-----------------------------------------------------+   | +----+----+----+---+
    * | bks  | a | s | d | f | g | h | j | k | l | ; | ' |return| |    | UP |    | - |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | |Left|DOWN|RGHT|   |
    * +---------------------------------------------------------+ +---------+----|ent|
    * |   |opt|comnd| clr|                  | \ |lef|rig|dwn|up | |  DEL    |bks |   |
    * +---------------------------------------------------------+ +---------+----+---+
    */
  KEYMAP_M0116_ANSI( \
                                     TRNS,                                                            \
       TRNS,F1,  F2,  F3,  F4,  F5,  f6,  F7,  F8,  F9,  F0,  TRNS,TRNS, DEL,    NO  ,NO  ,NO  ,NO  , \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,         NO  ,NO  ,NO  ,TRNS, \
       BSPC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,    NO  ,UP  ,NO  ,TRNS, \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,    LEFT,DOWN,RGHT,      \
       NO,  TRNS,TRNS,LCTL,          TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,         DEL ,     BSPC,TRNS),

};

const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),             
};     


error

Code: [Select]
make -f Makefile.teensy KEYMAP=raf                                                     
sh: dfu-programmer: command not found
sh: dfu-programmer: command not found

-------- begin --------
avr-gcc (GCC) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


mkdir -p obj_adb_usb_lufa
Compiling C: keymap_raf.c
avr-gcc -c -mmcu=at90usb1286  -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=2048 -DADB_MOUSE_MAXACC=8 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=5c89d73-dirty -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_adb_usb_lufa/keymap_raf.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/protocol -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_adb_usb_lufa_keymap_raf.o.d  keymap_raf.c -o obj_adb_usb_lufa/keymap_raf.o
In file included from keymap_raf.c:1:0:
keymap_common.h:149:65: error: 'KC_f6' undeclared here (not in a function)
   { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
                                                                 ^
keymap_raf.c:47:3: note: in expansion of macro 'KEYMAP_M0116_ANSI'
   KEYMAP_M0116_ANSI( \
   ^
keymap_common.h:150:55: error: 'KC_F0' undeclared here (not in a function)
   { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \
                                                       ^
keymap_raf.c:47:3: note: in expansion of macro 'KEYMAP_M0116_ANSI'
   KEYMAP_M0116_ANSI( \
   ^
make: *** [obj_adb_usb_lufa/keymap_raf.o] Error 1
Title: Re: ADB to USB keyboard converter
Post by: mastermachetier on Thu, 11 February 2016, 16:00:07
Hey guys and Hasu. I have been using this firmware for about a month now everyday on my m0116 as a matter of fact I am typing with it right now. I am having an issue though were If I do not use the keyboard for a little bit of time It stops responding until I unplug it both from the adbport on the keyboard and the usb from the teensy. The way i wired this was by getting a spare adb cable stripping the ends and soldering it directly to a teensy. I was wondering you could lead me in the correct direction of troubleshooting this issue.

Thank you,

Check first post, again. In particular, "NEED HELP?" section.


Wow sorry Hasu have read this thread through so many you would think I saw that. I will post with pictures when I have a chance to open up my "converter box". I am at work and don't have screw drivers here.

Thanks though !
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Thu, 18 February 2016, 07:20:16
Master, any updates on the layout you wrote?
Title: Re: ADB to USB keyboard converter
Post by: mastermachetier on Thu, 18 February 2016, 10:53:00
Master, any updates on the layout you wrote?

I got the code working after some tweaks turns out I forgot to put "F" before some of the function keys. I am using a basic setup right now to get function keys, but I plan on making a better keymap when I have some time. I also re-soldered my teensy internally and it seems to have resolve the issues I was having with they keyboard freezing. In the future I plan on using the locking key to change before colemak and qwerty and move the fn key to where GRV is using shift and FN to get ` ~ and access the fkeys using FN. 

Code: [Select]
#include "keymap_common.h"

/*
 * Mastermachetier
 */
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
    * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
    * +-----------------------------------------------------+   | +---+---+---+---+
    * | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
    * +---------------------------------------------------------+ +-------+---|ent|
    * |fn0|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
    * +---------------------------------------------------------+ +-------+---+---+
    */
  KEYMAP_M0116_ANSI( \
                                     POWER,                                                          \
       ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,   NLCK,EQL, PSLS,PAST, \
       TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,        P7,  P8,  P9,  PMNS, \
       LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,    P4,  P5,  P6,  PPLS, \
       LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,   P1,  P2,  P3,        \
       FN0, LALT,LGUI,GRV,           SPC,      BSLS,LEFT,RGHT,DOWN,UP,          P0,       PDOT,PENT),

    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +----+----+--+-+---+
    * |esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| - | = | del | |    |    |    |   |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | |    |    |    | + |
    * +-----------------------------------------------------+   | +----+----+----+---+
    * | bks  | a | s | d | f | g | h | j | k | l | ; | ' |return| |    | UP |    | - |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | |Left|DOWN|RGHT|   |
    * +---------------------------------------------------------+ +---------+----|ent|
    * |fn0|opt|comnd| clr|                  | \ |lef|rig|dwn|up | |  DEL    |bks |   |
    * +---------------------------------------------------------+ +---------+----+---+
    */
  KEYMAP_M0116_ANSI( \
                                     TRNS,                                                            \
       TRNS,F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10,  F11, F12, DEL,    NO  ,NO  ,NO  ,NO  , \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,         NO  ,NO  ,NO  ,TRNS, \
       BSPC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,    NO  ,UP  ,NO  ,TRNS, \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,    LEFT,DOWN,RGHT,      \
       TRNS,TRNS,TRNS,TRNS,          TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,         DEL ,     BSPC,TRNS),

};

const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),             
};     

More
[attachimg=1]
[attachimg=2]
[attachimg=3]
[attachimg=4]
[attachimg=5]
[attachimg=6]
[attachimg=7]
[attachimg=8]

quick edit : has anyone figured out how to use bootmagic on adb ? Also can you access layers on the keyboard while in bios using function keys for the "F" keys ?
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Thu, 18 February 2016, 23:05:16
Master, any updates on the layout you wrote?

I got the code working after some tweaks turns out I forgot to put "F" before some of the function keys. I am using a basic setup right now to get function keys, but I plan on making a better keymap when I have some time. I also re-soldered my teensy internally and it seems to have resolve the issues I was having with they keyboard freezing. In the future I plan on using the locking key to change before colemak and qwerty and move the fn key to where GRV is using shift and FN to get ` ~ and access the fkeys using FN. 

Code: [Select]
#include "keymap_common.h"

/*
 * Mastermachetier
 */
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
    * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
    * +-----------------------------------------------------+   | +---+---+---+---+
    * | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
    * +---------------------------------------------------------+ +-------+---|ent|
    * |fn0|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
    * +---------------------------------------------------------+ +-------+---+---+
    */
  KEYMAP_M0116_ANSI( \
                                     POWER,                                                          \
       ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,   NLCK,EQL, PSLS,PAST, \
       TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,        P7,  P8,  P9,  PMNS, \
       LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,    P4,  P5,  P6,  PPLS, \
       LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,   P1,  P2,  P3,        \
       FN0, LALT,LGUI,GRV,           SPC,      BSLS,LEFT,RGHT,DOWN,UP,          P0,       PDOT,PENT),

    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +----+----+--+-+---+
    * |esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| - | = | del | |    |    |    |   |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | |    |    |    | + |
    * +-----------------------------------------------------+   | +----+----+----+---+
    * | bks  | a | s | d | f | g | h | j | k | l | ; | ' |return| |    | UP |    | - |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | |Left|DOWN|RGHT|   |
    * +---------------------------------------------------------+ +---------+----|ent|
    * |fn0|opt|comnd| clr|                  | \ |lef|rig|dwn|up | |  DEL    |bks |   |
    * +---------------------------------------------------------+ +---------+----+---+
    */
  KEYMAP_M0116_ANSI( \
                                     TRNS,                                                            \
       TRNS,F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10,  F11, F12, DEL,    NO  ,NO  ,NO  ,NO  , \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,         NO  ,NO  ,NO  ,TRNS, \
       BSPC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,    NO  ,UP  ,NO  ,TRNS, \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,    LEFT,DOWN,RGHT,      \
       TRNS,TRNS,TRNS,TRNS,          TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,         DEL ,     BSPC,TRNS),

};

const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),             
};     

More

quick edit : has anyone figured out how to use bootmagic on adb ? Also can you access layers on the keyboard while in bios using function keys for the "F" keys ?
No experience with bootmagic, but that looks like some solid code. I'd borrow it but I can't seem to get my compiler to work. Oh well.
Title: Re: ADB to USB keyboard converter
Post by: mastermachetier on Thu, 18 February 2016, 23:20:25
Master, any updates on the layout you wrote?

I got the code working after some tweaks turns out I forgot to put "F" before some of the function keys. I am using a basic setup right now to get function keys, but I plan on making a better keymap when I have some time. I also re-soldered my teensy internally and it seems to have resolve the issues I was having with they keyboard freezing. In the future I plan on using the locking key to change before colemak and qwerty and move the fn key to where GRV is using shift and FN to get ` ~ and access the fkeys using FN. 

Code: [Select]
#include "keymap_common.h"

/*
 * Mastermachetier
 */
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
    * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
    * +-----------------------------------------------------+   | +---+---+---+---+
    * | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
    * +---------------------------------------------------------+ +-------+---|ent|
    * |fn0|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
    * +---------------------------------------------------------+ +-------+---+---+
    */
  KEYMAP_M0116_ANSI( \
                                     POWER,                                                          \
       ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,   NLCK,EQL, PSLS,PAST, \
       TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,        P7,  P8,  P9,  PMNS, \
       LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,    P4,  P5,  P6,  PPLS, \
       LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,   P1,  P2,  P3,        \
       FN0, LALT,LGUI,GRV,           SPC,      BSLS,LEFT,RGHT,DOWN,UP,          P0,       PDOT,PENT),

    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | power |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +----+----+--+-+---+
    * |esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| - | = | del | |    |    |    |   |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | |    |    |    | + |
    * +-----------------------------------------------------+   | +----+----+----+---+
    * | bks  | a | s | d | f | g | h | j | k | l | ; | ' |return| |    | UP |    | - |
    * +---------------------------------------------------------+ +----+----+----+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | |Left|DOWN|RGHT|   |
    * +---------------------------------------------------------+ +---------+----|ent|
    * |fn0|opt|comnd| clr|                  | \ |lef|rig|dwn|up | |  DEL    |bks |   |
    * +---------------------------------------------------------+ +---------+----+---+
    */
  KEYMAP_M0116_ANSI( \
                                     TRNS,                                                            \
       TRNS,F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10,  F11, F12, DEL,    NO  ,NO  ,NO  ,NO  , \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,         NO  ,NO  ,NO  ,TRNS, \
       BSPC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,    NO  ,UP  ,NO  ,TRNS, \
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,    LEFT,DOWN,RGHT,      \
       TRNS,TRNS,TRNS,TRNS,          TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,         DEL ,     BSPC,TRNS),

};

const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),             
};     

More

quick edit : has anyone figured out how to use bootmagic on adb ? Also can you access layers on the keyboard while in bios using function keys for the "F" keys ?
No experience with bootmagic, but that looks like some solid code. I'd borrow it but I can't seem to get my compiler to work. Oh well.


what errors are you getting ? What os are you trying to compile on ? Also what type of microcontroller?
Title: Re: ADB to USB keyboard converter
Post by: mr.squishy on Fri, 19 February 2016, 00:31:19
I'm on windows 10 with a teensy 2.0, my error is that my compiler (cygwin) can't seem to figure out how to switch directories. I'm not sure why, but when I tell it to switch directories it tells me that the directory does not exist, no matter what i put in.

Additionally, I'm getting a missing libusb0.dll error when I attempt to use the dfu programmer, so that might be my issue
Title: Re: ADB to USB keyboard converter
Post by: zhyiou on Thu, 07 April 2016, 08:00:10
Hello,

currently I scored an AEKII and am waiting for a pro micro clone from China. However, because I have to wait for such a long time I was already thinking a bit about what I wanted my keyboard to do.

I would like to make a layer in which I type greek symbols such as Δ δ and the like. However, there are no keycodes for this. From reading the documentation (I have absolutely zero experience with linux nor microcontrollers) it would seem that the keycodes are defined in common/keycode.h However, I do not quite understand how I would go about adding greek symbols to this list.

Could somebody explain this to me?

Regards,
Zhyiou

EDIT?:
I might try to use macros in the keymap_xxx.c file where a third layer has all keys substituted by e.g. FN12 keys like so:

const uint16_t PROGMEM fn_actions[] = {
    [12] = MACRO( I(0), D(ALT), T(2), T(2), T(5), U(ALT), END ) : MACRO_NONE ),
};

Would this code run a macro that types ALT+225 (which would result in ί)?

EDIT2?: Or perhaps this sequence?
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case FN12:
            return (record->event.pressed ?
                    MACRO( I(0), D(ALT), T(P2), T(P2), T(P5), U(ALT), END ) :
                    MACRO_NONE );
        case FN13:
            return (record->event.pressed ?
                    MACRO( I(0), D(ALT), T(P2), T(P2), T(P4), U(ALT), END ) :
                    MACRO_NONE );
        case LSHIFT_FN12:
        case RSHIFT_FN12:
            return (record->event.pressed ?
                    MACRO( I(0), D(ALT), T(P_), T(P_), T(P_), U(ALT), END ) :
                    return MACRO_NONE;
    }
    return MACRO_NONE;
}
Title: Re: ADB to USB keyboard converter
Post by: zhyiou on Sat, 09 April 2016, 07:26:59
And another question if anybody could help:

Currently I got a pretty decent idea for the macro, but I would like to change the behavior of the macro depending on the active layer (e.g. layer 1 is lower case, Fn0 temporary changes to layer 2, where the same key is now upper case). For this to work I got the following code:

Code: [Select]
enum macro_id {
    THETA, //first row FN1..

};

const uint16_t PROGMEM fn_actions[] = {
    [0] = ACTION_LAYER_MOMENTARY(2),                  // FN0, momentarily switch between layer 1 and 2 (greek lower and upper)

    [1] = ACTION_MACRO(THETA),                        // Macros for greek letters --> ALT+unicode

};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt, uint8_t layer) //can you add 'uint8_t layer' to know what layer is active currently?
{
    switch (id) {
        case THETA:

            #if(layer==2)              //layer 2 is upper case
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P8), U(LALT), END ) :
                    MACRO_NONE );
            #else                      // only can get to layer 3 from 2 (temporary keyaction Fn0), so if not 2 then is 1 AKA lower case
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P8), U(LALT), END ) :
                    MACRO_NONE );
    }
    return MACRO_NONE;
}

Normally, the macro would be:
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)

but can I add a variable layer like so?
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt, uint8_t layer)

TY
Title: Re: ADB to USB keyboard converter
Post by: goflo on Sat, 09 April 2016, 13:06:53
I got a ADB to USB Converter from Hasu directly and tried to get my Apple M0118 with a german layout running.

(http://computer-retro.de/Bilder/Festplatten/Macintosh-Tastatur-M0118-mit-Apple-Logo-FCC-ID-BCG6LWM0117.jpg)

The standard programming of the adbtousb converter seems to fit the Apple AEK.
Has anyone got a layout file for the M0118? Or have I overlooked it in the files?

Thx
Flo
Title: Re: ADB to USB keyboard converter
Post by: zhyiou on Sat, 09 April 2016, 13:50:01
@ goflo

as far as I can tell M0116 and M0118 are either identical or very similar. This layout can be found in https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap_common.h

Or in code format:
Code: [Select]
/* M0116 Apple Standard Keyboard ANSI
*                     +-------+
*                     | power |
*                     +-------+
* +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
* |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
* +---------------------------------------------------------+ +---+---+---+---+
* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
* +-----------------------------------------------------+   | +---+---+---+---+
* | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
* +---------------------------------------------------------+ +---+---+---+---+
* | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
* +---------------------------------------------------------+ +-------+---|ent|
* |cap|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
* +---------------------------------------------------------+ +-------+---+---+
*/
#define KEYMAP_M0116_ANSI( \
                           K7F,                                              \
   K35,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K51,K4B,K43, \
   K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,     K59,K5B,K5C,K45, \
   K36,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,    K24, K56,K57,K58,K4E, \
   K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,        K7B, K53,K54,K55,     \
   K39,K3A,K37,K32,        K31,        K2A,K3B,K3C,K3D,K3E, K52,    K41,K4C  \
) { \
  { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
  { KC_##K08, KC_##K09, KC_NO,    KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \
  { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
  { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \
  { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
  { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \
  { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_NO,    KC_##K35, KC_##K36, KC_##K37 }, \
  { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO    }, \
  { KC_NO,    KC_##K41, KC_NO,    KC_##K43, KC_NO,    KC_##K45, KC_NO,    KC_##K47 }, \
  { KC_NO,    KC_NO,    KC_NO,    KC_##K4B, KC_##K4C, KC_NO,    KC_##K4E, KC_NO    }, \
  { KC_NO,    KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
  { KC_##K58, KC_##K59, KC_NO,    KC_##K5B, KC_##K5C, KC_NO,    KC_NO,    KC_NO    }, \
  { KC_NO,    KC_NO,    KC_NO,    KC_NO   , KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
  { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
  { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
  { KC_NO   , KC_NO,    KC_NO   , KC_##K7B, KC_NO,    KC_NO,    KC_NO,    KC_##K7F }  \
}
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 09 April 2016, 20:52:56
zhyiou, you can know current layer state from uint32_t variables; layer_state and default_layer_state of common/action_layer.h. Note that each bit of the variables represent each layer state.
For example, you can know if layer 2 is enabled with
Code: [Select]
#include "action_layer.h"

if ((layer_state | default_layer_state) & (1<<2))


goflo, you can use ISO AEK layout without any acutal problem.
Title: Re: ADB to USB keyboard converter
Post by: zhyiou on Sun, 10 April 2016, 05:35:16
zhyiou, you can know current layer state from uint32_t variables; layer_state and default_layer_state of common/action_layer.h. Note that each bit of the variables represent each layer state.
For example, you can know if layer 2 is enabled with
Code: [Select]
#include "action_layer.h"

if ((layer_state | default_layer_state) & (1<<2))


goflo, you can use ISO AEK layout without any acutal problem.

Thank you so much! I know very little of programming, and nothing about either C or bitoperations. Fingers crossed that it will actually work!

For anyone perhaps interested in how I intend to add greek symbols (lower and upper case) to my keyboard, with Hasu's variable added it looks like so:
Code: [Select]
#include "keymap_common.h"
#include "action_layer.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0 Default Layer: plain keymap
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |   |
     * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  =|  /|  *|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Fn31| |Del|End|PgD| |  7|  8|  9|  -|
     * |-----------------------------------------------------------| `-----------' |---------------|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return  |               |  4|  5|  6|  +|
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
     * |Ctrl |Gui |Alt |         Space             |Alt |Gui |Ctrl | |Lef|Dow|Rig| |      0|  .|   |
     * `-----------------------------------------------------------' `-----------' `---------------'
     */
    KEYMAP_EXT_ANSI(
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,FN31,     DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
    LCTL,LGUI,LALT,                 SPC,                        RGUI,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),

    /* 1 Default Layer: Greek lower
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |   |
     * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  =|  /|  *|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |thta|omg|eps|xi|tau|psi|mu|iota|omc|rho|  [|  ]|    \| |Del|End|PgD| |  7|  8|  9|  -|
     * |-----------------------------------------------------------| `-----------' |---------------|
     * |CapsLo|alph|sig|del|ups|gam|pi|phi|kap|lmb|  ;|  '|Return  |               |  4|  5|  6|  +|
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Fn0     |zet|chi|   |nu|beta|eta|   |  ,|  ,|  /|Fn0       |     |Up |     |  1|  2|  3|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
     * |Ctrl |Gui |Alt |         Space             |Alt |Gui |Ctrl | |Lef|Dow|Rig| |      0|  .|   |
     * `-----------------------------------------------------------' `-----------' `---------------'
     */
    KEYMAP_EXT_ANSI(
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
    TAB, FN1, FN2, FN3, FN4, FN5, FN6, FN7, FN8, FN9, FN10,LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    LCAP,FN11,FN12,FN13,FN14,FN15,FN16,FN17,FN18,FN19,SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
    FN0, FN20,FN21,  NO,FN22,FN23,FN24,  NO,COMM,DOT, SLSH,          FN0,           UP,           P1,  P2,  P3,
    LCTL,LGUI,LALT,                 SPC,                        RGUI,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),

    /* 2 Default Layer: Greek upper
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |   |
     * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  =|  /|  *|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |THTA|OMG|EPS|XI|TAU|PSI|MU|IOTA|OMC|RHO|  [|  ]|    \| |Del|End|PgD| |  7|  8|  9|  -|
     * |-----------------------------------------------------------| `-----------' |---------------|
     * |CapsLo|ALPH|SIG|DEL|UPS|GAM|PI|PHI|KAP|LMB|  ;|  '|Return  |               |  4|  5|  6|  +|
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Fn0     |ZET|CHI|   |NU|BETA|ETA|   |  ,|  ,|  /|Fn0       |     |Up |     |  1|  2|  3|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
     * |Ctrl |Gui |Alt |         Space             |Alt |Gui |Ctrl | |Lef|Dow|Rig| |      0|  .|   |
     * `-----------------------------------------------------------' `-----------' `---------------'
     */
    KEYMAP_EXT_ANSI(
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,           TRNS, TRNS, TRNS,                    NO,
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,     TRNS, TRNS, TRNS,  TRNS, TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,     TRNS, TRNS, TRNS,  TRNS, TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,       TRNS,                        TRNS, TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS, NO,   TRNS, TRNS, TRNS, NO,   TRNS, TRNS, TRNS,             TRNS,           TRNS,        TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS,                       TRNS,                           TRNS, TRNS,     TRNS, TRNS, TRNS,  TRNS,       TRNS, TRNS
    ),

    /* 3 Default Layer: mouse and media keymap
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
     * |`  |   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |   |
     * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | |Ins|Hom|PgU| |NmL|Mb1|Mb2|Mb3|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|PrS|ScL|Pau|Up |Ins| Fn31| |Del|End|PgD| |MwD|McU|MwU|MwD|
     * |-----------------------------------------------------------| `-----------' |---------------|
     * |CapsLo|VoD|VoU|Mut|  F|  G|  H|  J|Hom|PgU|Lef|Rig|Return  |               |McL|McD|McR|MwU|
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|End|PgD|Dow|Shift     |     |PgU|     |MwL|McD|MwR|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Mb3|
     * |Ctrl |Gui |Alt |         Space             |Alt |Gui |Ctrl | |Hom|PgD|End| |    Mb1|Mb2|   |
     * `-----------------------------------------------------------' `-----------' `---------------'
     */
    KEYMAP_EXT_ANSI(
    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,      INS, HOME,PGUP,    NLCK,BTN1,BTN2,BTN3,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   PSCR,SLCK,PAUS,UP,  INS, FN31,     DEL, END, PGDN,    WH_D,MS_U,WH_U,WH_D,
    LCAP,VOLD,VOLU,MUTE,F,   G,   H,   J,   HOME,PGUP,LEFT,RGHT,     ENT,                         MS_L,MS_D,MS_R,WH_U,
    LSFT,Z,   X,   C,   V,   B,   N,   M,   END, PGDN,DOWN,          RSFT,          PGUP,         WH_L,MS_D,WH_R,
    LCTL,LGUI,LALT,                 SPC,                        RGUI,RCTL,     HOME,PGDN,END,     BTN1,     BTN2,BTN3
    ),
};

enum macro_id {
    THETA, //first row FN1..
    OMEGA,
    EPSILON,
    XI,
    TAU,
    PSI,
    MU,
    IOTA,
    OMICRON,
    RHO,
    ALPHA, //second row
    SIGMA,
    DELTA,
    UPSILON,
    GAMMA,
    PI,
    PHI,
    KAPPA,
    LAMBDA,
    ZETA, //third row
    CHI,
    NU,
    BETA,
    ETA, // FN24
};

const uint16_t PROGMEM fn_actions[] = {
    [0] = ACTION_LAYER_MOMENTARY(2),                  // FN0, momentarily switch between layer 1 and 2 (greek lower and upper)

    [1] = ACTION_MACRO(THETA),                        // Macros for greek letters --> Unicode format
    [2] = ACTION_MACRO(OMEGA),
    [3] = ACTION_MACRO(EPSILON),
    [4] = ACTION_MACRO(XI),
    [5] = ACTION_MACRO(TAU),
    [6] = ACTION_MACRO(PSI),
    [7] = ACTION_MACRO(MU),
    [8] = ACTION_MACRO(IOTA),
    [9] = ACTION_MACRO(OMICRON),
    [10] = ACTION_MACRO(RHO),
    [11] = ACTION_MACRO(ALPHA),
    [12] = ACTION_MACRO(SIGMA),
    [13] = ACTION_MACRO(DELTA),
    [14] = ACTION_MACRO(UPSILON),
    [15] = ACTION_MACRO(GAMMA),
    [16] = ACTION_MACRO(PI),
    [17] = ACTION_MACRO(PHI),
    [18] = ACTION_MACRO(KAPPA),
    [19] = ACTION_MACRO(LAMBDA),
    [20] = ACTION_MACRO(ZETA),
    [21] = ACTION_MACRO(CHI),
    [22] = ACTION_MACRO(NU),
    [23] = ACTION_MACRO(BETA),
    [24] = ACTION_MACRO(ETA),

    [31] = ACTION_LAYER_TAP_KEY(3, KC_BSLS),          // FN31, switch to mouse and media keymap
};

// use unicodes to input non-standard characters: D(LALT), T(PPLS), T(P3), T(B), T(P8), U(LALT) = U+03B8 / x3B8 for lower case theta

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case THETA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P8), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P8), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case OMEGA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P9), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P9), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case EPSILON:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P5), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P5), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case XI:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(E), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(E), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case TAU:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P4), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P4), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case PSI:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P8), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P8), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case MU:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(C), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(C), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case IOTA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P9), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P9), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case OMICRON:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(F), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(F), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case RHO:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P1), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P1), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case ALPHA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P1), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P1), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case SIGMA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P3), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P3), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case DELTA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P4), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P4), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case UPSILON:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P5), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P5), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case GAMMA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P3), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P3), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case PI:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P0), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P0), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case PHI:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P6), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P6), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case KAPPA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(A), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(A), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case LAMBDA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(B), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(B), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case ZETA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P6), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P6), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case CHI:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(A), T(P7), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(C), T(P7), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case NU:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(D), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(D), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case BETA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P2), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P2), U(LALT), END ) :
                    MACRO_NONE );
            #endif

        case ETA:
            #if ((layer_state | default_layer_state) & (1<<2))
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(P9), T(P7), U(LALT), END ) :
                    MACRO_NONE );
            #else
            return (record->event.pressed ?
                    MACRO( I(0), D(LALT), T(PPLS), T(P3), T(B), T(P7), U(LALT), END ) :
                    MACRO_NONE );
            #endif
    }
    return MACRO_NONE;
}


The code is based on Hasu's keymap, with a default layer (0), and a key to switch to a mouse/media layer, which I switched to layer 3 with FN31 instead of layer 1 with FN0.

I intend to switch to my greek symbols layout via Magic+1/F1 command so that it does not go by accident.
In the first layer (lower case greek symbols, layer 1) I switched out the RSHIFT and LSHIFT with Fn0, making this key temporarily switch to layer 2 - with all the keys the same (TRNS).

In my macro, I test if the current layer is 2 or not (thanks Hasu!) and depending on the answer, I make the macro input the unicode for either lower or upper case greek letter. Hopefully this works (should get my pro micro clones sometime next weekend to test), and if anybody wishes to use this feel free!
Title: Re: ADB to USB keyboard converter
Post by: goflo on Tue, 12 April 2016, 10:04:39
I forgot the KEYMAP=iso, now it fits much better. I tweaked the iso mapping a bit (see below).
One key refuses to give me some output, the key right of the left shift key (> <) that is labeled "NUBS" in the layout.
But if I use xev and press the key I get the following output:

Code: [Select]
KeyPress event, serial 37, synthetic NO, window 0x4000001,
    root 0x1de, subw 0x0, time 3623194, (24,-59), root:(766,381),
    state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
    XLookupString gives 1 bytes: (1b) ""
    XmbLookupString gives 1 bytes: (1b) ""
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4000001,
    root 0x1de, subw 0x0, time 3623314, (50,-47), root:(792,393),
    state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
    XLookupString gives 1 bytes: (1b) ""
    XFilterEvent returns: Fals

The layout used is this one:

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Layer 0: QWERTZ Layout */
    KEYMAP_EXT_ISO(
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,          PSCR,SLCK,PAUS,                   MUTE,
    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,    INS, HOME,PGUP,    NLCK,PEQL,PSLS,PAST,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,ENT,     DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,                            P4,  P5,  P6,  PPLS,
    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RSFT,         UP,           P1,  P2,  P3,
    LCTL,LALT,FN0,          SPC,                               RALT,RALT,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),
    /* Layer 1: */
    KEYMAP_EXT_ISO(
    TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,         TRNS,TRNS,TRNS,                  TRNS,
    TRNS, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10,  F11,F12, DEL,     TRNS,TRNS,TRNS,   TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,   TRNS,TRNS,TRNS,   TRNS,  TRNS,  TRNS,  TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,                          TRNS,  TRNS,  TRNS,  TRNS,
    TRNS,RALT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,             VOLU,        TRNS,  TRNS,  TRNS,
    TRNS,TRNS,TRNS,          TRNS,                           TRNS,TRNS,        TRNS,VOLD,MUTE,   TRNS,    TRNS,TRNS
    ),
};

const uint16_t PROGMEM fn_actions[] = {
     /* QWERTZ Layout */
    [0] = ACTION_LAYER_MOMENTARY(1),  // to Fn over
};

Maybe someone has got an idea, why the keypress isn't recognized by the firmware.
All other keys are functional.

Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 13 April 2016, 00:00:00
goflo,

Very old bug, seems I failed to fix that.
https://github.com/tmk/tmk_keyboard/issues/35

This is patch for this to swap K32 and K0A. I'll update repository soon.
Quote

diff --git a/converter/adb_usb/keymap_common.h b/converter/adb_usb/keymap_common.h
index bdca38e..c11a4b3 100644
--- a/converter/adb_usb/keymap_common.h
+++ b/converter/adb_usb/keymap_common.h
@@ -93,10 +93,10 @@ extern const uint16_t fn_actions[];
  */
 #define KEYMAP_EXT_ISO( \
     K35,  K7A,K78,K63,K76, K60,K61,K62,K64, K65,K6D,K67,K6F, K69,K6B,K71,              K7F, \
-    K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74,  K47,K51,K4B,K43, \
+    K0A,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74,  K47,K51,K4B,K43, \
     K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K24, K75,K77,K79,  K59,K5B,K5C,K4E, \
     K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K2A,                   K56,K57,K58,K45, \
-    K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,    K7B,     K3E,      K53,K54,K55,     \
+    K38,K32,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,    K7B,     K3E,      K53,K54,K55,     \
     K36,K3A,K37,        K31,                        K7C,K7D, K3B,K3D,K3C,  K52,    K41,K4C  \
 ) { \
     { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \

EDIT: pushed this fix to github repository (and add untested M0118 keymap)
Title: Re: ADB to USB keyboard converter
Post by: goflo on Wed, 13 April 2016, 11:06:28
Yes !!!!   Thanks alot.  :thumb:
M0118 German layout working fine now.
What a fine little keyboard  :D
Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Wed, 04 May 2016, 04:08:06
I don't have a 1k resistor with me right now, but I have two 1.5k available. Would either of 1.5k or 750 pull-up work?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 04 May 2016, 04:46:24
Either of them will work. Just try it and report.
Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Wed, 04 May 2016, 10:52:47
Yep. 1.5k resistor worked splendidly (I didn't try 750 setup). Thanks!
Title: Re: ADB to USB keyboard converter
Post by: guster11 on Wed, 04 May 2016, 12:39:18
Has anyone had any issues with dfu-programmer on windows? I have installed the drivers for libusb after it first wouldn't start due due to the lack of that. Now whenever I try to run the program, it opens and instantly closes. I can't make without it so I am sort of stuck at the moment.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 04 May 2016, 17:09:53
How do you run the program? I afraid you double click it :)
Title: Re: ADB to USB keyboard converter
Post by: guster11 on Wed, 04 May 2016, 18:14:10
How do you run the program? I afraid you double click it :)

I am trying to use the precompiled version that has an exe, so admittedly I had tried that.  :))

 I also tried running as an admin to no luck, should I be opening it through cygwin?
Title: Re: ADB to USB keyboard converter
Post by: need on Sun, 08 May 2016, 08:38:33
Will the same pre-made converter works with M0116 and AEKII ISO and AEKII ANSI at the same time (no need for changing the hex file if I keep swapping keyboards) ?

EDIT: also, can someone please let know how do I do this part :

To build firmware:

$ make -f Makefile clean
$ make -f Makefile

Is this a code to put in ? I'm so frustrated in trying to build my converter... :-\
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 08 May 2016, 18:10:27
Yes, the converrter should work with all ADB keyboads, ISO keyboards have weird swap keys but it still works. You may want to use ISO keymap though.
https://github.com/tmk/tmk_keyboard/issues/35

The first of make comamnd removes compiled firmware files created by previous run and second one creates compiled firmware binary. You can flash the binary into your converter with your favorite tool.

$ mkae -f Makefile dfu

This will work for you if you installed dfu-programmer. Did you read the doc? :(
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md#2-program-with-dfu-bootloader
Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Mon, 09 May 2016, 00:47:56
Also, if you are using pro micro it has ATmega32u4, so use the rev1 makefile.

Code: [Select]
make -f Makefile.rev1
Took me some 15 minutes to figure out why nothing was happening when I ran make with vanilla file  :))

@hasu would editing vanilla Makefile to change the target make it work with Pro Micro or are there other differences?
Title: Re: ADB to USB keyboard converter
Post by: need on Mon, 09 May 2016, 07:26:23
Yes I'm using a pro micro, and now I tried the rev1 command, but it shows up this  :-\:
Does anyone know what's happening ? I got dfu programmer installed (flashes and closed when I try to open it).
Title: Re: ADB to USB keyboard converter
Post by: orihalcon on Fri, 20 May 2016, 19:33:16
Hello All,

I just started using Hasu's awesome ADB converter and it's an all around great project!

Does anyone know how to go about updating hex file after getting it into bootloader mode using the bootloader magic key?

I am using a Pro Micro.

I was able to get to the bootloader mode as evidenced by the output in HID listen when using Power Key + Pause, but then it just reboots after about 5 seconds.

During the short time  showing up while it is in the bootloader, so I can't program it with Arduino Builder since I don't see a new COM port show up.

Main reason for wanting to do this is for those that have their Arduinos mounted inside their case so that a manual reset doesn't need to be done each time you want to modify the firmware.

Anyone else have success with a Pro Micro and the bootloader magic key, and if so, how is it done?

Thanks in advance!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 20 May 2016, 19:57:09
It seems Power+Pause jumps the controller into bootlaoder mode successfully but the bootloader runs keyboard application immediately for some reason.
I guess Pro Micro's bootloader checks some condition to decide if it stays in bootloader or starts application code. It is maybe magic number in somewhere in SRAM.
You have to meet the condition before jumping to bootloader with the magic key combo.

This is related to this topic.
https://github.com/tmk/tmk_keyboard/issues/256

EDIT: this codes is what you need, methink.
https://github.com/ahtn/tmk_keyboard/commit/773d609bd87d15bb48b3176209c2e2db0b2db178#diff-15c696338fb35b3fa3201e97e19ece2eR112
Title: Re: ADB to USB keyboard converter
Post by: orihalcon on Sun, 22 May 2016, 13:50:53
Yeah, that looks like what I need, though I'm not sure how to implement it.  I assume those lines need to get copied into a certain file?  Once that's done, is it the same bootloader magic combination to test if it works? Thanks!
Title: Re: ADB to USB keyboard converter
Post by: need on Tue, 24 May 2016, 16:51:56
EDIT: My other machine (Win7 32bit) works nicely ! But my daily machine (Win7 64bit) doesn't work...
Thank you hasu, it works perfectly with my ISO AEKII  :D

I've finally put everything together using a teensy, but it doesn't work.

I thought everything have went smoothly, but the keyboard doesn't register any key strokes.
When I plugged it in, the numlock, caps lock and scroll lock LED lights flashed once.

There's nothing happens when the keyboard is plugged in, only the converter is recognised by the computer. (Win7)

Here are some photos, it takes so long to install driver, but finally everything has the green tick next to them.

Thank you !
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 24 May 2016, 17:22:22
EDIT: My other machine (Win7 32bit) works nicely ! But my daily machine (Win7 64bit) doesn't work...
Thank you hasu, it works perfectly with my ISO AEKII  :D

Congrat!
EDIT: As for Windows problem try removing all of drivers related to the converter, or chainging VID and PID.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Build#2-remove-drivers-from-device-managerwindows

BTW,
The converter supports ISO layout by autodetect layout now. I think it should work :D With this one firmware can work with both ANSI and ISO. Anyone with both keyboards, test it!
https://github.com/tmk/tmk_keyboard/commit/49f44a2aedce6d727d9e6aa7998e766b899c6eda
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 24 May 2016, 17:29:57
Yeah, that looks like what I need, though I'm not sure how to implement it.  I assume those lines need to get copied into a certain file?  Once that's done, is it the same bootloader magic combination to test if it works? Thanks!

You can place it in your own keymap as athn did, or replace this function with the code.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/avr/bootloader.c#L99
Title: Re: ADB to USB keyboard converter
Post by: need on Tue, 24 May 2016, 19:47:16
I tried the new firmware, but the output keys are the same...meaning some keys are incorrect on the ISO.

Or did I get this wrong?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 24 May 2016, 19:53:50
I tried the new firmware, but the output keys are the same...meaning some keys are incorrect on the ISO.

Or did I get this wrong?

I'm not sure but  thanks for your testing. Seems that we need another testers!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 24 May 2016, 20:29:23
I tried the new firmware, but the output keys are the same...meaning some keys are incorrect on the ISO.

Or did I get this wrong?

I found a bug. Can you test it again with the latest code on github?
And let me know your ISO keyboard's handler_id with using 'hid_listen' tool if possible. You will see handler_id on hid_listen at startup.
Title: Re: ADB to USB keyboard converter
Post by: need on Wed, 25 May 2016, 12:32:18
I tried the newest one, there are three two keystrokes incorrect (but I personally don't use those keys at all...)

[attach=1]
Sorry I don't know what those are called:
1. Both keys in RED gives the same keys as ORANGE
2.    \   in BLUE gives  `  instead
I think this is correct.
Actually I got a question, do you know why ` looks like \  on the keycap?
[attach=3]

For hid_listen, it got stuck here forever:
[attachimg=2]

By the way, the deleting all drivers method works like a charm, and now it's being typed on my main computer. Thanks!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 25 May 2016, 20:13:17
Thanks for testing this.

Quote
For hid_listen, it got stuck here forever:

Open hid_listen, after that plug-in, you will see output like this.


Listening:
handler_id: 01 -> 01
Keyboard start.

Title: Re: ADB to USB keyboard converter
Post by: vulgris on Fri, 27 May 2016, 09:20:32
Hey guys,

first of all i want to thank you for these impressive work.
It inspired me, to buy a cheap AEK II on eBay and work my own into this thing.

As far as im not good im programming stuff, I asked my friend to do the coding for me.
He took the code and compiled it and packed it on an MicroPro. He said that it is now recognized as an Converter under Linux.
I first stick it into my machine (iMac 21 2015 El Capitan) and there was no reaction at all. The code was not modified at all.

Could there be a problem with the coding? Should the code have been adapted?
Is there any problem, or why don't i get any information by plugging the converter on?

The next strange thing is that when i plug the converter on (wired as you can see in this picture) the status lamps of the AEK II flash for one sec and then get dark.
No other reaction here. I could not stroke a single key or something.

(http://i.imgur.com/PGTJD3K.jpg)

(http://i.imgur.com/3Z5gSNd.jpg)

Is there any kind of wrong wiring or should i use another pull-up-resistor? (now 1K)

Would be glad if you could help me out.

Thanks so far for your help!
Title: Re: ADB to USB keyboard converter
Post by: need on Fri, 27 May 2016, 18:07:01
Quote

And let me know your ISO keyboard's handler_id with using 'hid_listen' tool if possible. You will see handler_id on hid_listen at startup.

[attach=1]

I just wanna know... why do you need this?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 27 May 2016, 19:27:51
need, thank you. handler id of your keyboard is 5 originally(and the converter changes to 3) to support extended function. You can know whether the keyboard is ANSI or ISO from the id and swap weird scan codes for ISO.
https://github.com/tmk/tmk_keyboard/issues/35
https://github.com/tmk/tmk_keyboard/commit/f43a2df7614503708818c258439d3a7c90d65e95#diff-8afe7f90ed21578b25dd1ad5fe82c810R77

vulgris, wiring looks good, I guess your board is 3.3V version? you need 5V one.
Title: Re: ADB to USB keyboard converter
Post by: vulgris on Sat, 28 May 2016, 06:52:49
Hey hasu,

thanks for the fast reply.

As far as my eBay contact described it should be a 5V version.
Any other suggestions?

Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 28 May 2016, 07:26:36
Is it recognized as a keyboard on your PC? If so check your wiring again. If not measure voltage of vcc with dmm to check if it is really 5v.

Sent from my Nexus 5X using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Mon, 30 May 2016, 04:08:59
It looks to me from the pic that J1 jumper is connected, so it should be 5V.

On one of these that I have inputs simply don't work. I can program the LEDs for instance, but any input is just ignored on the I/O pins (don't know for output). @vulgris have you tried using it with any other board/firmware to check if it works?
Title: Re: ADB to USB keyboard converter
Post by: vulgris on Thu, 02 June 2016, 07:41:28
Thanks for the comments guys.

I tryed a Teensy 2.0 and everything works fine. No problem now.
Think there was a problem with the compiled code for the MicroPro.

My mac now recognizes the adb converter and all keys are functional.

The only thing that is strange is that the status lamps such as num roll or caps will not shine.
There is no reaction when Im for example activate the caps mode. This only happens under OSX (El capitan btw).

When I use the converter under Linux all the lamps are functional. The converter even switches the keyboard layout from German to English (because of my Linux OS).

Ar there any suggestions what this problem could cause and what I could do about it? Is it only a software thing?

Thanks for the great help so far! And sorry for my sh**** english =)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 04 June 2016, 09:56:17
UPDATE:
Code was updated in repository and Apple Adjustable Keyboard's volume keys are supported now.
https://github.com/tmk/tmk_keyboard/issues/130#issuecomment-223759515
Title: Re: ADB to USB keyboard converter
Post by: Aran.E99 on Thu, 23 June 2016, 19:58:00
hey guys,

I'm new here  :p , but certainly not to the keyboard community. I'm not a programming whiz considering i'm younger however I know soldering, and all the hardware behind the project (already done). this is a very... basic question that may have an obvious answer. basically i have my teensy 2.0 all wired up etc. but i'm not sure how to get all the code files onto my teensy. I know that a loader is necessary (i have one) but i can't seem to get it working. what i am asking is can anyone briefly guide me guide me through the steps. with the loader it wants me to import a .hex image. to do this would I get all the '.c' and '.h' files from the github page and then compile them and format it to a .hex?. sorry if i was brief but i have been up all night working this out. Also, if there are instructions somewhere, i certainly don't know about them and if that is the case, i am deeply sorry for my ignorance, i am more of a 'get it done fast' guy

Thanks a lot guys,
-Aran
Title: Re: ADB to USB keyboard converter
Post by: Aran.E99 on Sat, 25 June 2016, 16:45:56
deeply sorry for my ignorance, I have found the correct way to do it realizing the tutorial was there waiting for me. either way I am about to test it.

Aran
Title: Re: ADB to USB keyboard converter
Post by: chaos_jockey on Thu, 11 August 2016, 15:49:00
I'm ignorant, this all works with the Apple Adjustable Keyboard (and it's numpad extension) with a teensy 2.0 ++, correct?

I got it all compiled and flashed but when I hook everything up and plug it in there isn't any output. Windows detects the HID and the teensy flashes whenever I press a key.

I can post pictures of my setup but I promise you I made sure the wiring and resistor is all correct. The only different thing I did was plug jumper wires into the adb socket on the keyboard then plug 'em into a breadboard with the teensy.

I just grabbed a spare s-video cable to replace the jumper wires but it's quite long (planning on shortening it), and I don't want to harvest my only ADB cables. We'll see how that goes, just wanted to post about my complication to see if somebody could enlighten me.

I am willing to solder directly to the keyboards pcb but only as a last resort.
Title: Re: ADB to USB keyboard converter
Post by: Aran.E99 on Thu, 11 August 2016, 19:06:19
I'm ignorant, this all works with the Apple Adjustable Keyboard (and it's numpad extension) with a teensy 2.0 ++, correct?

I got it all compiled and flashed but when I hook everything up and plug it in there isn't any output. Windows detects the HID and the teensy flashes whenever I press a key.

I can post pictures of my setup but I promise you I made sure the wiring and resistor is all correct. The only different thing I did was plug jumper wires into the adb socket on the keyboard then plug 'em into a breadboard with the teensy.

I just grabbed a spare s-video cable to replace the jumper wires but it's quite long (planning on shortening it), and I don't want to harvest my only ADB cables. We'll see how that goes, just wanted to post about my complication to see if somebody could enlighten me.

I am willing to solder directly to the keyboards pcb but only as a last resort.

sure you have the ADB pinout correct?

maybe you have accidentally connected the wrong pin / connected to multiple pins on the teensy?
Title: Re: ADB to USB keyboard converter
Post by: chaos_jockey on Fri, 12 August 2016, 09:12:11
I'm ignorant, this all works with the Apple Adjustable Keyboard (and it's numpad extension) with a teensy 2.0 ++, correct?

I got it all compiled and flashed but when I hook everything up and plug it in there isn't any output. Windows detects the HID and the teensy flashes whenever I press a key.

I can post pictures of my setup but I promise you I made sure the wiring and resistor is all correct. The only different thing I did was plug jumper wires into the adb socket on the keyboard then plug 'em into a breadboard with the teensy.

I just grabbed a spare s-video cable to replace the jumper wires but it's quite long (planning on shortening it), and I don't want to harvest my only ADB cables. We'll see how that goes, just wanted to post about my complication to see if somebody could enlighten me.

I am willing to solder directly to the keyboards pcb but only as a last resort.

sure you have the ADB pinout correct?

maybe you have accidentally connected the wrong pin / connected to multiple pins on the teensy?
(http://uploads.tapatalk-cdn.com/20160812/a67281203d6b469ae66874d47d01c5c8.jpg)

Sent from my SM-G935V using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: Aran.E99 on Fri, 12 August 2016, 09:33:59
I'm ignorant, this all works with the Apple Adjustable Keyboard (and it's numpad extension) with a teensy 2.0 ++, correct?

I got it all compiled and flashed but when I hook everything up and plug it in there isn't any output. Windows detects the HID and the teensy flashes whenever I press a key.

I can post pictures of my setup but I promise you I made sure the wiring and resistor is all correct. The only different thing I did was plug jumper wires into the adb socket on the keyboard then plug 'em into a breadboard with the teensy.

I just grabbed a spare s-video cable to replace the jumper wires but it's quite long (planning on shortening it), and I don't want to harvest my only ADB cables. We'll see how that goes, just wanted to post about my complication to see if somebody could enlighten me.

I am willing to solder directly to the keyboards pcb but only as a last resort.

sure you have the ADB pinout correct?

maybe you have accidentally connected the wrong pin / connected to multiple pins on the teensy?
Show Image
(http://uploads.tapatalk-cdn.com/20160812/a67281203d6b469ae66874d47d01c5c8.jpg)


Sent from my SM-G935V using Tapatalk

the wiring looks fine, maybe you have one of those 'booby trap' breadboards where the rows are connected? it's rare but i have bought faulty breadboard before off of ebay. try connecting the wires directly to the pins so that we can rule out that however its highly unlikely. if not, it may be that your code is faulty, double check you compiled correctly and that you used teensy loader correctly (unless you used something different).
Title: Re: ADB to USB keyboard converter
Post by: chaos_jockey on Fri, 12 August 2016, 10:30:48
Attached the jumpers and resistors directly to the teensy and it hasn't made a difference. Gave hid_listen a try and here's the output:

Waiting for new device:.....
Listening:
Before init:
After init:
debug enabled.
Keyboard start.

Pressing keys doesn't do anything.

The only thing I've edited are these lines in Makefile.teensy

line   69 MCU = at90usb1286
line 124 OPT_DEFS += -DBOOTLOADER_SIZE=4096
Title: Re: ADB to USB keyboard converter
Post by: Aran.E99 on Fri, 12 August 2016, 10:45:19
Attached the jumpers and resistors directly to the teensy and it hasn't made a difference. Gave hid_listen a try and here's the output:

Waiting for new device:.....
Listening:
Before init:
After init:
debug enabled.
Keyboard start.

Pressing keys doesn't do anything.

The only thing I've edited are these lines in Makefile.teensy

line   69 MCU = at90usb1286
line 124 OPT_DEFS += -DBOOTLOADER_SIZE=4096

ok, that is odd. i would recommend starting the makefile from fresh in case you accidentally put down the wrong code.
Title: Re: ADB to USB keyboard converter
Post by: chaos_jockey on Fri, 12 August 2016, 10:51:57
Attached the jumpers and resistors directly to the teensy and it hasn't made a difference. Gave hid_listen a try and here's the output:

Waiting for new device:.....
Listening:
Before init:
After init:
debug enabled.
Keyboard start.

Pressing keys doesn't do anything.

The only thing I've edited are these lines in Makefile.teensy

line   69 MCU = at90usb1286
line 124 OPT_DEFS += -DBOOTLOADER_SIZE=4096

ok, that is odd. i would recommend starting the makefile from fresh in case you accidentally put down the wrong code.
Not to sound snarky but I literally did that minutes before my last post just to make sure.

Sent from my SM-G935V using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: Aran.E99 on Fri, 12 August 2016, 11:00:33
Attached the jumpers and resistors directly to the teensy and it hasn't made a difference. Gave hid_listen a try and here's the output:

Waiting for new device:.....
Listening:
Before init:
After init:
debug enabled.
Keyboard start.

Pressing keys doesn't do anything.

The only thing I've edited are these lines in Makefile.teensy

line   69 MCU = at90usb1286
line 124 OPT_DEFS += -DBOOTLOADER_SIZE=4096

ok, that is odd. i would recommend starting the makefile from fresh in case you accidentally put down the wrong code.
Not to sound snarky but I literally did that minutes before my last post just to make sure.

Sent from my SM-G935V using Tapatalk

being honest, that is all i can really think of that could've gone wrong. i'm sure that your chip is supported but the only other thing i can recommend is either buying s new teensy or testing it on another pc.
Title: Re: ADB to USB keyboard converter
Post by: chaos_jockey on Fri, 12 August 2016, 11:06:59
Attached the jumpers and resistors directly to the teensy and it hasn't made a difference. Gave hid_listen a try and here's the output:

Waiting for new device:.....
Listening:
Before init:
After init:
debug enabled.
Keyboard start.

Pressing keys doesn't do anything.

The only thing I've edited are these lines in Makefile.teensy

line   69 MCU = at90usb1286
line 124 OPT_DEFS += -DBOOTLOADER_SIZE=4096

ok, that is odd. i would recommend starting the makefile from fresh in case you accidentally put down the wrong code.
Not to sound snarky but I literally did that minutes before my last post just to make sure.

Sent from my SM-G935V using Tapatalk

being honest, that is all i can really think of that could've gone wrong. i'm sure that your chip is supported but the only other thing i can recommend is either buying s new teensy or testing it on another pc.
Aside from using a multimeter to test if it has power, is there any other way I can test if it's fried without an old Mac or buying an adb to usb adapter? Since buying one would defeat the purpose.

Has anyone wrote something that flashes the led on the teensy when a key is pressed? That could more or less test if it's fried, yeah?

Sent from my SM-G935V using Tapatalk
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 12 August 2016, 20:06:29
I'm ignorant, this all works with the Apple Adjustable Keyboard (and it's numpad extension) with a teensy 2.0 ++, correct?

I got it all compiled and flashed but when I hook everything up and plug it in there isn't any output. Windows detects the HID and the teensy flashes whenever I press a key.

I can post pictures of my setup but I promise you I made sure the wiring and resistor is all correct. The only different thing I did was plug jumper wires into the adb socket on the keyboard then plug 'em into a breadboard with the teensy.

I just grabbed a spare s-video cable to replace the jumper wires but it's quite long (planning on shortening it), and I don't want to harvest my only ADB cables. We'll see how that goes, just wanted to post about my complication to see if somebody could enlighten me.

I am willing to solder directly to the keyboards pcb but only as a last resort.

sure you have the ADB pinout correct?

maybe you have accidentally connected the wrong pin / connected to multiple pins on the teensy?
Show Image
(http://uploads.tapatalk-cdn.com/20160812/a67281203d6b469ae66874d47d01c5c8.jpg)


Sent from my SM-G935V using Tapatalk



I confirmed my firmware works fine with Teensy 2.0++ and Adjustable keyboard,  so I'm 99% sure that your problem is your wiring or hardware now.

Your edited Makefile looks fine, I also used Makefile.teensy just with 'MCU = at90usb1286' like yours. I think bootloader size is not matter either way.

From the pic it looks good on controller side but you could still fail to wire on connector/cable side. Or your keyboard, cable or Teensy also can have defect certainly but I guess not for some reason.

Title: Re: ADB to USB keyboard converter
Post by: chaos_jockey on Fri, 12 August 2016, 20:14:57
I'm ignorant, this all works with the Apple Adjustable Keyboard (and it's numpad extension) with a teensy 2.0 ++, correct?

I got it all compiled and flashed but when I hook everything up and plug it in there isn't any output. Windows detects the HID and the teensy flashes whenever I press a key.

I can post pictures of my setup but I promise you I made sure the wiring and resistor is all correct. The only different thing I did was plug jumper wires into the adb socket on the keyboard then plug 'em into a breadboard with the teensy.

I just grabbed a spare s-video cable to replace the jumper wires but it's quite long (planning on shortening it), and I don't want to harvest my only ADB cables. We'll see how that goes, just wanted to post about my complication to see if somebody could enlighten me.

I am willing to solder directly to the keyboards pcb but only as a last resort.

sure you have the ADB pinout correct?

maybe you have accidentally connected the wrong pin / connected to multiple pins on the teensy?
Show Image
(http://uploads.tapatalk-cdn.com/20160812/a67281203d6b469ae66874d47d01c5c8.jpg)


Sent from my SM-G935V using Tapatalk



I confirmed my firmware works fine with Teensy 2.0++ and Adjustable keyboard,  so I'm 99% sure that your problem is your wiring or hardware now.

Your edited Makefile looks fine, I also used Makefile.teensy just with 'MCU = at90usb1286' like yours. I think bootloader size is not matter either way.

From the pic it looks good on controller side but you could still fail to wire on connector/cable side. Or your keyboard, cable or Teensy also can have defect certainly but I guess not for some reason.
Edit: I was looking at my svideo cable backwards.... No fault to you, Hasu. I very much appreciate your help with this.

P.S. Feeling like an idiot >.<

Sent from my SM-G935V using Tapatalk
Title: Re: ADB to USB keyboard converter
Post by: slabdabs on Tue, 23 August 2016, 22:21:01
I've spent the entire day pulling my hair out over this!  :eek:
I'm using a Pro Micro ATMega32u4, I have set in the makefile the proper chip type.
I've checked wiring with a multimeter, on my original cable end, on the female adapter I have on there now, on various ADB cables running through it.
I have a resistor added though that only seemed to solve my mouse moving.

I tested this chip with the HID_Listen blinking script so the chip itself works.
Testing it with the ADB to USB hex will recognize it *should* be a keyboard but still will not take in any inputs.

I've tried with MANY keyboards and cables, I currently have nearly 70 vintage Apple Boards in my living room so I tried a variety of them including knock off that use ADB.

I'd be happy with even incorrect inputs being sent at this point! Does anyone have suggestions or an ATMega32u4 .hex that worked for them I could try?

Edit: Forgot to add I even tried changing the Data line in the makefile and changing where it was actually soldered too. (To FD4)

Thanks!

(http://i.imgur.com/HZUjVpY.jpg)
(http://i.imgur.com/Ifcy79i.jpg)
(http://i.imgur.com/OguXjyU.jpg)
Title: Re: ADB to USB keyboard converter
Post by: slabdabs on Tue, 23 August 2016, 23:44:26
OH LORD
So uhhhh since I had a mega pack of resistors....
(https://usercontent.irccloud-cdn.com/file/8vNFX06x/irccloudcapture-951659913.jpg)

Hugest face palm ever, so now they're alive!!!!!

(https://usercontent.irccloud-cdn.com/file/0lX1pqSK/irccloudcapture-839435272.jpg)
(https://usercontent.irccloud-cdn.com/file/CENGRV7M/irccloudcapture-656743045.jpg)
Title: Re: ADB to USB keyboard converter
Post by: Aran.E99 on Wed, 24 August 2016, 07:22:18
OH LORD
So uhhhh since I had a mega pack of resistors....
Show Image
(https://usercontent.irccloud-cdn.com/file/8vNFX06x/irccloudcapture-951659913.jpg)


Hugest face palm ever, so now they're alive!!!!!

Show Image
(https://usercontent.irccloud-cdn.com/file/0lX1pqSK/irccloudcapture-839435272.jpg)

Show Image
(https://usercontent.irccloud-cdn.com/file/CENGRV7M/irccloudcapture-656743045.jpg)


oh
my
lord

you have a lot of keyboards xD

are they all alps switches?
Title: Re: ADB to USB keyboard converter
Post by: slabdabs on Wed, 24 August 2016, 09:06:54
oh
my
lord

you have a lot of keyboards xD

are they all alps switches?
All of the ones in that picture aside from the few Apple I keyboards are all ALPs, so like 60ish alps boards.
Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Wed, 24 August 2016, 09:18:28
The Adjustable keyboards are not ALPS SKCL/M though. And those smaller ones on the left are Apple Keyboard II, and not Apple ADB Keyboards I believe, and these also don't have Alps. But that lot of 50ish AEK IIs  :eek:
Title: Re: ADB to USB keyboard converter
Post by: slabdabs on Sun, 28 August 2016, 18:40:57
So, I have a 1K Ohm resistor on my adapter and using a Y splitter it appears to run two keyboards just fine!

(https://usercontent.irccloud-cdn.com/file/4xUNvDgO/20160828_173904.jpg)
Title: Re: ADB to USB keyboard converter
Post by: rmwatson on Mon, 05 September 2016, 21:29:20
Hi All,

Great project!

I am giving this one a go myself. Having trouble generating the HEX file on windows. Has anyone seen this error when compiling,

../../tmk_core/common/keymap.c: In function 'keymap_fn_to_action':
../../tmk_core/common/keymap.c:246: internal compiler error: in iterative_hash_expr, at tree.c:5363
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://sourceforge.net/tracker/?atid=520074&group_id=68108&func=browse> for instructions.
make: *** [obj_adb_usb_teensy/common/keymap.o] Error 1



Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 06 September 2016, 14:07:17
Hi All,

Great project!

I am giving this one a go myself. Having trouble generating the HEX file on windows. Has anyone seen this error when compiling,

../../tmk_core/common/keymap.c: In function 'keymap_fn_to_action':
../../tmk_core/common/keymap.c:246: internal compiler error: in iterative_hash_expr, at tree.c:5363
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://sourceforge.net/tracker/?atid=520074&group_id=68108&func=browse> for instructions.
make: *** [obj_adb_usb_teensy/common/keymap.o] Error 1





Try this.
https://github.com/tmk/tmk_keyboard/wiki/Build-firmware-on-VirtualBox
Title: Re: ADB to USB keyboard converter
Post by: rmwatson on Tue, 06 September 2016, 17:12:13
Hi All,

Great project!

I am giving this one a go myself. Having trouble generating the HEX file on windows. Has anyone seen this error when compiling,

../../tmk_core/common/keymap.c: In function 'keymap_fn_to_action':
../../tmk_core/common/keymap.c:246: internal compiler error: in iterative_hash_expr, at tree.c:5363
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://sourceforge.net/tracker/?atid=520074&group_id=68108&func=browse> for instructions.
make: *** [obj_adb_usb_teensy/common/keymap.o] Error 1





Try this.
https://github.com/tmk/tmk_keyboard/wiki/Build-firmware-on-VirtualBox

That worked. Thank you.
Title: Re: ADB to USB keyboard converter
Post by: claimempty on Sat, 10 September 2016, 01:59:41
Hi i've been struggling for the last few hours to get the a abd to usb converter teensy converter to work. The output i get out of hid_listen is this whether the keyboard is plugged in or not.
Code: [Select]
Listening:
Before init:
Scan: addr:1, reg3:FFE2
Scan: addr:2, reg3:FFE2
Scan: addr:3, reg3:FFE2
Scan: addr:4, reg3:FFE2
Scan: addr:5, reg3:FFE2
Scan: addr:6, reg3:FFE2
Scan: addr:7, reg3:FFE2
Scan: addr:8, reg3:FFE2
Scan: addr:9, reg3:FFE2
Scan: addr:10, reg3:FFE2
Scan: addr:11, reg3:FFE2
Scan: addr:12, reg3:FFE2
Scan: addr:13, reg3:FFE2
Scan: addr:14, reg3:FFE2
Scan: addr:15, reg3:FFE2
After init:
Scan: addr:1, reg3:FFE2
Scan: addr:2, reg3:FFE2
Scan: addr:3, reg3:FFE2
Scan: addr:4, reg3:FFE2
Scan: addr:5, reg3:FFE2
Scan: addr:6, reg3:FFE2
Scan: addr:7, reg3:FFE2
Scan: addr:8, reg3:FFE2
Scan: addr:9, reg3:FFE2
Scan: addr:10, reg3:FFE2
Scan: addr:11, reg3:FFE2
Scan: addr:12, reg3:FFE2
Scan: addr:13, reg3:FFE2
Scan: addr:14, reg3:FFE2
Scan: addr:15, reg3:FFE2
debug enabled.
Keyboard start.
adb_host_kbd_recv: ERROR(-30)
I think the wiring is good since the keyboard lights up when plugged in although my soldering is terrible. I also know that i have it in d1 instead of the default d0 but i think I changed the config file properly
Code: [Select]
/* ADB port setting */
#define ADB_PORT        PORTD
#define ADB_PIN         PIND
#define ADB_DDR         DDRD
#define ADB_DATA_BIT    1
//#define ADB_PSW_BIT     1       // optional
thx for the help in advance
Title: Re: ADB to USB keyboard converter
Post by: n_hof on Sun, 11 September 2016, 15:55:41
(http://i.imgur.com/bQiHWvz.jpg)

Keyboard was $3 at resale store, Micro $10 at Radio Shack. 1.7K resistor works perfectly.  Thanks to everyone who provided info in thread!
Title: Re: ADB to USB keyboard converter
Post by: djpyle on Fri, 23 September 2016, 21:35:52
Has anyone else upgraded to macOS Sierra yet? I did, and suddenly my locking caps lock is no longer working. I've tried two different keyboards and two different controllers (a Teensy and a Pro Micro clone), and I get the same results no matter what combination I use. No caps lock and no caps lock light. If I boot into my Yosemite partition though, everything works like it always has. I'm not sure what about Sierra could be causing this, but if anybody has any ideas, I'd love to get it figured out.
Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Sat, 24 September 2016, 03:36:47
From what I've heard, they revamped the keyboard (or the whole input?) system in Sierra. That's the reason Karabiner is not working, so it could have something to do with your issue as well.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 24 September 2016, 05:24:03
Pushing Locking caps  key actually sends press and release of caps lock in short period. No wait between them in current firmware, I guess the wait is needed in some situations.

Try place delay here and see result if possible.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L366-L369



Sent from my Nexus 5X

Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Sat, 24 September 2016, 05:46:24
@hasu is that true of all SKCL lock keys in combination with all controllers? E.g. if I were to put a lock key into Omnikey, do you know if it would just work, or would additional converter (controller?) configuration be needed?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 24 September 2016, 05:58:01
@hasu is that true of all SKCL lock keys in combination with all controllers? E.g. if I were to put a lock key into Omnikey, do you know if it would just work, or would additional converter (controller?) configuration be needed?
Omnikey won't work with mechanical locking switch. Yes you need custom controller or converter.

Sent from my Nexus 5X

Title: Re: ADB to USB keyboard converter
Post by: djpyle on Sat, 24 September 2016, 10:27:03
Try place delay here and see result if possible.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L366-L369

Success! Including wait.h and adding a wait_ms(100) delay did the trick. Thanks, hasu!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 24 September 2016, 18:50:37
Try place delay here and see result if possible.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L366-L369

Success! Including wait.h and adding a wait_ms(100) delay did the trick. Thanks, hasu!

Nice. Thanks for reporting!
I'll add some wait on the code in repository.

EDIT: filed the issue. https://github.com/tmk/tmk_keyboard/issues/390
Title: Re: ADB to USB keyboard converter
Post by: stat on Mon, 26 September 2016, 03:52:34
Hello! Thank you for making this. I'm typing from my AEKII now, after following the instructions here: https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md (https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md)

I was trying to revisit the keymapping and possibly change the Power key to something like F16 which I can assign in AutoHotKey. I edited config.h, but kept backups of the original config.h and hex file I generated about a week ago.

When I went to re-make Makefile.rev1, I noticed that I somehow uninstalled avr-gcc. So I got the avr8-gnu-toolchain from Atmel and added its /bin folder to Path. It still didn't recognize it, so I put avr-gcc.exe in the working directory. It saw it, but couldn't find /device-specs/specs-atmega32u4, and I couldn't find a way around that. I had read that WinAVR doesn't always work, but I tried it, and I guess there was some bug so it didn't work.

I still have dfu-programmer and avr-dude, and I believe those both still work. I've been using MinGW on Windows 7. I have an atmega32u4 instead of teensy, and it seems to be working well so far.

Ultimately, this is probably a simple question but I can't remember how I did it before: what's the procedure to installing avr-gcc on Win7?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 26 September 2016, 04:14:14
Not sure exactly what your problem is but you may still want to check wiki for build on Windows.

Or you can just use keymap editor.

Sent from my Nexus 5X

Title: Re: ADB to USB keyboard converter
Post by: stat on Mon, 26 September 2016, 19:11:35
Not sure exactly what your problem is but you may still want to check wiki for build on Windows.

Or you can just use keymap editor.

Sent from my Nexus 5X

Thanks for the quick response! I saw the wiki, which directed me toward build.md which I have been following. I have already edited the keymap in the files. I'm using MinGW/msys for bash commands.

My problem is that I can't use avr-gcc. I have the directory downloaded from Atmel, but I can't get MinGW or my computer to recognize or use it.

I have 8-bit version 3.5.3 from here: http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx (http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 26 September 2016, 19:44:07
That toolchain should work. Just configure your PATH environment variable correctly.

You don't have to move or copy tool chain.

Sent from my Nexus 5X

Title: Re: ADB to USB keyboard converter
Post by: stat on Mon, 26 September 2016, 21:19:51
That toolchain should work. Just configure your PATH environment variable correctly.

You don't have to move or copy tool chain.

Sent from my Nexus 5X

I added avr8-gnu-toolchain\bin to the path variable before, is there anything else?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 26 September 2016, 21:28:21
That toolchain should work. Just configure your PATH environment variable correctly.

You don't have to move or copy tool chain.

Sent from my Nexus 5X

I added avr8-gnu-toolchain\bin to the path variable before, is there anything else?

Did you add it in .bashrc or something?
If you are familiar with these things, I might be wrong. But if not you have to learn about basic usage of 'bash'.
Title: Re: ADB to USB keyboard converter
Post by: stat on Mon, 26 September 2016, 21:57:56
That toolchain should work. Just configure your PATH environment variable correctly.

You don't have to move or copy tool chain.

Sent from my Nexus 5X

I added avr8-gnu-toolchain\bin to the path variable before, is there anything else?

Did you add it in .bashrc or something?
If you are familiar with these things, I might be wrong. But if not you have to learn about basic usage of 'bash'.

I added it to the Windows environment variable named "Path" in system properties. I usually use git bash or cmd.exe for a command prompt, but the instructions I saw were for MinGW/Cygwin so I used the one of those two I already had.
Title: Re: ADB to USB keyboard converter
Post by: Astrobus on Tue, 27 September 2016, 16:30:31
I've spent the entire day pulling my hair out over this!  :eek:
I'm using a Pro Micro ATMega32u4, I have set in the makefile the proper chip type.
I've checked wiring with a multimeter, on my original cable end, on the female adapter I have on there now, on various ADB cables running through it.
I have a resistor added though that only seemed to solve my mouse moving.

I tested this chip with the HID_Listen blinking script so the chip itself works.
Testing it with the ADB to USB hex will recognize it *should* be a keyboard but still will not take in any inputs.

I've tried with MANY keyboards and cables, I currently have nearly 70 vintage Apple Boards in my living room so I tried a variety of them including knock off that use ADB.

I'd be happy with even incorrect inputs being sent at this point! Does anyone have suggestions or an ATMega32u4 .hex that worked for them I could try?

Edit: Forgot to add I even tried changing the Data line in the makefile and changing where it was actually soldered too. (To FD4)

Thanks!

Show Image
(http://i.imgur.com/HZUjVpY.jpg)

Show Image
(http://i.imgur.com/Ifcy79i.jpg)

Show Image
(http://i.imgur.com/OguXjyU.jpg)


Hi do you mind telling how did you solved your problem if you did?
I am having a similar problem with my setup, I am using a Pro Micro, I was able to reflash it a few times and the led turns on when nothing is soldered to it so I assume that it is not broken.
The keyboard in the other hand is a AEK II that I bought used and have no way of knowing if it worked before or have any way to test it.
When it is wired to the pro micro the leds of the pro micro won't turn on, also the leds of the keyboard do not turn on. The device is not recognised by linux neither.

I have generated the .hex with Makefile.rev1 for old TMK Converter rev.1 because my Pro Micro is Atmega32u4 based.
I have also checked the wiring with the multimeter and it seems to be ok, the resistor is a 1 kohm one.

http://i.imgur.com/3GCy7VF.jpg
http://i.imgur.com/51DW5m9.jpg
http://i.imgur.com/Q7FQ2FR.jpg
http://i.imgur.com/wo2K91o.jpg

If anybody could give a hint where tsomeany kind of help it would be much appreciated.
Title: Re: ADB to USB keyboard converter
Post by: stat on Wed, 28 September 2016, 02:45:22
Hello again, I was able to make the hex file.

I can't get the 32u4 to reset though. When I short RST and GND twice, the device still shows as "Standard PS/2 Keyboard" regardless (so I can't get a COM port number). Neither avrdude nor dfu-programmer could recognize it to flash the hex file.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 28 September 2016, 16:42:20
Hello again, I was able to make the hex file.

I can't get the 32u4 to reset though. When I short RST and GND twice, the device still shows as "Standard PS/2 Keyboard" regardless (so I can't get a COM port number). Neither avrdude nor dfu-programmer could recognize it to flash the hex file.

Consult with seller or manufacturer.
I think double short method is for Sparkfun firmwarebootloader, it will work if your board use the firmwarebootloader.
Anyway, a bit off topic here.
Title: Re: ADB to USB keyboard converter
Post by: Moistgun on Wed, 28 September 2016, 16:44:12
Random post here, but I have a pretty nice adb to adb cable from an AEK that I have no use for, if anyone is interested, they can have it.
would look nice if you use a converter towards the pc side of the keyboard connection.
Title: Re: ADB to USB keyboard converter
Post by: Norman_the_Owl on Wed, 16 November 2016, 18:13:37
Is it possible to post a generic hex file? I got hung up at the change directory step :'(

I'm apparently nowhere near competent enough to do this

I'm using a pro micro clone on windows for an AEK 2 if it matters...
Title: Re: ADB to USB keyboard converter
Post by: ShawnMeg on Wed, 16 November 2016, 23:45:01
Is it possible to post a generic hex file? I got hung up at the change directory step :'(

I'm apparently nowhere near competent enough to do this

I'm using a pro micro clone on windows for an AEK 2 if it matters...

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1 (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1)

This is much easier than trying to compile the files.  You can customize your mapping, function layers, etc.  Then, click the download button about 4/5th's of the way down to obtain your hex.  I used this about a month ago, and it worked great for my converter.
Title: Re: ADB to USB keyboard converter
Post by: Norman_the_Owl on Thu, 17 November 2016, 05:45:01
Is it possible to post a generic hex file? I got hung up at the change directory step :'(

I'm apparently nowhere near competent enough to do this

I'm using a pro micro clone on windows for an AEK 2 if it matters...

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1 (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1)

This is much easier than trying to compile the files.  You can customize your mapping, function layers, etc.  Then, click the download button about 4/5th's of the way down to obtain your hex.  I used this about a month ago, and it worked great for my converter.
Ah man, really?

Why wasn't that mentioned on github  :(

Thanks, though
Title: Re: ADB to USB keyboard converter
Post by: 128keaton on Tue, 22 November 2016, 17:15:08
One thing that really tripped me up using the Micro was that you should use the Makefile.rev1 while building. I just got an AEKII and made a beautiful custom key map and I'm loving it!
Title: Re: ADB to USB keyboard converter
Post by: Darkshado on Sat, 17 December 2016, 04:59:06
++numberOfTMKConverters; // :)

That ISO AEK II still needs quite a bit of attention, but I am typing this post with it.

I am observing the swap issue using today's master branch code, with no KEYMAP variable set in the makefile. The keys to the left of '1' and the one between 'left shift' and 'Z' are reverse of what I'd expect. I'll have to look around the code to understand what's going on.

Regards,

Darkshado
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 17 December 2016, 17:40:11
++numberOfTMKConverters; // :)

That ISO AEK II still needs quite a bit of attention, but I am typing this post with it.

I am observing the swap issue using today's master branch code, with no KEYMAP variable set in the makefile. The keys to the left of '1' and the one between 'left shift' and 'Z' are reverse of what I'd expect. I'll have to look around the code to understand what's going on.

Regards,

Darkshado

ISO keyobard autodetection was implemented some ago,
the swap issue should be resolved if your keyboard is recognized as ISO by converter.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/matrix.c#L66-L78

Can you post output of 'hid_listen' at startup? I'd like to see value of ADB register 3  these lines print out.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/matrix.c#L57-L64
Title: Re: ADB to USB keyboard converter
Post by: Darkshado on Mon, 19 December 2016, 01:04:08
I have a fix for the problem, see pull request #416 (https://github.com/tmk/tmk_keyboard/pull/416).

Sincerely,

Darkshado
Title: Re: ADB to USB keyboard converter
Post by: Norman_the_Owl on Mon, 09 January 2017, 18:17:16
Every now and then I'll have this problem where my converter will either stop working completely or will output the last pressed key continuously. Does this sound like a problem with my converter, or my keyboard, or what?


The pull up resistor is 4.7k, it's all i had on hand. I tried taking some pictures but they weren't clear. I'm not concerned about the construction though, because it works most of the time (typing on it now). Can furnish with photos if you think it's necessary.

Edit: It'll work fine for hours until i start a game, and then it stops working completely. Sometimes it'll also stop outputting, wait a few seconds, and then send everything i've typed all at once. This is extremely frustrating, it behaves really erratically.
Title: Re: ADB to USB keyboard converter
Post by: H3NT4I on Sun, 22 January 2017, 19:52:10
Apple IIgs issues. Have my board wired up properly to the teensy, resistor correctly installed. Loading firmware is straight forward, Teensy flashes no problem then when I go to use it: nada. It shows up as correctly as ADB to USB converter and a HID Keyboard but no keys work whatsoever. Even tried using other .hex files from the thread but no luck, any ideas as to what I could be doing wrong? link to hardware gallery: http://imgur.com/a/03neQ
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 22 January 2017, 20:13:34
WIth quick look pics I'm not sure which pin you are using for DATA.
You should use D0(PD0) pin for DATA with default configuration.
Title: Re: ADB to USB keyboard converter
Post by: H3NT4I on Sun, 22 January 2017, 21:04:33
sure enough, thanks hasu

WIth quick look pics I'm not sure which pin you are using for DATA.
You should use D0(PD0) pin for DATA with default configuration.
Title: Re: ADB to USB keyboard converter
Post by: H3NT4I on Thu, 26 January 2017, 22:20:34
I have my iigs working with ShawnMeg's posted code and it works great but my own coding is less than ideal. I have little experience so here's what i'm working with. When I run git bash and compile my custom keymap it comes out as a file with no extension. I had errors initially compiling with the function action prior but working through it looking at others code I got to this point where it's making a file just not sure where I went wrong. Will continue to read everything I can again and retrace steps. Any assistance is appreciated. 
Code: [Select]
#include "keymap_common.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | mute  |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
    * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |del| = | / | * |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
    * +-----------------------------------------------------+   | +---+---+---+---+
    * | Fn0  | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
    * +---------------------------------------------------------+ +---+---+---+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
    * +---------------------------------------------------------+ +-------+---|ent|
    * |cap|alt|ctrl | ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
    * +---------------------------------------------------------+ +-------+---+---+
    */
  KEYMAP_M0116_ANSI(
                                     MUTE,                                                           
       ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,   DEL ,EQL, PSLS,PAST,
       TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,        P7,  P8,  P9,  PMNS,
       FN0, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,    P4,  P5,  P6,  PPLS,
       LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,   P1,  P2,  P3,       
       CAPS, LALT,LCTL,GRV,           SPC,      BSLS,LEFT,RGHT,DOWN,UP,          P0,       PDOT,PENT
),
    /* M0116 Apple Standard Keyboard ANSI
    *                     +-------+
    *                     | mute  |
    *                     +-------+
    * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +----+----+--+-+---+
    * |esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| bks | | ins| hom|end |prt|
    * +---------------------------------------------------------+ +----+----+----+---+
    * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | |    |    |    |pgu|
    * +-----------------------------------------------------+   | +----+----+----+---+
    * | Fn0  | a | s | d | f | g | h | j | k | l | ; | ' |return| |    | up |    |pgd|
    * +---------------------------------------------------------+ +----+----+----+---+
    * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | |left|down|rght|   |
    * +---------------------------------------------------------+ +---------+----|   |
    * |cap|alt|ctrl| clr|                   |ply|prv|nxt|vod|vou| |         |    |   |
    * +---------------------------------------------------------+ +---------+----+---+
    */
  KEYMAP_M0116_ANSI(
                                     TRNS,                                                           
       TRNS,F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10,  F11, F12,TRNS,    INS,HOME ,END ,PSCR,
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,         NO  ,NO  ,NO  ,PGUP,
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,    NO  ,UP  ,NO  ,PGDN,
       TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,    LEFT,DOWN,RGHT,     
       TRNS,TRNS,TRNS,TRNS,          TRNS,     MPLY,MPRV,MNXT,VOLD,VOLU,         NO  ,     NO  ,NO 
),
};

const action_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),             
};     

EDIT: Got it. fiddle enough days with Code and eventually you'll get there.
Title: Re: ADB to USB keyboard converter
Post by: happylacquer on Sat, 04 February 2017, 03:00:18
I am trying to flash a Sparkfun Pro micro a friend sent me with adb_usb firmware. I can flash it with avrdude, but then when I plug it into any linux or windows machine, it doesn't recognize *any* USB as having been plugged in. What should I do? lsusb in linux shows nothing...

Edit: I have come to the conclusion that despite flashing the right adb_usb.hex, it must have flashed for a 3.3v/8mhz unit or else something else is wrong. Either way, i need to get it back so any computer can recognize it. I have been trying to do the reset procedure involving the Arduino IDE but it never finishes flashing the test program on... and I'm not sure it's seeing the right COM port either (COM3 and COM4 are always available in the menu and never change)

If the pro micro is just a piece of garbage what should i get instead?
Title: Re: ADB to USB keyboard converter
Post by: need on Sat, 04 February 2017, 19:19:23
Does anyone know how to turn the numpad on a M0116 into a navigation layer (pgup/pgdn, home/end) ?
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Sat, 04 February 2017, 19:55:07
If the pro micro is just a piece of garbage what should i get instead?

One of these (https://www.pjrc.com/store/teensy.html). Or you can buy one here (https://www.adafruit.com/products/199).
Title: Re: ADB to USB keyboard converter
Post by: happylacquer on Sat, 04 February 2017, 23:16:38
If the pro micro is just a piece of garbage what should i get instead?

One of these (https://www.pjrc.com/store/teensy.html). Or you can buy one here (https://www.adafruit.com/products/199).

Great price, thanks a billion. About 9-10 hours total of messing with this 4 dollar pro micro and it just bricks constantly  >:D
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 04 February 2017, 23:28:01
If the pro micro is just a piece of garbage what should i get instead?

One of these (https://www.pjrc.com/store/teensy.html). Or you can buy one here (https://www.adafruit.com/products/199).

Great price, thanks a billion. About 9-10 hours total of messing with this 4 dollar pro micro and it just bricks constantly  >:D

I don't think it is Sparkfun Pro Micro. It costs $19.95, not cheap like that.
https://www.sparkfun.com/products/12640

It is not important whether it is genuine Sparkfun or not, though.
Title: Re: ADB to USB keyboard converter
Post by: happylacquer on Sun, 05 February 2017, 01:01:03
If the pro micro is just a piece of garbage what should i get instead?

One of these (https://www.pjrc.com/store/teensy.html). Or you can buy one here (https://www.adafruit.com/products/199).

Great price, thanks a billion. About 9-10 hours total of messing with this 4 dollar pro micro and it just bricks constantly  >:D

I don't think it is Sparkfun Pro Micro. It costs $19.95, not cheap like that.
https://www.sparkfun.com/products/12640

It is not important whether it is genuine Sparkfun or not, though.

I am trying to flash adb_usb.hex with

Code: [Select]
-c avr109 -p m32u4 -F -e -I flash:w:adb_usb.hex:a -U eeprom:w:adb_usb.eep:a

With or without the eep file specified it still  bricks and will not be recognized by either windows or linux except for the 8 second bootloader window...
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Thu, 23 February 2017, 00:33:27
I'm not gonna lie the instructions for doing this are cryptic, to say the least.

I have an AEKII, and an arduino pro-micro clone with an atmega32u4. What do I do? What firmware do I install and how?
Title: Re: ADB to USB keyboard converter
Post by: alh84001 on Thu, 23 February 2017, 08:20:01
@happylacquer, did you add a pull-up resistor?

@PancakeMSTR have you read everything at https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb? For pro micro you have to use Makefile.rev1 makefile.
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Thu, 23 February 2017, 11:29:40
@happylacquer, did you add a pull-up resistor?

@PancakeMSTR have you read everything at https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb? For pro micro you have to use Makefile.rev1 makefile.

Yeah I've read a lot of it, didn't know I'd have to use makefile.rev1

I'm really not sure if I installed the DFG tools correctly, or crosspack, or even if my pro micro is in bootloader mode. I can't load anything on it, I'll run

make -f Makefile dfu

and then get the following

sh: dfu-programmer: command not found
sh: dfu-programmer: command not found
-n dfu-programmer: waiting
-n .
-n .


and I have not the slightest clue what this means.
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Thu, 23 February 2017, 13:43:40
Okay, screw the Pro-micro. It's a lost cause. Which Teensy should I get? The 2.0 right? Then which version of the adb-usb converter do I need to use?

I'm gonna be honest here, the instructions are REALLY confusing. I'm honestly not even sure how to program the teensy. All I need is a hex file, right? I can make the hex file on linux/mac, then move it over to the teensy loader and that should work? Which makefile do I use?

Seriously I'm so confused.

And then how do I edit the layout? You produce a config file and somehow...this gets loaded onto whatever microcontroller I'm using?

I'm sorry I just can't parse the instructions. They are not answering questions.
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Thu, 23 February 2017, 14:22:46
Okay, screw the Pro-micro. It's a lost cause. Which Teensy should I get? The 2.0 right? Then which version of the adb-usb converter do I need to use?

I'm gonna be honest here, the instructions are REALLY confusing. I'm honestly not even sure how to program the teensy. All I need is a hex file, right? I can make the hex file on linux/mac, then move it over to the teensy loader and that should work? Which makefile do I use?

Seriously I'm so confused.

And then how do I edit the layout? You produce a config file and somehow...this gets loaded onto whatever microcontroller I'm using?

I'm sorry I just can't parse the instructions. They are not answering questions.

Yes, a Teensy 2.0. And, when you have your hex file built, all you need is this (https://www.pjrc.com/teensy/loader.html) to flash it.
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Wed, 01 March 2017, 01:30:23
Okay, screw the Pro-micro. It's a lost cause. Which Teensy should I get? The 2.0 right? Then which version of the adb-usb converter do I need to use?

I'm gonna be honest here, the instructions are REALLY confusing. I'm honestly not even sure how to program the teensy. All I need is a hex file, right? I can make the hex file on linux/mac, then move it over to the teensy loader and that should work? Which makefile do I use?

Seriously I'm so confused.

And then how do I edit the layout? You produce a config file and somehow...this gets loaded onto whatever microcontroller I'm using?

I'm sorry I just can't parse the instructions. They are not answering questions.

Yes, a Teensy 2.0. And, when you have your hex file built, all you need is this (https://www.pjrc.com/teensy/loader.html) to flash it.


Welp, that didn't work.

I ran, on my mac,

 make -f Makefile.teensy

copied the hex file over to my windows computer, programmed the teensy, plugged everything in aaaand nothing. Keyboard doesn't work.

Wiring could be wrong, but shouldn't there be SOME indication that I've gotten this to work?
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Wed, 01 March 2017, 11:30:59
Welp, that didn't work.

I ran, on my mac,

 make -f Makefile.teensy

copied the hex file over to my windows computer, programmed the teensy, plugged everything in aaaand nothing. Keyboard doesn't work.

Wiring could be wrong, but shouldn't there be SOME indication that I've gotten this to work?

What shows up in Control Panel > Devices and Printers?
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Wed, 01 March 2017, 11:37:29
Welp, that didn't work.

I ran, on my mac,

 make -f Makefile.teensy

copied the hex file over to my windows computer, programmed the teensy, plugged everything in aaaand nothing. Keyboard doesn't work.

Wiring could be wrong, but shouldn't there be SOME indication that I've gotten this to work?

What shows up in Control Panel > Devices and Printers?


I'll have to check, but the computer doesn't really identify anything. No like "found keyboard" or anything.

But I haven't actually looked at what device manager says.

Suppose I plugged just the teensy in. What should device manager say? Would it indicate something different with the teensy only in versus the teensy connected to the keyboard?
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Wed, 01 March 2017, 12:07:55
Not Device Manager.
Quote
Control Panel > Devices and Printers

Recognized input devices like keyboards and mice should show up here.
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Wed, 01 March 2017, 12:17:29
When you switched from the Pro Micro to the Teensy you should have changed one or more configuration settings in the Makefile. The bootloader size for the Teensy is 512, not 4096. And check out the other settings as well, I can't remember all of them.
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Wed, 01 March 2017, 12:37:28
When you switched from the Pro Micro to the Teensy you should have changed one or more configuration settings in the Makefile. The bootloader size for the Teensy is 512, not 4096. And check out the other settings as well, I can't remember all of them.

I definitely have no clue how to do that.


I also tried generating a hex file from the layout configurator, i.e.: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1


I just left everything default (as is when you open the link) and then downloaded the hex file. Didn't work.


Literally all the instructions say to do is

"To program Teensy you can use teensy target:

$ make -f Makefile.teensy [KEYMAP=(plain|ansi|iso|hasu)] teensy"

One note about that, I left off "teensy" at the end because I wasn't programming the teensy through my mac. My presumption is

make -f Makefile.teensy

compiles the hex file, with the default/plain keymap. Don't know if I'm wrong about that.

What am I missing?
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Wed, 01 March 2017, 12:52:11
You need to edit "Makefile" - no extension.

Change this:
Code: [Select]
# Boot Section Size in *bytes*
#   Teensy halfKay   512
#   Teensy++ halfKay 1024
#   Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
#   LUFA bootloader  4096
#   USBaspLoader     2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096

to this:
Code: [Select]
# Boot Section Size in *bytes*
#   Teensy halfKay   512
#   Teensy++ halfKay 1024
#   Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
#   LUFA bootloader  4096
#   USBaspLoader     2048
OPT_DEFS += -DBOOTLOADER_SIZE=512
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Wed, 01 March 2017, 13:00:45
You need to edit "Makefile" - no extension.

Change this:
Code: [Select]
Boot Section Size in *bytes*
#   Teensy halfKay   512
#   Teensy++ halfKay 1024
#   Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
#   LUFA bootloader  4096
#   USBaspLoader     2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096

to this:
Code: [Select]
Boot Section Size in *bytes*
#   Teensy halfKay   512
#   Teensy++ halfKay 1024
#   Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
#   LUFA bootloader  4096
#   USBaspLoader     2048
OPT_DEFS += -DBOOTLOADER_SIZE=512

Okay I'll give that a try and get back to you.
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Wed, 01 March 2017, 13:04:02
When you switched from the Pro Micro to the Teensy you should have changed one or more configuration settings in the Makefile. The bootloader size for the Teensy is 512, not 4096. And check out the other settings as well, I can't remember all of them.

I definitely have no clue how to do that.


I also tried generating a hex file from the layout configurator, i.e.: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1


I just left everything default (as is when you open the link) and then downloaded the hex file. Didn't work.


Literally all the instructions say to do is

"To program Teensy you can use teensy target:

$ make -f Makefile.teensy [KEYMAP=(plain|ansi|iso|hasu)] teensy"

One note about that, I left off "teensy" at the end because I wasn't programming the teensy through my mac. My presumption is

make -f Makefile.teensy

compiles the hex file, with the default/plain keymap. Don't know if I'm wrong about that.

What am I missing?

Maybe go back to basics just as a test.

Grab this: https://www.pjrc.com/teensy/blink_both.zip and flash your teensy with it.  If you have a Teensy 2, then you want to load "blink_slow_Teensy2.hex" and reboot the teensy (not your machine).
Using the GUI tool that @Tactile refers to should be all you need.

Verify that your Teensy is good first.

If it is, grab a fresh copy of TMK, then:
Code: [Select]
> cd path/to/your/tmk_keyboard/converter/adb_usb
> make clean && make

After a bunch of standard informational logging, you should get something like this:
Code: [Select]
Creating load file for Flash: adb_usb_lufa.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature adb_usb_lufa.elf adb_usb_lufa.hex

Creating load file for EEPROM: adb_usb_lufa.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex adb_usb_lufa.elf adb_usb_lufa.eep || exit 0

Creating Extended Listing: adb_usb_lufa.lss
avr-objdump -h -S -z adb_usb_lufa.elf > adb_usb_lufa.lss

Creating Symbol Table: adb_usb_lufa.sym
avr-nm -n adb_usb_lufa.elf > adb_usb_lufa.sym

Size after:
   text    data     bss     dec     hex filename
  20130      52     172   20354    4f82 adb_usb_lufa.elf

-------- end --------
You will have a file named "adb_usb_lufa.hex"

Load that on to your teensy as you did above using the GUI Loader and try your keyboard.
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Thu, 02 March 2017, 11:45:43
When you switched from the Pro Micro to the Teensy you should have changed one or more configuration settings in the Makefile. The bootloader size for the Teensy is 512, not 4096. And check out the other settings as well, I can't remember all of them.

I definitely have no clue how to do that.


I also tried generating a hex file from the layout configurator, i.e.: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1


I just left everything default (as is when you open the link) and then downloaded the hex file. Didn't work.


Literally all the instructions say to do is

"To program Teensy you can use teensy target:

$ make -f Makefile.teensy [KEYMAP=(plain|ansi|iso|hasu)] teensy"

One note about that, I left off "teensy" at the end because I wasn't programming the teensy through my mac. My presumption is

make -f Makefile.teensy

compiles the hex file, with the default/plain keymap. Don't know if I'm wrong about that.

What am I missing?

Maybe go back to basics just as a test.

Grab this: https://www.pjrc.com/teensy/blink_both.zip and flash your teensy with it.  If you have a Teensy 2, then you want to load "blink_slow_Teensy2.hex" and reboot the teensy (not your machine).
Using the GUI tool that @Tactile refers to should be all you need.

Verify that your Teensy is good first.

If it is, grab a fresh copy of TMK, then:
Code: [Select]
> cd path/to/your/tmk_keyboard/converter/adb_usb
> make clean && make

After a bunch of standard informational logging, you should get something like this:
Code: [Select]
Creating load file for Flash: adb_usb_lufa.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature adb_usb_lufa.elf adb_usb_lufa.hex

Creating load file for EEPROM: adb_usb_lufa.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex adb_usb_lufa.elf adb_usb_lufa.eep || exit 0

Creating Extended Listing: adb_usb_lufa.lss
avr-objdump -h -S -z adb_usb_lufa.elf > adb_usb_lufa.lss

Creating Symbol Table: adb_usb_lufa.sym
avr-nm -n adb_usb_lufa.elf > adb_usb_lufa.sym

Size after:
   text    data     bss     dec     hex filename
  20130      52     172   20354    4f82 adb_usb_lufa.elf

-------- end --------
You will have a file named "adb_usb_lufa.hex"

Load that on to your teensy as you did above using the GUI Loader and try your keyboard.

I tested blink, the teensy works fine.

I'll try your suggestion. Why use that over the teensy code?
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Thu, 02 March 2017, 12:06:22
Quote
I'll try your suggestion. Why use that over the teensy code?

To eliminate as many changes as possible.  It's also the exact way I flash my teensy.
Title: Re: ADB to USB keyboard converter
Post by: PancakeMSTR on Thu, 02 March 2017, 23:01:11
When you switched from the Pro Micro to the Teensy you should have changed one or more configuration settings in the Makefile. The bootloader size for the Teensy is 512, not 4096. And check out the other settings as well, I can't remember all of them.

I definitely have no clue how to do that.


I also tried generating a hex file from the layout configurator, i.e.: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1


I just left everything default (as is when you open the link) and then downloaded the hex file. Didn't work.


Literally all the instructions say to do is

"To program Teensy you can use teensy target:

$ make -f Makefile.teensy [KEYMAP=(plain|ansi|iso|hasu)] teensy"

One note about that, I left off "teensy" at the end because I wasn't programming the teensy through my mac. My presumption is

make -f Makefile.teensy

compiles the hex file, with the default/plain keymap. Don't know if I'm wrong about that.

What am I missing?

Maybe go back to basics just as a test.

Grab this: https://www.pjrc.com/teensy/blink_both.zip and flash your teensy with it.  If you have a Teensy 2, then you want to load "blink_slow_Teensy2.hex" and reboot the teensy (not your machine).
Using the GUI tool that @Tactile refers to should be all you need.

Verify that your Teensy is good first.

If it is, grab a fresh copy of TMK, then:
Code: [Select]
> cd path/to/your/tmk_keyboard/converter/adb_usb
> make clean && make

After a bunch of standard informational logging, you should get something like this:
Code: [Select]
Creating load file for Flash: adb_usb_lufa.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature adb_usb_lufa.elf adb_usb_lufa.hex

Creating load file for EEPROM: adb_usb_lufa.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex adb_usb_lufa.elf adb_usb_lufa.eep || exit 0

Creating Extended Listing: adb_usb_lufa.lss
avr-objdump -h -S -z adb_usb_lufa.elf > adb_usb_lufa.lss

Creating Symbol Table: adb_usb_lufa.sym
avr-nm -n adb_usb_lufa.elf > adb_usb_lufa.sym

Size after:
   text    data     bss     dec     hex filename
  20130      52     172   20354    4f82 adb_usb_lufa.elf

-------- end --------
You will have a file named "adb_usb_lufa.hex"

Load that on to your teensy as you did above using the GUI Loader and try your keyboard.

Nope. I get "adb_usb.hex" but no "adb_usb_lufa.hex"

Programmed the teensy with that file anyway and it does nothing.

The file loads fine, but after rebooting the teensy it's not recognized by the computer as anything and the LED doesn't turn off.


By the way, device manager recognizes the teensy (with whatever random converter hexfile I've decided to put on it) as "ADB keyboard converter."

Also my mouse is slowly jumping to the top right corner of my monitor. Was there a fix for that? I couldn't tell.

It's working. In fact I'm typing this edit on it at this very moment. Changing that line in the makefile is what did it. Seems the pull up resistor is also quite necessary indeed. Assuredly does not work without it. Anyway, thanks for the help all, much appreciated and sorry for being so difficult.

For everyone's viewing pleasure: My crappy electronics test bench: http://imgur.com/a/K5VBi
Title: Re: ADB to USB keyboard converter
Post by: tjweir on Fri, 03 March 2017, 08:27:42
Glad it's working.  Hasu mentions that the pull up is a must, looks like we have another data point that confirms this. :)
Title: Re: ADB to USB keyboard converter
Post by: apprentice57 on Tue, 14 March 2017, 00:26:25
Hi all.

I've been doing an internal adb-usb converter for my ANSI apple extended keyboard I. I believe the hardware modification to wire the old data/power points to my teensy 2.0 has gone correctly. However I am running into software issues when I try to flash the device.

My workflow has been to download the default configuration from http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1 (Without modifications, I don't need anything fancy) for adb_usb rev 1 as a hex file, then to flash that hex file to my teensy using the teensy loader application.

However, once I do so there are a few keys that are mapped incorrectly.
(The label(s) on the key(s) I press) -> (The character that is produced on screen)

(shift and 2) -> "
(shift and 6) -> &
(shift and 7) -> '
(shift and 8 ) -> (
(shift and 9) -> )
(shift and 0) -> 0
( = )              -> ^
(shift and =) -> ~
( [ )             -> @
(shift and {) -> `
( ] )             -> [
(shift and ] ) -> {
( \ )              -> ]
( shift and \ ) -> }
(shift and ; )   -> +
( ' )               -> :
(shift and ')    -> *

To my knowledge, every other key is working, so this is quite bizzare! It's almost like some characters like the parenthesis and brackets are shifted right or left one key.


I do not think this is a hardware/wiring issue, because if I set these problematic keys to something that is not problematic currently (like an alpha character) then these keys work just fine producing that alpha character. Conversely, if I set keys that should be alphas normally to these problematic characters, they have the same issue.

However, if anyone suspects this is a hardware issue I'll follow up with images. I'd just prefer to avoid taking apart my setup since I have electrical tape everywhere.

What I was wondering is:

1) Has anyone run into a similar issue with the online configurator and flashing the hex file through the teensy program?
2) Would someone be willing to give me a working .hex file for their AEK? Hopefully from a ANSI AEK I and Teensy 2.0 setup.
3) Would someone be willing to flash their ANSI AEK I with the .hex file I have been using and let me know if you have any issue? The file is attached.

That and any other help would be appreciated. Thanks in advance.

EDIT: At this point I was able to compile the hex myself on my machine using the "plain" and "ansi" layouts, and flashed those with teensy loader. I get the same issue with wrong mappings, so I'm now more befuddled.

P.S. I have tried to compile the .hex file locally but I keep getting an error:
">> make -f Makefile.teensy
sh: avr-gcc: command not found
make: *** [gccversion] Error 127"
I have already installed avr from https://www.obdev.at/products/crosspack/download.html for macOS. I have also attempted to install avr via homebrew but the install has been taking an hour+ (still going) so I don't know if it is working properly.


I have also attempted to flashusing dfu-programmer instead of the teensy program, but I keep getting a "dfu-programmer: no device present." error.

Very frustrating. 3 roadblocks at once  :(.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 14 March 2017, 07:22:00
What layout are you using on your OS? ANSI or one of ISO?

Sent from my Nexus 5X

Title: Re: ADB to USB keyboard converter
Post by: apprentice57 on Tue, 14 March 2017, 09:51:29
What layout are you using on your OS? ANSI or one of ISO?

Sent from my Nexus 5X

Should be ANSI, I'm in the states. I've been primarily using macOS, but the issue occurs at work at my Debian computer too.

EDIT: Something must be off about the OS, you're completely right there. I hooked the keyboard to an OS that probably few others here use commonly: FreeBSD (I have a FreeNAS system), and the thing works like a charm! No incorrect mappings.

 I'll play around with configurations in macOS, cause something there is obviously the problem.

Thanks Hasu :)
Title: Re: ADB to USB keyboard converter
Post by: sneaux on Thu, 16 March 2017, 17:14:35
The converter works with teensy 2.0 ++ by changing the processor in teensy makefile as everyone said. The pull up resistor was necessary with a coiled lindy cable. My only issue is that capslock doesn't really work for me at the moment. It registers, but does not act as if I've held it down when I have. At first I thought it might be because of the locking caps, so I removed the locking mechanism from the switch but that didn't help. I then commented the locking caps line of the config file, but this didn't change anything. Changing LCAP to CAP results in an undefined error, same for changing the "keycode" in the map file to match the one for CAP. I'm guessing this is what I need to understand better, but figured I would see if anyone else had a fix for this already. The output from Karabiner is this:

eventType:KeyDown         code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:KeyUp           code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:KeyDown         code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:KeyDown         code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:KeyDown         code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:KeyDown         code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:KeyDown         code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:KeyUp           code:0x28       name:k               flags:                                   misc:KeyCode::K    characters:k   
eventType:FlagsChanged    code:0x3f       name:Fn              flags:Fn                                 misc:KeyCode::FN    characters:   
eventType:FlagsChanged    code:0x3f       name:Fn              flags:                                   misc:KeyCode::FN    characters:
 
and this is from me pressing a character key, getting the usual up/down events. Next I briefly held the key down, and I got the expected output. For the caps which is then sent to fn, I held the key down, but got the two events immediately and no additional event upon release. 
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 16 March 2017, 17:49:28
Those events look decent for TMK locking key support but which you don't want in your keymap. What you have to do will be just to find proper keycode.

You will find how to find the keycode in keymap document. You can find keymap document in README, btw.
Title: Re: ADB to USB keyboard converter
Post by: sneaux on Thu, 16 March 2017, 22:52:52
Perfect. Thank you. I had changed the instances of LCAP to CAP, but should have changed them to CAPS   :D
Title: Re: ADB to USB keyboard converter
Post by: mrrm14 on Thu, 06 April 2017, 12:12:27
Hi All,

I'm following this handy little guide to convert the Apple Extended Keyboard II to USB:
http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/ (http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/)

I followed all of the instructions to the letter but I have a problem. The Teensy 2 powers on when plugged as does the Keyboard Num Lock, Caps Lock and Scroll Lock LEDs. The Teensy' LED is on constantly but flashes every 10 seconds. When it flashes the mouse pointer on the screen moves about an inch to the right.

I'm still a bit new to micro controllers and Hex Code so I can't debug the issue myself, to my eyes it seems all good. I've included the code used and my wiring.

Any advice is much appreciated!

Thanks!

http://imgur.com/a/omVjP (http://imgur.com/a/omVjP)

Code: [Select]
:100000000C9499050C94DD050C94DD050C94DD052C
:100010000C94DD050C94DD050C94DD050C94DD05D8
:100020000C94DD050C94DD050C94920F0C94641077
:100030000C940D1F0C94DD050C94DD050C94DD056E
:100040000C94DD050C94DD050C94DD050C94DD05A8
:100050000C94DD050C94801F0C94DD050C94DD05DB
:100060000C94DD050C94DD050C94DD050C94DD0588
:100070000C94DD050C94DD050C94DD050C94DD0578
:100080000C94DD050C94DD050C94DD050C94DD0568
:100090000C94DD050C94DD050C94DD050C94DD0558
:1000A0000C94DD050C94DD050C94DD05C910EB10F6
:1000B000D611EB10D6112D115011D611A511B81172
:1000C000B715B715E515E51541167D16801880188A
:1000D000951680188C178C175A18801880186E186F
:1000E00035A131A1041607090B0A1D1B0619640569
:1000F000141A08151C171E1F202123222E26242D1A
:1001000025273012182F0C13280F0D340E33C1364B
:10011000381110372B2CC02A5829E0E3E182E25035
:100120004F5152006C6365556D570053A9AAA854EE
:100130005800566D6E2E62595A5B5C5D5E5F6F6053
:10014000618987853E3F403C4142914490466B47E0
:10015000004365450048494A4B4C3D4D3B4E3AE50E
:10016000E6E40000AAA9A8090B0A1D1B06196405EC
:10017000141A08151C173A3B3C3D3F3E454240448B
:100180004143494718524648284B0D4F4A50C14DEC
:100190005111104E2B2CC04C5835E0E3E182E24A5D
:1001A0004D4E4B006CF565F66DF90053A9AAA8F504
:1001B000F600FA6D6EF4F4FBF1FCF2F1F3FA6FF075
:1001C000F98987853E3F403C4142914490466B47C8
:1001D000004365450048494A4B4C3D4D3B4E3AE58E
:1001E000E6E400006164625F686F73745F6B626471
:1001F0005F726563763A204552524F522825642932
:100200000A000A0025303458006164625F686F7329
:10021000745F6B62645F726563763A200045525288
:100220004F523A206D65646961206B6579300A0030
:100230004552524F523A206D65646961206B657971
:10024000310A005D0A0025640020002564007C005E
:100250002530325800200025303258006164625F3A
:100260006D6F757365207261773A205B000A002517
:1002700030313662006164625F686F73745F6D6F06
:100280007573655F726563763A20006465627567B1
:1002900020656E61626C65642E0A005363616E3A7C
:1002A00020616464723A25642C20726567333A25B4
:1002B0003034580A00416674657220696E69743A78
:1002C0000A00466F756E643A206D65646961206B43
:1002D0006579730A005363616E3A20616464723A0F
:1002E00025642C20726567333A253034580A004261
:1002F00065666F726520696E69743A0A004B6579AC
:10030000626F6172642073746172742E0A005553B7
:100310004220636F6E666967757265642E0A000D10
:100320000A696E69740A005B445D005B435D002EE0
:100330000341004400420020006B00650079006228
:10034000006F00610072006400200063006F006EA7
:100350000076006500720074006500720000000EF7
:100360000374002E006D002E006B002E00000004B0
:1003700003090409027400040100A032090400000A
:1003800001030101000921110100012240000705BC
:10039000810308000A090401000103010200092188
:1003A00011010001224D000705820308000A09041B
:1003B00002000103000000092111010001223600A2
:1003C0000705830308000A09040300020300000074
:1003D00009211101000122220007058403200001E8
:1003E000070504032000011201100100000008EDC0
:1003F000FEDB0A0101010200010631FF0974A101BF
:100400000975150026FF00952075088102097615EB
:100410000026FF00952075089102C005010980A102
:1004200001850216810026B7001A81002AB70075DF
:100430001095018100C0050C0901A1018503160179
:1004400000269C021A01002A9C0275109501810069
:10045000C005010902A1010901A10005091901292D
:10046000051500250195057501810295017503812A
:10047000010501093009311581257F950275088133
:100480000609381581257F950175088106050C0A36
:1004900038021581257F950175088106C0C00501C8
:1004A0000906A101050719E029E7150025019508AE
:1004B0007501810295017508810105081901290559
:1004C00095057501910295017503910105071900C4
:1004D00029FF150026FF00950675088100C0636F8F
:1004E0006E73756D65723A20253034580A00737941
:1004F0007374656D3A20253034580A000A0025309F
:10050000325820006B6579626F6172643A20004C4A
:1005100045443A20253032580A00253032583A20D6
:100520002530386225730A00722F63203031323350
:10053000343536370A00290A002575002F00257545
:10054000005D28002564002000256400200025644B
:100550000020002564007C0025303258006D6F7546
:1005600073656B6579205B62746E7C782079207688
:1005700020685D287265702F61636C293A205B00EA
:100580006D6B5F776865656C5F74696D655F746FCF
:100590005F6D6178203D2025640A006D6B5F776890
:1005A00065656C5F6D61785F7370656564203D2083
:1005B00025640A006D6B5F74696D655F746F5F6DB4
:1005C0006178203D2025640A006D6B5F6D61785F66
:1005D0007370656564203D2025640A006D6B5F695A
:1005E0006E74657276616C203D2025640A006D6B27
:1005F0005F64656C6179203D2025640A006D6B5F46
:10060000776865656C5F74696D655F746F5F6D6158
:1006100078203D2025640A006D6B5F776865656C06
:100620005F6D61785F7370656564203D2025640AA5
:10063000006D6B5F74696D655F746F5F6D617820CD
:100640003D2025640A006D6B5F6D61785F73706596
:100650006564203D2025640A006D6B5F696E7465DA
:100660007276616C203D2025640A006D6B5F6465C5
:100670006C6179203D2025640A000A00257500364A
:100680003A20776865656C5F74696D655F746F5F4C
:100690006D61783A20000A00257500353A207768A8
:1006A00065656C5F6D61785F73706565643A2000A5
:1006B0000A00257500343A2074696D655F746F5FB8
:1006C0006D61783A20000A00257500333A206D618B
:1006D000785F73706565643A20000A002575003202
:1006E0003A20696E74657276616C286D73293A20C0
:1006F000000A00257500313A2064656C6179282A6A
:1007000031306D73293A20000A092D2056616C752D
:100710006573202D0A004D3E004D25643E20003FAC
:10072000007365742064656661756C740A00433EED
:10073000200077686572652064656C74613A206397
:100740007572736F723D25642C20776865656C3D0A
:1007500025640A53656520687474703A2F2F656E9E
:100760002E77696B6970656469612E6F72672F7788
:10077000696B692F4D6F7573655F6B6579730A00DF
:100780000A092D204D6F7573656B6579202D0A451B
:1007900053432F713A09717569740A313A096465D6
:1007A0006C6179282A31306D73290A323A09696EF1
:1007B00074657276616C286D73290A333A096D612C
:1007C000785F73706565640A343A0974696D655FB2
:1007D000746F5F6D61780A353A09776865656C5F9B
:1007E0006D61785F73706565640A363A097768658C
:1007F000656C5F74696D655F746F5F6D61780A0A1F
:10080000703A097072696E742076616C7565730A4E
:10081000643A097365742064656661756C74730A63
:1008200075703A092B310A646F776E3A092D310AD7
:10083000706775703A092B31300A7067646F776E94
:100840003A092D31300A0A7370656564203D2064D1
:10085000656C7461202A206D61785F7370656564D2
:10086000202A2028726570656174202F2074696DBC
:10087000655F746F5F6D6178290A003F004D3E200F
:1008800000433E20004C25640A000A092D20436FD6
:100890006E736F6C65202D0A4553432F713A0971B1
:1008A0007569740A6D3A096D6F7573656B65790AC0
:1008B000000A092D204D61676963202D0A643A09F9
:1008C00064656275670A783A096465627567206DC8
:1008D00061747269780A6B3A096465627567206BA6
:1008E0006579626F6172640A6D3A09646562756761
:1008F000206D6F7573650A763A0976657273696F54
:100900006E0A733A097374617475730A633A096302
:100910006F6E736F6C65206D6F64650A302D343AAD
:10092000096C61796572302D34284631302D46349A
:10093000290A506175733A09626F6F746C6F616454
:1009400065720A003F0074696D65725F726561646B
:10095000333228293A202530346C580A006B6579E7
:10096000626F6172645F69646C653A2025580A00A1
:100970006B6579626F6172645F70726F746F636FC1
:100980006C3A2025580A00686F73745F6B65796252
:100990006F6172645F6C65647328293A2025580A78
:1009A000000A092D20537461747573202D0A0047C5
:1009B00043433A20342E382E31204156522D4C4993
:1009C00042433A20312E382E3073766E20415652F3
:1009D0005F415243483A20617672350A004F5054C5
:1009E000494F4E533A204C554641204D4F555345A3
:1009F0004B45592045585452414B455920434F4E81
:100A0000534F4C4520434F4D4D414E4420343039D7
:100A1000360A004255494C443A20346265666338D0
:100A200037202830303A30353A3233204170722046
:100A300020362032303137290A005649443A2030D6
:100A4000784645454428742E6D2E6B2E292050493A
:100A5000443A2030783041444228414442206B657A
:100A600079626F61726420636F6E7665727465720D
:100A700029205645523A203078303130310A00442E
:100A80004553433A20636F6E766572742041444249
:100A9000206B6579626F61726420746F20555342D8
:100AA0000A000A092D2056657273696F6E202D0A9F
:100AB000000A6D6F7573653A206F66660A000A6DED
:100AC0006F7573653A206F6E0A000A6B6579626F05
:100AD0006172643A206F66660A000A6B6579626F1C
:100AE0006172643A206F6E0A000A6D6174726978EF
:100AF0003A206F66660A000A6D61747269783A205E
:100B00006F6E0A000A64656275673A206F6E0A00AC
:100B10000A64656275673A206F66660A000A0A62AF
:100B20006F6F746C6F616465722E2E2E2000433ED1
:100B3000200011241FBECFEFDAE0DEBFCDBF04B628
:100B400003FE24C08091DC019091DD01A091DE01C3
:100B5000B091DF018730904BA740B04BB9F41092B1
:100B6000DC011092DD011092DE011092DF0114BE53
:100B700084B7877F84BF88E10FB6F89480936000C4
:100B8000109260000FBEE0E0F8E3099511E0A0E0EC
:100B9000B1E0E2EAF0E502C005900D92A433B1079E
:100BA000D9F721E0A4E3B1E001C01D92AC3DB2074A
:100BB000E1F70E94C50C0C944F280C940000FF93A1
:100BC000EF93E0913401F0913501309709F00995E8
:100BD000EF91FF910895FC018591803011F0EFDFD6
:100BE000FBCF0895FF27E0E230E247FF0CC04195BC
:100BF00097FF09C0EDE26095709580959095611D15
:100C0000711D811D911D27FF02C0219530E350E227
:100C1000AA27660F771F881F991FAA1FA41710F015
:100C2000A41B63955A95A9F7AA3008F0A95FA05DA7
:100C3000AF93F395611571058105910541F7ED328B
:100C400011F4EF93F395F21718F43F93F395FBCF5C
:100C50008F91B5DFFA95E1F70895E991F9918591C2
:100C6000803021F0853219F0AADFF9CF089520E015
:100C7000E89455915532C1F3503311F4689455916D
:100C80005A3348F4505390F3220F022E220F220FB2
:100C9000200D250FF4CF0EF42195899199915336AB
:100CA00019F3533729F1533559F1BC018827992796
:100CB000E8945C3621F48991999168945591543661
:100CC00039F446EF7EF077FF0DC08FEF9FEF0AC03B
:100CD00055374AE039F0583540E121F0523642E0CC
:100CE00009F00895FF93EF937DDFEF91FF91B7CF68
:100CF000FF93EF93FC0181918030B9F360DFFBCF6C
:100D0000FF93EF9368DFF1CFDF93CF93CDB7DEB7DB
:100D10002596A3DFCF91DF910895282F2770E82F24
:100D2000E695E695E695EF70F0E0E95CFE4F87FF0B
:100D30000CC081E090E0022E01C0880F0A94EAF70F
:100D40008095908189238083089581E090E0022E30
:100D500001C0880F0A94EAF79081982B9083089538
:100D60000F931F93CF93DF93569A5E9A0E949E092A
:100D70002FEF87EA91E6215080409040E1F700C0D4
:100D800000008FEE92E09F938F930E9484060F9055
:100D90000F90C1E0D0E005ED12E063E08C2F0E94DF
:100DA000A209009771F09F938F93DF93CF931F93C6
:100DB0000F930E9484060F900F900F900F900F904A
:100DC0000F909FEF29EF80E0915020408040E1F7A5
:100DD00000C000002196C031D105F9F663E082E041
:100DE0000E94A20999278131910511F174F487308D
:100DF0009105F1F024F404970297F0F419C08930BA
:100E00009105B1F00D97C1F413C08D31910581F0BA
:100E100034F48431910561F0499771F409C0843C40
:100E2000910531F0873C910519F0813C910521F441
:100E300081E080934C0102C010924C0163E087E096
:100E40000E94A20991E0823009F090E090934D0158
:100E5000992341F082EC92E09F938F930E94840645
:100E60000F900F9023E042E063E082E00E94270AA7
:100E700085EB92E09F938F930E9484060F900F90D2
:100E8000C1E0D0E00BE912E063E08C2F0E94A209E0
:100E9000009771F09F938F93DF93CF931F930F93DE
:100EA0000E9484060F900F900F900F900F900F905C
:100EB0008FEF99EF20E0815090402040E1F700C093
:100EC00000002196C031D105F9F6E7E3F1E0119277
:100ED00081E0E734F807D9F70E94F3110E94440932
:100EE0008091BE0181608093BE018BE892E00E94F8
:100EF000EB05569A5E98DF91CF911F910F9108955F
:100F0000CF93DF938FE79BEB0197F1F700C00000D1
:100F10000E94230AEC01009711F481E0C4C097FD00
:100F200005C080914701816080934701D7FF05C0CC
:100F3000809147018E7F809347018D2F99278F7372
:100F40009927AE014F735527C6FF02C0405451097F
:100F5000D6FF02C08054910960913601772767FD62
:100F60007095469F9001479F300D569F300D11247C
:100F700021384FEF340714F421E83FEF31952195E4
:100F8000310921384FEF340714F421E83FEF219560
:100F900020934801869F9001879F300D969F300DCA
:100FA000112421388FEF380714F421E83FEF882708
:100FB0009927821B930B81382FEF920714F481E855
:100FC0009FEF8195809349018091BE0183FF60C0AE
:100FD00085E792E00E94EB05DF93CF938FE692E0E6
:100FE0009F938F930E9484068DE692E00E94EB050A
:100FF0008CE592E00E94EB0520913601822F992723
:1010000087FD90959F932F9387E592E09F938F9311
:101010000E94840685E592E00E94EB0580914701DD
:101020001F928F9380E592E09F938F930E94840696
:101030008EE492E00E94EB0520914801822F9927CF
:1010400087FD90959F932F938BE492E09F938F93CE
:101050000E94840689E492E00E94EB0520914901F8
:10106000822F992787FD90959F932F9386E492E096
:101070009F938F930E94840683E492E00E94EB0585
:101080008DB79EB744960FB6F8949EBF0FBE8DBF26
:1010900087E491E00E9444128091360191E088300B
:1010A0000CF090E0890F80933601DF91CF91089585
:1010B0001F93CF93DF93C0910001D09101018FEF77
:1010C0009FEF9093010180930001CF3F8FEFD807EE
:1010D00009F06AC08FE79BEB0197F1F700C00000B1
:1010E00082E00E94200AEC01009709F05DC0809127
:1010F0004D01882309F458C087E00E94200A009718
:1011000009F452C09C012F77332722303105A1F01A
:1011100048F42115310569F02130310599F48078C2
:101120008A641AC02330310551F02F373105A1F000
:1011300009C08078826410C0807889640DC080788E
:1011400088640AC080E392E09F938F930E94840694
:101150000F900F9081E18EC0292F33272F773327EF
:101160002130310579F050F02230310579F023300B
:10117000310581F4EC01D078D86416C0EC01D07848
:10118000D26412C0EC01D078DA640EC0EC01D078E1
:10119000D9640AC08DE192E09F938F930E948406E8
:1011A0000F900F9080E166C08091BE0181FF18C052
:1011B000209709F45CC089E092E00E94EB05DF9380
:1011C000CF9384E092E09F938F930E94840682E005
:1011D00092E00E94EB050F900F900F900F9003C0CC
:1011E000209709F444C0CF379FE7D90711F48FE760
:1011F00005C0CF3F8FEFD80721F48FEF0E948D06F7
:1012000038C02D2F3327822F1C2F2F3F81F4DF93DF
:10121000CF9384EE91E09F938F930E9484060E9467
:10122000B0060F900F900F900F908C2F23C09091CD
:101230004C01992381F0A9014F775527423351057D
:1012400021F4822F80788A6006C04A30510519F453
:10125000822F807882630E948D061F3F51F0DC2F21
:10126000CC27CF6FD0930101C093000102C080E072
:1012700001C081E0DF91CF911F910895E82FF0E048
:10128000E95CFE4F80810895682F609582E00C94A0
:10129000620A509A83E091E00197F1F700C00000E4
:1012A00050989AEB9A95F1F700C00895509A8AEBFE
:1012B0008A95F1F700C0509883E091E00197F1F72B
:1012C00000C000000895EF92FF920F931F93CF93F9
:1012D000DF93C0E0D0E000E810E0E82EF12C9801A8
:1012E0000C2E02C0359527950A94E2F72E213F2156
:1012F000232B19F00E94560902C00E944909219629
:10130000C830D10561F7DF91CF911F910F91FF9008
:10131000EF900895489B07C023E02A95F1F700005D
:1013200001970097B9F70895489907C023E02A95D7
:10133000F1F7000001970097B9F708955898509871
:1013400008950895CF92DF92EF92FF920F931F932B
:10135000CF93DF931F92CDB7DEB7182FF894509A32
:1013600083EF9BE00197F1F700C0000069830E94C2
:10137000560969816C60E0E11E9FC0011124862B33
:101380000E9463090E94490984EF91E00E94940938
:10139000892B21F4789482EE9FEF48C084EF91E08E
:1013A0000E948A09892B21F4789480E090E03EC065
:1013B00021E1F22EC12CD12C32E8E32E82E890E01C
:1013C0000E9494098C01882359F199270E948A0967
:1013D000882331F1CC0CDD1C9E2D901B081B90172F
:1013E00018F46894C0F807C0F1E1FF1204C07894C3
:1013F0008CEE9FEF1BC0FA9409F78FE591E00E94F5
:101400009409892B21F478948BEE9FEF0FC08BE524
:1014100090E00E948A09892BB1F77894C60106C032
:1014200078948F2D90E09195819591090F90DF919F
:10143000CF911F910F91FF90EF90DF90CF90089583
:1014400060E00C94A20960E083E00C94A2091F9371
:10145000CF93DF9300D01F92CDB7DEB7182FF8944B
:10146000509A83EF9BE00197F1F700C000002B83B7
:101470004A8369830E9456096981862F886090E1BA
:10148000199FF00111248E2B0E9463090E944909C3
:10149000EFE1F3E03197F1F700C000000E94560938
:1014A0004A81842F0E9463092B81822F0E94630945
:1014B0000E94490978940F900F900F90DF91CF917F
:1014C0001F910895262F277040E062E00C94270AB0
:1014D00080915A0108959FB7F894109251019FBFCF
:1014E0009091D301943009F058C09091E9009F7019
:1014F0002091EC0020FF02C020E801C020E0292B51
:1015000094E09093E9009091EB0090FF43C090919C
:10151000EE0097FF3FC090914E01992321F09091EA
:10152000E80095FF37C010924E0196E03091E80038
:1015300035FD15C03091D301343061F53091EB00A9
:1015400035FD28C0915021F481E080934E0122C0E6
:10155000EFE9FFE03197F1F700C00000E7CF80939B
:10156000F1008091E80085FD0AC08091E80080FFCD
:10157000FCCF8091E8008E778093E80006C08FB79B
:10158000F89491E0909351018FBF2F702093E90060
:1015900080E008952F702093E9008FEF0895CF9396
:1015A000DF9300D01F92CDB7DEB72091D301243056
:1015B00019F523E029839B838A832093E9008FEF29
:1015C0009091E800815095FD06C095ED9A95F1F750
:1015D00000008111F5CF8091E80085FF0DC040E04B
:1015E00050E063E070E0CE0101960E94850D80918D
:1015F000E8008E778093E8000F900F900F90DF91B6
:10160000CF910895CF93DF9300D01F92CDB7DEB76F
:101610002091D301243021F522E029839B838A8302
:1016200083E08093E9008FEF9091E800815095FD71
:1016300006C095ED9A95F1F700008111F5CF8091E4
:10164000E80085FF0DC040E050E063E070E0CE01AF
:1016500001960E94850D8091E8008E778093E800C6
:101660000F900F900F90DF91CF9108952091D301AB
:101670002430F1F422E02093E9002FEF3091E800CC
:10168000215035FD06C035ED3A95F1F700002111E6
:10169000F5CF2091E80025FF0BC040E050E065E069
:1016A00070E00E94850D8091E8008E778093E800BD
:1016B0000895CF93DF93EC018091D301843039F505
:1016C00081E08093E9008FEF9091E800815095FDD3
:1016D00006C095ED9A95F1F700008111F5CF809144
:1016E000E80085FF14C040E050E068E070E0CE0103
:1016F0000E94850D8091E8008E778093E80088E055
:10170000FE01A2E5B1E001900D928A95E1F7DF912B
:10171000CF9108958BE293E00E94EB058091D20176
:10172000811109C00E94170F0E94740F8091E2007E
:1017300084608093E200089587E293E00E94EB05C5
:101740001092D2010895089580914F018F5F809388
:101750004F0162E30E941528911135C010924F018C
:1017600080915101882379F18091D301843049F52A
:101770008091E9008F709091EC0090FF02C090E89A
:1017800001C090E0982B84E08093E9008091EB0009
:1017900080FF14C08091EE0087FF10C08091E800A8
:1017A00085FF03C01092F100F9CF8091E80080FF1F
:1017B00005C08091E8008E778093E8009F70909339
:1017C000E90010925101089542E061EC81E00E942D
:1017D000910E42E061EC82E00E94910E42E061ECE9
:1017E00083E00E94910E42E261EC84E00C94910E41
:1017F0008091D501833009F453C030F4813071F009
:10180000823009F48CC008958A3009F478C08B3096
:1018100009F45EC0893009F09AC020C08091D401DB
:10182000813A09F094C08091E800877F8093E800B6
:101830008091D8019091D901892B21F060E080E05E
:1018400090E003C068E082E591E070E00E94CE0D78
:101850008091E8008B778093E80008958091D4010F
:10186000813209F074C08091D8019091D901892BFF
:1018700009F06DC08091E800877F8093E800809137
:10188000E80082FD05C08091D3018111F8CF5FC0CF
:101890008091F10080935A018091E8008B7753C0CA
:1018A0008091D401813A09F052C08091D801909181
:1018B000D901892B09F04BC08091E800877F809384
:1018C000E8008091E80080FFFCCF80910C0136C0D9
:1018D0008091D4018132D9F58091D8019091D901BC
:1018E000892BA9F58091E800877F8093E8000E940A
:1018F000C60E8091D60180930C010C94A1188091A2
:10190000D401813221F58091E800877F8093E8003F
:101910000E94C60E8091D70180935B01089580914B
:10192000D401813AA1F48091E800877F8093E80098
:101930008091E80080FFFCCF80915B018093F100F3
:101940008091E8008E778093E8000C94C60E08958D
:101950000895089580915A018093500110925A0180
:1019600080E00E9444090E9474130C94A1180C9406
:10197000AA0C0E94CE1E8091D101882329F00E94DA
:10198000F41E81110C946F0D089584B7877F84BF76
:1019900088E10FB6F89480936000109260000FBE4B
:1019A00090E080E80FB6F894809361009093610016
:1019B0000FBE8BE69AE00E94A31E8FE193E00E9487
:1019C000EB050E94A80C0E94AB120E94170F0E9408
:1019D000740F8091E20084608093E200789480919B
:1019E000D3018430E1F78EE093E00E94EB050E9482
:1019F000AD1282E091E00E94EE118DEF92E00E9424
:101A0000EB050E94A90C8091D301853019F40E9446
:101A1000B90CF9CF0E94B312F6CF0E94091F809132
:101A2000500180935A0108950C940D0D292F3327EE
:101A300023303105A9F06CF42130310509F442C09E
:101A40002230310509F043C084E790E023E733E01A
:101A500042C021323105C9F02232310519F137C0B7
:101A600099278130910541F08230910541F0892B11
:101A700071F5EFE6F3E005C0EFE5F3E002C0EFE259
:101A8000F3E0849190E09F0126C0643000F5E62FDA
:101A9000F0E0EE0FFF1FEF5DFE4F2081318189E006
:101AA00090E019C0643098F4E62FF0E0DF01AA0F4F
:101AB000BB1FA75EBE4F2D913C91EB5EFE4F808118
:101AC00090E009C082E190E027EE33E004C080E0BE
:101AD00090E020E030E0FA0131832083089580E136
:101AE00089BD82E189BD09B400FEFDCF8091D80097
:101AF0008F7D8093D8008091E00082608093E00029
:101B00008091E00081FDFCCF0895CF92DF92EF92AB
:101B1000FF920F931F93CF93DF937C018B01EA0118
:101B20000E94E70E811131C0209731F088819981A0
:101B3000081B190BE80EF91EC12CD12C011511053B
:101B400019F18091E80085FD14C08091E8008E773E
:101B50008093E800209741F0888199818C0D9D1D2C
:101B60009983888385E011C00E94E70E882331F3B2
:101B70000CC0F70181917F018093F10001501109A0
:101B8000FFEFCF1ADF0ADACF80E0DF91CF911F910C
:101B90000F91FF90EF90DF90CF9008952091DA01A0
:101BA0003091DB012617370748F06115710539F4CC
:101BB0002091E8002E772093E80001C0B901FC01D4
:101BC00020E061157105B9F18091D301882309F4F2
:101BD00040C0853009F43FC08091E80083FD3DC0DE
:101BE0008091E80082FF06C08091E80082FF26C055
:101BF00080E008958091E80080FFE3CF2091F3001A
:101C00008091F20090E0922B6115710551F08830BF
:101C1000910538F421912093F100615071090196EA
:101C2000F3CF21E0089709F020E08091E8008E775B
:101C30008093E800C6CF2111C7CFD6CF8091D301C2
:101C4000882339F0853039F08091E80083FFCCCFCC
:101C500004C082E0089583E0089581E00895209112
:101C6000DA013091DB012617370748F0611571055D
:101C700039F42091E8002E772093E80001C0B901E3
:101C8000FC0120E061157105C1F18091D301882329
:101C900009F441C0853009F440C08091E80083FD1B
:101CA0003EC08091E80082FF06C08091E80082FF7C
:101CB00027C080E008958091E80080FFE3CF209165
:101CC000F3008091F20090E0922B6115710559F0BC
:101CD0008830910540F424912093F10031966150B1
:101CE00071090196F2CF21E0089709F020E0809178
:101CF000E8008E778093E800C5CF2111C6CFD5CFFD
:101D00008091D301882339F0853039F08091E80043
:101D100083FFCBCF04C082E0089583E0089581E083
:101D20000895982F973058F59093E900981739F057
:101D30007091EC002091ED005091F00003C0242F31
:101D4000762F50E021FF19C03091EB003E7F309399
:101D5000EB003091ED003D7F3093ED003091EB00D2
:101D600031603093EB007093EC002093ED005093C2
:101D7000F0002091EE0027FF07C09F5FD3CF8F7048
:101D80008093E90081E0089580E008958091D40176
:101D900087FD05C08091E80080FF0EC012C08091D1
:101DA000E80082FD05C08091D3018111F8CF08952C
:101DB0008091E8008B7708C08091D3018111EACF30
:101DC00008958091E8008E778093E80008958091CF
:101DD000E4009091E50045E62091EC0020FF21C051
:101DE0002091E80020FD21C02091D301222389F019
:101DF000253089F02091EB0025FD0FC02091E400F3
:101E00003091E5002817390739F3415041F0C901F5
:101E1000E3CF82E0089583E0089581E0089584E0AF
:101E200008952091E80022FFDFCF80E008950E940E
:101E3000850F0E948D0FE0EEF0E08081816080834D
:101E4000E8EDF0E080818F77808319BCA7EDB0E0EA
:101E50008C918E7F8C9380818F7E80831092D201B3
:101E600008950F931F93CF93DF930E94850F0E94D5
:101E70008D0FC8EDD0E088818F7788838881806856
:101E8000888388818F7D888319BC1092D30110923A
:101E9000CF011092D1011092D00100EE10E0F801B4
:101EA00080818B7F808388818160888342E060E0CD
:101EB00080E00E94910EE1EEF0E080818E7F8083D1
:101EC000E2EEF0E0808181608083808188608083A1
:101ED000F80180818E7F8083888180618883DF9193
:101EE000CF911F910F910895E8EDF0E080818F7EF2
:101EF0008083E7EDF0E080818160808384E082BFB1
:101F000081E08093D2010C94310FE8EDF0E0808104
:101F10008E7F80831092E20008951092DA00109272
:101F2000E10008951F920F920FB60F9211242F9384
:101F30003F934F935F936F937F938F939F93AF9351
:101F4000BF93EF93FF938091E10082FF0BC08091DC
:101F5000E20082FF07C08091E1008B7F8093E10067
:101F60000E94A40B8091DA0080FF1FC08091D800EE
:101F700080FF1BC08091DA008E7F8093DA00809111
:101F8000D90080FF0DC080E189BD82E189BD09B41F
:101F900000FEFDCF81E08093D3010E948A0B05C033
:101FA00019BC1092D3010E949C0B8091E10080FF2C
:101FB00019C08091E20080FF15C08091E2008E7F01
:101FC0008093E2008091E20080618093E200809142
:101FD000D80080628093D80019BC85E08093D3013B
:101FE0000E94B70C8091E10084FF30C08091E20034
:101FF00084FF2CC080E189BD82E189BD09B400FE67
:10200000FDCF8091D8008F7D8093D8008091E10032
:102010008F7E8093E1008091E2008F7E8093E200CA
:102020008091E20081608093E2008091CF0188235B
:1020300011F084E007C08091E30087FF02C083E0D5
:1020400001C081E08093D3010E94140D8091E100D2
:1020500083FF29C08091E20083FF25C08091E100C9
:10206000877F8093E10082E08093D3011092CF01BB
:102070008091E1008E7F8093E1008091E2008E7F6D
:102080008093E2008091E20080618093E20042E070
:1020900060E080E00E94910E8091F0008860809363
:1020A000F0000E94A30BFF91EF91BF91AF919F9120
:1020B0008F917F916F915F914F913F912F910F90F1
:1020C0000FBE0F901F9018951F920F920FB60F9290
:1020D00011242F933F934F935F936F937F938F932D
:1020E0009F93AF93BF93CF93EF93FF93C091E9007A
:1020F000CF708091EC001092E9008091F000877F12
:102100008093F00078940E94A0101092E9008091D2
:10211000F00088608093F000C093E900FF91EF9198
:10212000CF91BF91AF919F918F917F916F915F916F
:102130004F913F912F910F900FBE0F901F901895C8
:102140001F93CF93DF93CDB7DEB7AA970FB6F8945E
:10215000DEBF0FBECDBFE4EDF1E08091F1008193D1
:1021600021E0EC3DF207C9F70E94F80B8091E800EE
:1021700083FF1CC12091D4013091D501832F90E0C1
:102180008A30910508F012C1FC01EA5AFF4F0C9405
:102190003528203881F0223809F008C18091D80113
:1021A0008F708093E9008091EB0085FB882780F990
:1021B0001092E90006C08091D0019091D101911157
:1021C00082609091E800977F9093E8008093F100FF
:1021D0001092F100C5C0822F8D7F09F0E7C0222345
:1021E00019F0223061F0E2C08091D601813009F00F
:1021F000DDC0333009F080E08093D10128C08091A8
:10220000D601811124C02091D8012F7009F4CEC0CD
:102210002093E9008091EB0080FF19C08091EB00D2
:10222000333011F4806211C080618093EB0081E053
:1022300090E0022E01C0880F0A94EAF78093EA002A
:102240001092EA008091EB0088608093EB0010927E
:10225000E9008091E800877F86C02111A7C0109116
:10226000D6011F778091E3008078812B8093E30073
:102270008091E800877F8093E8000E94C60E8091DD
:10228000E80080FFFCCF8091E30080688093E3004A
:10229000112311F083E001C082E08093D30186C056
:1022A0002058223008F082C08091D6019091D70149
:1022B0008C3D23E0920779F583E08A838AE2898363
:1022C0004FB7F894DE01139620E03EE051E2E32F91
:1022D000F0E050935700E49120FF03C0E295EF70C7
:1022E0003F5FEF708E2F90E0EA3010F0C79601C08C
:1022F000C0968D939D932F5F243149F74FBF8091F6
:10230000E800877F8093E8006AE270E0CE010196E2
:102310000E94CE0D14C0AE014F5F5F4F6091D80197
:102320000E94160D009709F441C02091E800277F14
:102330002093E800BC0189819A810E942F0E809130
:10234000E8008B778093E80031C0203879F58091E0
:10235000E800877F8093E8008091CF018093F100AF
:102360008091E8008E778093E8000E94C60E1EC020
:1023700021111CC09091D6019230C0F48091E800E8
:10238000877F8093E8009093CF010E94C60E8091D2
:10239000CF01811104C08091E30087FF02C084E077
:1023A00001C081E08093D3010E94E40B8091E8009A
:1023B00083FF0AC08091E800877F8093E8008091C6
:1023C000EB0080628093EB00AA960FB6F894DEBF14
:1023D0000FBECDBFDF91CF911F9108959093610102
:1023E000809360010895E0916001F0916101309760
:1023F00021F00190F081E02D099480E00895FF9292
:102400000F931F93CF93DF938C01E0916001F091C4
:102410006101309799F10280F381E02D0995809157
:10242000BE0182FF2BC080FF04C084E095E00E94C3
:10243000EB05E80188E0F82E0EEF14E08091BE0174
:1024400080FF0BC088811F928F931F930F930E9470
:1024500084060F900F900F900F90FA942196F11030
:10246000EDCF8091BE0180FF09C08CEF94E0DF9139
:10247000CF911F910F91FF900C94EB05DF91CF91BD
:102480001F910F91FF900895E0916001F09161011B
:10249000309721F00480F581E02D09940895CF93C1
:1024A000DF93EC0180915E0190915F01C817D9071D
:1024B00009F1D0935F01C0935E01E0916001F0915A
:1024C00061013097B9F00680F781E02DCE010995C2
:1024D0008091BE0182FF0EC080FF0CC0DF93CF93BE
:1024E0008EEE94E09F938F930E9484060F900F903E
:1024F0000F900F90DF91CF910895CF93DF93EC0170
:1025000080915C0190915D01C817D90709F1D093C2
:102510005D01C0935C01E0916001F0916101309731
:10252000B9F00084F185E02DCE0109958091BE01BE
:1025300082FF0EC080FF0CC0DF93CF938EED94E03E
:102540009F938F930E9484060F900F900F900F908F
:10255000DF91CF9108950C9475130E94361F0E944D
:10256000B0060C94A109CF92DF92EF92FF920F93E5
:102570001F93CF93DF9300D000D000D0CDB7DEB74C
:102580000E94580833E6E32E31E0F32E00E010E01D
:10259000C02E802F0E943E09F701D1907F01D826DE
:1025A000B1F40F5F1F4F0031110591F78FEF898351
:1025B0008A831B820E943F1F8160782F9D838C83BA
:1025C00049815A816B818D810E94C81348C09091C6
:1025D000BE0191FF04C08E830E9492138E8120E081
:1025E00030E04D2D50E0922FBA01022E02C07595B9
:1025F00067950A94E2F760FF2CC02983CA82EE2413
:10260000E394F12C02C0EE0CFF1C9A95E2F790E0E7
:102610008E219F2121E0892B09F420E02B830E9449
:102620003F1F8160782F9D838C8349815A816B8104
:102630008D810E94C81349815A816B817C818D8173
:102640000E94BB1EF801ED59FE4F80818E258083CC
:1026500006C02F5F3F4F2830310529F6A2CF0E94D8
:10266000BA1E0E9482220E948007109162010E947D
:10267000F311181741F10E94F311809362019091B8
:10268000BE0192FF0EC090FF0CC01F928F938FE08F
:1026900095E09F938F930E9484060F900F900F9068
:1026A0000F908091620126960FB6F894DEBF0FBEA0
:1026B000CDBFDF91CF911F910F91FF90EF90DF90F1
:1026C000CF900C94CC1E26960FB6F894DEBF0FBEAA
:1026D000CDBFDF91CF911F910F91FF90EF90DF90D1
:1026E000CF9008950C94440908950895CF93DF93F3
:1026F0001F92CDB7DEB769830E943E09282F30E0D4
:1027000081E090E0698102C0880F991F6A95E2F725
:102710002823392381E0232B09F480E00F90DF91F7
:10272000CF910895EF92FF920F931F93CF93DF9372
:1027300088E295E00E94EB05C0E0D0E089E2E82E57
:1027400081E0F82E0AE115E08C2F0E943E090E94DC
:10275000A81EFF92EF921F928F93DF93CF931F9348
:102760000F930E94840621968DB79EB708960FB6E8
:10277000F8949EBF0FBE8DBFC031D10529F7DF9100
:10278000CF911F910F91FF90EF90089508950895B4
:10279000CF93DF93CDB7DEB72B970FB6F894DEBF9C
:1027A0000FBECDBF4F83588769877A878B878A850D
:1027B0009B85892B31F05F3F11F080E003C04F3FD4
:1027C000E1F781E0811107C04F81588569857A85DD
:1027D0008B850E94BB1EDE01119686E0FD011192E1
:1027E0008A95E9F785E0FE01379601900D928A956A
:1027F000E1F749815A816B817C818D819E810E94A4
:102800007F1B2B960FB6F894DEBF0FBECDBFDF91B6
:10281000CF910895CF93C82F882309F4E7C0823859
:10282000A1F40E94F31181FDE1C089E30E94FC1D27
:102830000E947D1E2FEF81EE94E021508040904059
:10284000E1F700C0000089E315C08338C1F40E949D
:10285000F31180FDCBC083E50E94FC1D0E947D1E0C
:102860002FEF81EE94E0215080409040E1F700C0CE
:10287000000083E50E941D1ECF910C947D1E8438BC
:10288000A1F40E94F31182FDB1C087E40E94FC1DF7
:102890000E947D1E2FEF81EE94E0215080409040F9
:1028A000E1F700C0000087E4E5CF8CEF8C0F813AA0
:1028B00048F48C2F0E94A325811198C08C2F0E9470
:1028C000FC1DDACF80E28C0F883048F4C77081E0BD
:1028D00001C0880FCA95EAF70E94411ECDCF8BE553
:1028E0008C0F833078F4C53A29F0C63A31F482E887
:1028F00090E005C081E890E002C083E890E0CF91CD
:102900000C944F1288E58C0F853108F06FC0C83ADF
:1029100061F1C93A69F1CA3A71F1CB3A79F1CC3A2D
:1029200081F1CD3A89F1CE3A91F1CF3A99F1C13B9B
:10293000A1F1C03BA9F1C23BB1F1C33BB9F1C43B2A
:10294000C1F1C53BC9F1C63BD1F1C73BD9F1C83B89
:10295000E1F1C93BE9F1CA3BF1F1CB3BF9F1CC3BE9
:1029600009F03FC08AE292E03EC082EE90E03BC0B8
:1029700089EE90E038C08AEE90E035C085EB90E0BB
:1029800032C086EB90E02FC083EB90E02CC084EB4C
:1029900090E029C087EB90E026C08CEC90E023C04B
:1029A0008DEC90E020C083E891E01DC08AE891E0C2
:1029B0001AC082E991E017C084E991E014C081E275
:1029C00092E011C083E292E00EC084E292E00BC07C
:1029D00085E292E008C086E292E005C087E292E0DC
:1029E00002C080E090E0CF910C947D12CF910895C9
:1029F000882309F466C08238A1F40E94F31181FF94
:102A000060C089E30E94FC1D0E947D1E2FEF81EEB5
:102A100094E0215080409040E1F700C0000089E33D
:102A200015C08338B9F40E94F31180FF4AC083E5D2
:102A30000E94FC1D0E947D1E2FEF81EE94E021502C
:102A400080409040E1F700C0000083E50E941D1E19
:102A50000C947D1E8438A1F40E94F31182FF31C0D2
:102A600087E40E94FC1D0E947D1E2FEF81EE94E002
:102A7000215080409040E1F700C0000087E4E6CF9D
:102A80009CEF980F913A10F390E2980F983050F421
:102A9000877091E001C0990F8A95EAF7892F0E940B
:102AA000471ED6CF9BE5980F933020F480E090E04E
:102AB0000C944F12885A853120F480E090E00C94F9
:102AC0007D120895882321F00E94411E0C947D1EE2
:102AD0000895882321F00E94471E0C947D1E0895BE
:102AE000CF92DF92EF92FF920F931F93CF93DF93DA
:102AF000CDB7DEB728970FB6F894DEBF0FBECDBFB7
:102B00008C0185E0F801DE01119601900D928A9505
:102B1000E1F7F80140813181F280258122952F7003
:102B200083819481892B31F03F3F31F481E04F3F25
:102B300019F403C081E001C080E080FDE1C2498357
:102B40003A8389819A812F830E94BA1D9E83888748
:102B50000E94B91D0E94E11C4E81E42FE295EF70A6
:102B6000F0E0E05AFF4F2F8168850C943528842FC0
:102B7000807F142F1F70882311F01295107FFF2083
:102B800059F0112309F471C2812F68870E94541EE5
:102B90000E947D1E688569C2862F0E94F814112349
:102BA00009F4AEC2812F0E945A1E28960FB6F894DF
:102BB000DEBF0FBECDBFDF91CF911F910F91FF9070
:102BC000EF90DF90CF900C947D1E842F807F942F08
:102BD0009F70E92E803219F0E29480EFE82266239C
:102BE00019F0613001F129C0FF20A9F08E2D2223B8
:102BF00049F1213039F528960FB6F894DEBF0FBEA3
:102C0000CDBFDF91CF911F910F91FF90EF90DF909B
:102C1000CF900C94641E222319F0213009F470C265
:102C20000E94671E2CC0FF20E9F0263008F068C221
:102C30000E943E1E8E2129F022C0FF20F1F02111BA
:102C400015C08E2D28960FB6F894DEBF0FBECDBFEF
:102C5000DF91CF911F910F91FF90EF90DF90CF9078
:102C60000C946215253008F04BC209C0F80185812B
:102C700080FFFBC18F708583E4CF21110AC28E2DA6
:102C800078C1242F26952695237030E02115310533
:102C900021F021303105C9F033C2FF2021F0862F09
:102CA000942F937002C080E090E028960FB6F894BD
:102CB000DEBF0FBECDBFDF91CF911F910F91FF906F
:102CC000EF90DF90CF900C944F12FF2021F0862FD1
:102CD000942F937002C080E090E028960FB6F8948D
:102CE000DEBF0FBECDBFDF91CF911F910F91FF903F
:102CF000EF90DF90CF900C947D12862FFF2019F07B
:102D00000E94082102C00E94702128960FB6F894F4
:102D1000DEBF0FBECDBFDF91CF911F910F91FF900E
:102D2000EF90DF90CF900C94F521842F837009F001
:102D300076C0F110E5C1262F229526952770220F27
:102D4000220F862F8F70C82ED12CE12CF12C022E51
:102D500004C0CC0CDD1CEE1CFF1C0A94D2F764FFEF
:102D600010C06FE070E080E090E004C0660F771F55
:102D7000881F991F2A95D2F7609570958095909538
:102D800003C060E070E0CB01242F269526952370C8
:102D9000422F50E042305105D1F04330510559F1F6
:102DA0006C297D298E299F294130510541F12896B2
:102DB0000FB6F894DEBF0FBECDBFDF91CF911F914C
:102DC0000F91FF90EF90DF90CF900C94F61C6C2940
:102DD0007D298E299F2928960FB6F894DEBF0FBE55
:102DE000CDBFDF91CF911F910F91FF90EF90DF90BA
:102DF000CF900C94081D0E94F61CC701B6012896BE
:102E00000FB6F894DEBF0FBECDBFDF91CF911F91FB
:102E10000F91FF90EF90DF90CF900C94E41CFF2077
:102E200019F0842F817001C08695882309F468C148
:102E3000262F229526952770220F220F862F8F701E
:102E4000C82ED12CE12CF12C022E04C0CC0CDD1CA0
:102E5000EE1CFF1C0A94D2F764FF10C06FE070E014
:102E600080E090E004C0660F771F881F991F2A95A5
:102E7000D2F7609570958095909503C060E070E002
:102E8000CB01242F269526952370422F50E0423007
:102E90005105D1F04330510559F16C297D298E2916
:102EA0009F294130510541F128960FB6F894DEBFB5
:102EB0000FBECDBFDF91CF911F910F91FF90EF908B
:102EC000DF90CF900C94951D6C297D298E299F2928
:102ED00028960FB6F894DEBF0FBECDBFDF91CF911D
:102EE0001F910F91FF90EF90DF90CF900C94A71D52
:102EF0000E94951DC701B60128960FB6F894DEBF53
:102F00000FBECDBFDF91CF911F910F91FF90EF903A
:102F1000DF90CF900C94831D603FD9F128F480E4BA
:102F2000860F803250F09CC0623F09F461C008F403
:102F30004BC0633F09F470C093C0162F1071842FEB
:102F40008F716887FF2059F00E942E1D6885862F9B
:102F5000112319F08295807F75CE8F7073CE0E94F9
:102F6000491D6885862F112319F08295807F01C045
:102F70008F7028960FB6F894DEBF0FBECDBFDF91DD
:102F8000CF911F910F91FF90EF90DF90CF900C9415
:102F90006915FF20A9F0253008F0B2C0842F8F7189
:102FA00028960FB6F894DEBF0FBECDBFDF91CF914C
:102FB0001F910F91FF90EF90DF90CF900C94681DC0
:102FC000263008F09DC0EACFFF20A1F0842F8F713A
:102FD00028960FB6F894DEBF0FBECDBFDF91CF911C
:102FE0001F910F91FF90EF90DF90CF900C942E1DCA
:102FF000FF2061F3842F8F7128960FB6F894DEBFFF
:103000000FBECDBFDF91CF911F910F91FF90EF9039
:10301000DF90CF900C94491DFF2091F0842F8F7189
:1030200028960FB6F894DEBF0FBECDBFDF91CF91CB
:103030001F910F91FF90EF90DF90CF900C941F1D88
:1030400028960FB6F894DEBF0FBECDBFDF91CF91AB
:103050001F910F91FF90EF90DF90CF900C941A1D6D
:10306000FF20A1F0222309F4B1CF862F28960FB6B6
:10307000F894DEBF0FBECDBFDF91CF911F910F91AE
:10308000FF90EF90DF90CF900C940A14222309F464
:10309000B1CF862F28960FB6F894DEBF0FBECDBFF6
:1030A000DF91CF911F910F91FF90EF90DF90CF9024
:1030B0000C94F8144F70C8010E94C81F28960FB6D0
:1030C000F894DEBF0FBECDBFDF91CF911F910F915E
:1030D000FF90EF90DF90CF900C942C1C4F70C801A4
:1030E00028960FB6F894DEBF0FBECDBFDF91CF910B
:1030F0001F910F91FF90EF90DF90CF900C94CB1F1A
:1031000028960FB6F894DEBF0FBECDBFDF91CF91EA
:103110001F910F91FF90EF90DF90CF9008950E9444
:10312000611E0E94301E0E947D1E0E9423230E9469
:10313000F52180E090E00E944F1280E090E00C9436
:103140007D120E94511E0C948F180E94BA1D292FC7
:1031500022952F7030E02C3031054CF42A303105A7
:10316000C4F4225031092230310540F021C02C3006
:103170003105D1F02F303105B9F01AC0853A28F465
:103180008430C0F4823028F415C090E2980F983053
:1031900088F0883E30F4803E68F48450813A40F4F0
:1031A00009C0803F29F406C093FB882780F9089561
:1031B00080E0089581E00895CF93DF9300D000D0A0
:1031C0001F92CDB7DEB70F900F900F900F900F901A
:1031D000DF91CF910895CF93DF9300D000D000D03E
:1031E000CDB7DEB726960FB6F894DEBF0FBECDBFC3
:1031F000DF91CF9108951F93CF93DF93C091730117
:1032000016E080917401C81799F0D0E01C9FF0017E
:103210001D9FF00D1124EB58FE4F408151816281BA
:103220007381848195810E94EB182196C770E9CF44
:10323000DF91CF911F9108954091A5015091A60172
:103240006091A7017091A8018091A9019091AA01B4
:103250000C94EB18CF938091AA0182958F7009F09E
:103260005FC08091A701882309F45AC0209173019F
:10327000A09174016091A5017091A6018091A801AF
:103280009091A90131E06F3F09F030E0B32FC6E023
:103290002A1709F445C0009721F07F3F21F44B2FF6
:1032A00003C041E001C040E030E040FD35C0C29FB6
:1032B000F001C39FF00D1124EB58FE4F41817413B0
:1032C0002BC04081641328C04281411125C0438135
:1032D00054814817590710F441505109481B590BA4
:1032E000483C5105C8F48091AA018F708061809399
:1032F000AA0186E0829FF001839FF00D1124E65819
:10330000FE4F80818F708061808385EA91E00E940A
:103310007015CF910C94FB182F5F3F4F2770B8CFDB
:10332000CF910895CF92DF92EF92FF920F931F9368
:10333000CF93DF93CDB7DEB762970FB6F894DEBFB9
:103340000FBECDBF8C0185E0F801DE011D96019016
:103350000D928A95E1F7D8014C9111965C911197E5
:1033600012966C9112971396ED90FC9014977091B1
:10337000A501E091A6012091A8013091A901211594
:10338000310531F0EF3F31F481E07F3F19F403C0A4
:1033900081E001C080E0B82FB170CB2E80FD6CC100
:1033A000D090A701DD2009F4F5C0F091AA01E21642
:1033B000F30638F0C701821B930B883C910548F057
:1033C0009BC0209530952E0D3F1D283C310508F0FF
:1033D00093C08F2F807F09F052C0E51314C074137F
:1033E00012C0D62E61110FC0FF70F061F093AA01D8
:1033F0000E941C1985EA91E00E9470158091AA0133
:10340000F80185836CC1EF2831F05F3F31F481E032
:103410004F3F19F403C081E001C080E080FD03C08C
:1034200081E0862701C080E0F82FF170FF2E80FF39
:103430001CC0809173012091740136E0821709F459
:1034400028C190E0389FF001399FF00D1124EB580E
:10345000FE4F7181571306C07081471303C07281FC
:10346000671303C001968770E9CFD62E662309F44F
:1034700036C18091AA0181608093AA0153C0E513EF
:1034800008C0741306C0611104C0D8011596FC93DE
:10349000AEC04D875E878D859E856A8B0E94A5187C
:1034A0006A89882329F1D62E662311F12091AA0179
:1034B000822F82958F7090E002970CF460C080910B
:1034C000A5019091A60198878F831986FB86EA86CD
:1034D0002C87CE01079651C0E51731F14D875E87E5
:1034E0008D859E856A8B0E94A5186A8981112EC0E0
:1034F000C8010E947015A4C08F2F807F69F77E2DB0
:10350000F98AE88A89890E94DC1885EA91E00E949C
:103510007015E5EAF1E086E0DF011D928A95E9F792
:103520000E941C19D12CDBC07413D8CF6111D6CFE7
:10353000D8011596FC93C8010E947015E5EAF1E0E8
:1035400086E0DF011D928A95E9F7C9C0D62E662371
:1035500079F22091AA01822F82958F7090E00297D4
:1035600074F08091A5019091A6019A8389831B82B2
:10357000FD82EC822E83CE0101960E94701586E0BA
:10358000F801A5EAB1E001900D928A95E1F70E9459
:103590002A196FC0E216F30628F0C701821B930BAD
:1035A0009C0104C0209530952E0D3F1D283C31050F
:1035B00008F052C0D62E662309F49ACFE5132CC02A
:1035C00074132AC08091AA0180FD1DC0982F929586
:1035D0009F70C9F0D80115968C9315979F3039F0DC
:1035E0009F5F9295907F8F70892B15968C93C80161
:1035F0000E94701586E0F801A5EAB1E001900D92F5
:103600008A95E1F736C086E0F801A5EAB1E00190BD
:103610000D928A95E1F763C04D875E878D859E8503
:103620000E94A518882379F086E0F801A5EAB1E0A8
:1036300001900D928A95E1F70E942A190E941C19A7
:10364000DD24D3944CC08091AA0181608093AA01AB
:10365000C8010E94701543C07E2DF98AE88A8989C5
:103660000E94DC18E5EAF1E086E0DF011D928A9510
:10367000E9F70E941C1933C0662309F439CF4D873E
:103680005E878D859E850E94A518882309F430CF1A
:10369000CBCF4D875E878D859E850E94BA1D292FD1
:1036A00022952F7030E0223031052CF49F7041F0CC
:1036B000811106C00CC0243031052CF49F7049F4F0
:1036C000805E883020F0C8010E947015CF2CDC2C61
:1036D00006C0D80115969C91907F91F7F8CF8D2D5B
:1036E00062960FB6F894DEBF0FBECDBFDF91CF91CB
:1036F0001F910F91FF90EF90DF90CF9008951F934F
:10370000CF93DF93CDB7DEB72C970FB6F894DEBF1B
:103710000FBECDBF4F83588769877A878B879C8779
:10372000CE0107960E9492198823C1F02F81388517
:103730008A859B85892B31F03F3F11F080E003C0E3
:103740002F3FE1F781E0811147C04F81588569859E
:103750007A858B859C850E94EB183EC086E0FE0131
:103760003796DE01119601900D928A95E1F7FF815F
:10377000E8854A855B854115510531F0EF3F31F40D
:1037800081E0FF3F19F403C081E001C080E080FDCB
:1037900023C02091740130E0C901019687709927F8
:1037A0006091730170E086179707F1F1F983EA835E
:1037B0005D834C8396E0929FD001939FB00D1124BE
:1037C000AB58BE4FFE01319601900D929A95E1F7EC
:1037D000809374010E94FB1816E080917301909110
:1037E0007401891779F1189FC00111248B589E4FDD
:1037F0000E949219882331F1E09173011E9FF0011C
:103800001124EB58FE4F4081518162817381848184
:1038100095810E94EB188091730190E0019687706A
:10382000992780937301D9CF0E94A1181092740137
:1038300010927301E5EAF1E086E0DF011D928A95BE
:10384000E9F7CACF2C960FB6F894DEBF0FBECDBFF6
:10385000DF91CF911F910895DF92EF92FF920F9326
:103860001F93CF93DF93FC01009709F48AC0E12CEA
:10387000F12CDD24D394EF0121968491853709F44E
:1038800061C058F4843708F04EC0843008F06AC034
:103890008130D1F0823071F174C0883709F45DC095
:1038A00050F4863709F455C0873709F06AC08E2D69
:1038B0000E944E1E54C09CE7980F903708F061C0DC
:1038C0008F770E94F81450C08F010E5F1F4FFE01CA
:1038D000849190E2980F983050F48770FD2D01C0CC
:1038E000FF0F8A95EAF78F2F0E94541E15C00E9481
:1038F0000A1414C08F010E5F1F4FFE01849190E2E5
:10390000980F983068F48770FD2D01C0FF0F8A95DD
:10391000EAF78F2F0E945A1E0E947D1EE80124C0E4
:103920000E94F814FBCF9F012E5F3F4FFE01C49110
:10393000CC2369F08FE99FE00197F1F700C0000008
:10394000C150F6CF9F012E5F3F4FFE01F490E90179
:103950000BC00E943E1EE82E07C00E94511E0E940E
:103960007D1E02C00E940A149F2D992341F0EFE9A9
:10397000FFE03197F1F700C000009150F6CFFE0153
:103980007ACFDF91CF911F910F91FF90EF90DF9051
:1039900008956093AF017093B0018093B10190934B
:1039A000B2010E94CA1E0C948F186093AB017093F1
:1039B000AC018093AD019093AE010E94CB1E0C949C
:1039C0008F1808950C94C91C0F931F930091AF0199
:1039D0001091B0012091B1013091B201602B712B97
:1039E000822B932B1F910F910C94C91C0F931F9343
:1039F0000091AF011091B0012091B1013091B2015D
:103A000060237123822393231F910F910C94C91C6F
:103A10000F931F930091AF011091B0012091B1015C
:103A20003091B20160277127822793271F910F9150
:103A30000C94C91C60E070E0CB010C94D51C41E0F3
:103A400050E060E070E004C0440F551F661F771F10
:103A50008A95D2F7CB01BA010C94D51C41E050E015
:103A600060E070E004C0440F551F661F771F8A9501
:103A7000D2F78091AB019091AC01A091AD01B091D2
:103A8000AE01482B592B6A2B7B2BCB01BA010C942E
:103A9000D51C41E050E060E070E004C0440F551FC9
:103AA000661F771F8A95D2F740955095609570955F
:103AB0008091AB019091AC01A091AD01B091AE01AC
:103AC000482359236A237B23CB01BA010C94D51CCC
:103AD00041E050E060E070E004C0440F551F661FF5
:103AE000771F8A95D2F78091AB019091AC01A0919C
:103AF000AD01B091AE01482759276A277B27CB013A
:103B0000BA010C94D51C0F931F930091AB01109137
:103B1000AC012091AD013091AE01602B712B822B55
:103B2000932B1F910F910C94D51C0F931F93009111
:103B3000AB011091AC012091AD013091AE01602339
:103B40007123822393231F910F910C94D51C0F9303
:103B50001F930091AB011091AC012091AD01309108
:103B6000AE0160277127822793271F910F910C9434
:103B7000D51C0895CF92DF92EF92FF920F931F937F
:103B8000CF93DF93EC01C090AF01D090B001E090F3
:103B9000B101F090B2018091AB019091AC01A09184
:103BA000AD01B091AE01C82AD92AEA2AFB2A0FE159
:103BB00010E0B701A601002E04C0769567955795D1
:103BC00047950A94D2F740FF07C0BE01802F0E949C
:103BD000E71F8130910539F40150110950F7BE01FA
:103BE00080E00E94E71FDF91CF911F910F91FF901E
:103BF000EF90DF90CF90089540910D0150910E010C
:103C000020E030E09FEFFA01E20FF31F62816817B6
:103C100099F09F3F19F4611101C0922F2F5F3F4F20
:103C20002630310581F79F3F39F0FA01E90FF11D88
:103C300097FDFA9582830895089540910D01509162
:103C40000E0120E030E0FA01E20FF31F9281981399
:103C500001C012822F5F3F4F26303105A1F7089532
:103C600081E090E0E0910D01F0910E01E80FF91F65
:103C70001082019688309105A9F708958091BD01C1
:103C800008959091BD01982B9093BD010895809562
:103C90009091BD0198239093BD0108958093BD013B
:103CA00008951092BD0108959091BC01982B9093B6
:103CB000BC01089580959091BC0198239093BC011C
:103CC00008951092BC0108958093B3010895109255
:103CD000B301089540910D0150910E0120E030E0B4
:103CE00080E0FA01E20FF31F918191118F5F2F5F46
:103CF0003F4F27303105A9F70895E0910D01F0916C
:103D00000E018091BD018083E0910D01F0910E01C3
:103D100080819091BC01892B80839091B30199237C
:103D200061F0E0910D01F0910E018081892B80837B
:103D30000E946A1E81111092B30180910D01909131
:103D40000E010C94FF119093350180933401089576
:103D50008295982F9C7C96959695837344E0849FDA
:103D600090011124922B892F8A7A86959575990F47
:103D7000892B08950895CF93DF9300D000D01F9230
:103D8000CDB7DEB70F900F900F900F900F90DF918F
:103D9000CF910895089508950C9472138091D301E2
:103DA000843009F11092BF0120E488E190E00FB661
:103DB000F894A895809360000FBE2093600083B7AD
:103DC000817F846083BF83B7816083BF7894889547
:103DD00083B78E7F83BF88E10FB6F894809360002D
:103DE000109260000FBE0895CF930E94C6130E94E8
:103DF00058080E94C713C0E08C2F0E943E09811111
:103E000005C0CF5FC031C1F780E001C081E0CF9134
:103E100008950E9474130C94A1181F920F920FB66C
:103E20000F9211248F939F93AF93BF938091BF0103
:103E3000811113C08091C0019091C101A091C20174
:103E4000B091C3014196A11DB11D8093C001909313
:103E5000C101A093C201B093C301BF91AF919F91E3
:103E60008F910F900FBE0F901F90189582E084BD28
:103E700093E095BD9AEF97BD80936E0008952FB79C
:103E8000F8948091C0019091C101A091C201B091BC
:103E9000C3012FBF08952FB7F8946091C0017091AE
:103EA000C1018091C2019091C3012FBF0895CF92AB
:103EB000DF92EF92FF920F931F932FB7F8944091E8
:103EC000C0015091C1016091C2017091C3012FBF27
:103ED0006A017B01EE24FF248C0120E030E0C01653
:103EE000D106E206F30610F441505109481B590B64
:103EF000CA011F910F91FF90EF90DF90CF9008952E
:103F00001F920F920FB60F9211248F939F93AF932E
:103F1000BF938091C0019091C101A091C201B09165
:103F2000C3010196A11DB11D8093C0019093C101F1
:103F3000A093C201B093C301BF91AF919F918F91A4
:103F40000F900FBE0F901F9018950E94170FF894B6
:103F50002FEF87EA91E6215080409040E1F700C0C2
:103F6000000087E090EBDC018093DC019093DD01A1
:103F7000A093DE01B093DF012CE088E190E00FB662
:103F8000F894A895809360000FBE20936000FFCF47
:103F900080E090E008950895E72FF0E090E1899F98
:103FA000E00DF11D112483E0EE0FFF1F8A95E1F76C
:103FB000E60FF11DEC51FF4F84910895E82FF0E0DA
:103FC000EE0FFF1FE05AF0408591949108950E94F2
:103FD000CC1F90E4980F903218F40E94DE1F0895D1
:103FE0008D3B60F4883AA0F5853A38F5843010F5B9
:103FF000813009F088C021E030E087C0883E98F425
:10400000803EC0F48F3B09F07EC00E94A1182FEFC4
:1040100080E792E0215080409040E1F700C000002E
:104020000E94A51F70C0803F08F46DC0282F30E0AB
:1040300030656BC0282F30E068C0853A21F0863AA1
:1040400021F492E803C091E801C093E880E458C0ED
:10405000883A51F1893A51F18A3A51F18B3A51F14A
:104060008C3A51F18D3A51F18E3A51F18F3A51F12A
:10407000813B51F1803B51F1823B51F1833B51F146
:10408000843B51F1853B51F1863B59F1873B59F116
:10409000883B59F1893B59F18A3B59F18B3B59F1E6
:1040A0008C3B61F59AE228C092EE29C099EE27C0B8
:1040B0009AEE25C095EB23C096EB21C093EB1FC071
:1040C00094EB1DC097EB1BC09CEC19C09DEC17C076
:1040D00093E805C09AE803C092E901C094E985E439
:1040E0000FC091E209C093E207C094E205C095E2D7
:1040F00003C096E201C097E286E402C090E084E447
:10410000292F382F02C020E030E0C90108958091A6
:10411000C60180FF0BC06091120185E0689FB0016D
:10412000112475956795759567952AC081FF09C01B
:104130006091120185E0689FB00111247595679523
:104140001FC082FF07C06091120185E0689FB00127
:10415000112416C04091C7014423C9F06091110198
:10416000461788F72091120185E0289F90011124BD
:10417000429FC001439F900D112470E00E942128AE
:104180006038710540F46115710539F002C065E0D1
:1041900070E0862F08958FE7089581E0089580915B
:1041A000C60180FF08C06091100170E075956795A9
:1041B0007595679521C081FF06C06091100170E080
:1041C0007595679519C082FF04C06091100170E079
:1041D00010C08091C7018823C1F060910F0186173C
:1041E000A0F790911001989FC001112470E00E94E7
:1041F00021286038710528F46115710521F0862F9A
:1042000008958FE7089581E0089561E070E0F4CFAC
:10421000803F21F40E948720819504C0813F29F4CA
:104220000E9487208093CA010895823F21F40E9452
:104230008720819504C0833F29F40E9487208093C2
:10424000C9010895893F19F40E94CF2005C08A3F13
:1042500031F40E94CF2081958093CB0108958B3F4C
:1042600021F40E94CF20819504C08C3F29F40E9444
:10427000CF208093CC010895843F21F48091C80120
:10428000816017C0853F21F48091C801826011C010
:10429000863F21F48091C80184600BC0873F21F4E0
:1042A0008091C801886005C0883F31F48091C801C1
:1042B00080618093C80108958D3F21F48091C601EB
:1042C00081600BC08E3F21F48091C601826005C0E1
:1042D0008F3F29F48091C60184608093C6010895C0
:1042E000803F39F48091CA0187FF6CC01092CA01E7
:1042F00069C0813F29F48091CA011816BCF362C0DD
:104300009091C901823F29F497FF5CC01092C901C6
:1043100059C0833F19F41916CCF354C0893F41F4B6
:104320008091CB0118160CF04DC01092CB014AC001
:104330008A3F29F48091CB0187FF44C0F6CF8B3FA1
:1043400039F48091CC0187FF3DC01092CC013AC076
:104350008C3F29F48091CC011816BCF333C0843F04
:1043600021F48091C8018E7F17C0853F21F4809190
:10437000C8018D7F11C0863F21F48091C8018B7FD9
:104380000BC0873F21F48091C801877F05C0883F1B
:1043900031F48091C8018F7E8093C80113C08D3F96
:1043A00021F48091C6018E7F0BC08E3F21F4809155
:1043B000C6018D7F05C08F3F29F48091C6018B7F98
:1043C0008093C6018091C90181110EC08091CA01FC
:1043D00081110AC08091CB01811106C08091CC016E
:1043E000811102C01092C70108958091BE0183FF20
:1043F0007EC08DE595E00E94EB058091C8011F927B
:104400008F9388E595E09F938F930E94840686E5BD
:1044100095E00E94EB052091C901822F992787FD25
:1044200090959F932F9383E595E09F938F930E94A0
:10443000840681E595E00E94EB052091CA01822F58
:10444000992787FD90959F932F938EE495E09F93F6
:104450008F930E9484068CE495E00E94EB052091E6
:10446000CB01822F992787FD90959F932F9389E405
:1044700095E09F938F930E94840687E495E00E94C5
:10448000EB052091CC01822F992787FD90959F9372
:104490002F9384E495E09F938F930E94840681E498
:1044A00095E00E94EB058091C7011F928F938EE3E8
:1044B00095E09F938F930E9484068CE395E00E9481
:1044C000EB058091C6011F928F9389E395E09F933E
:1044D0008F930E94840686E395E00E94EB058DB7DA
:1044E0009EB74C960FB6F8949EBF0FBE8DBF88EC5A
:1044F00091E00E9444120E943F1F9093C501809357
:10450000C40108951F93CF93DF938091C4019091CC
:10451000C5010E94571F4091C701442321F02091FB
:10452000130130E006C0209114015AE0259F90014C
:1045300011248217930708F482C08091C901109159
:10454000CA01D091CB01C091CC01811107C01111DA
:1045500005C0D11103C0CC2309F471C04F3F19F03D
:104560004F5F4093C701181624F40E948720809360
:10457000C9018091C90187FF05C00E9487208195EC
:104580008093C901111624F40E9487208093CA01E8
:104590008091CA0187FF05C00E9487208195809382
:1045A000CA016091C901662339F11091CA01112332
:1045B00019F1772767FD7095872F972F0E9426277F
:1045C00023E333E343E35FE30E948A270E94F32659
:1045D0006093C901612F772767FD7095872F972F0B
:1045E0000E94262723E333E343E35FE30E948A2705
:1045F0000E94F3266093CA011D1624F40E94CF2066
:104600008093CB018091CB0187FF05C00E94CF2012
:1046100081958093CB011C1624F40E94CF208093B7
:10462000CC018091CC0187FF05C00E94CF208195ED
:104630008093CC01DF91CF911F910C94F521DF91F4
:10464000CF911F910895E8ECF1E085E0DF011D9224
:104650008A95E9F71092C7011092C601089580E883
:1046600097E00E94EB051F9281E08F931F9285E0F7
:104670008F9382E397E09F938F930E9484060F901D
:104680000F900F900F900F900F9008958330E9F1E5
:1046900028F4813061F0823009F10895853009F401
:1046A00062C008F449C0863009F474C008952091AE
:1046B0001401862F90E0820F911D8F3F910520F409
:1046C000620F6093140103C08FEF809314018091F7
:1046D00014011F928F938BE696E072C02091130114
:1046E000862F90E0820F911D8F3F910520F4620F7D
:1046F0006093130103C08FEF809313018091130126
:104700001F928F9389E596E05BC020911201862F5E
:1047100090E0820F911D8F3F910520F4620F60930E
:10472000120103C08FEF80931201809112011F923A
:104730008F9386E496E044C020911101862F90E08B
:10474000820F911D8F3F910520F4620F609311013C
:1047500003C08FEF80931101809111011F928F93FD
:1047600081E396E02DC020911001862F90E0820F0A
:10477000911D8F3F910520F4620F6093100103C0DB
:104780008FEF80931001809110011F928F9388E129
:1047900096E016C020910F01862F90E0820F911DA8
:1047A0008F3F910520F4620F60930F0103C08FEFDC
:1047B00080930F0180910F011F928F938DEF95E0F1
:1047C0009F938F930E9484060F900F900F900F90ED
:1047D0000895833081F128F4813059F08230D1F08E
:1047E0000895853009F449C0B8F1863009F456C0FF
:1047F000089580911401681720F4861B809314019A
:1048000002C010921401809114011F928F938EEEBA
:1048100095E054C080911301681720F4861B8093A3
:10482000130102C010921301809113011F928F9304
:104830008CED95E043C080911201681720F4861B2F
:104840008093120102C010921201809112011F92F6
:104850008F9389EC95E032C080911101681720F4A4
:10486000861B8093110102C01092110180911101E9
:104870001F928F9384EB95E021C0809110016817FF
:1048800020F4861B8093100102C0109210018091C9
:1048900010011F928F938BE995E010C080910F015A
:1048A000681720F4861B80930F0102C010920F013D
:1048B00080910F011F928F9380E895E09F938F93D3
:1048C0000E9484060F900F900F900F900895CF9341
:1048D000C82F1F928F9325E838E03F932F930E94B3
:1048E000840661E070E080E090E004C0660F771F0E
:1048F000881F991FCA95D2F70E94E21C0F900F9053
:104900000F900F90CF910C94A118CF93873288F518
:104910008E3108F008C18E3009F486C0D8F4873093
:1049200009F460C08B3009F44FC0863009F0FFC035
:104930008091BE01817F8E7F8093BE018AE898E0DE
:104940000E94EB058EE29BE00E94EB0581E08093E4
:10495000CE0146C0863109F4ADC020F4803109F49F
:1049600078C0E5C0893109F48EC08B3109F449C0A3
:10497000DEC0883349F150F4893209F4D2C085335E
:1049800009F4CFC0873209F0D2C0CBC0833409F418
:10499000C8C028F48A3308F4CAC08953C5C0883413
:1049A00009F0C5C00E94A1188DE19BE00E94EB05B3
:1049B0002FEF83ED90E3215080409040E1F700C05D
:1049C00000000E94A51F0CC081EB98E03FC084E06E
:1049D0009BE00E94EB058091BE0181608093BE0147
:1049E000C1E0AAC08091BE01C82FC17080FFEFCF87
:1049F00080E19BE00E94EB058091BE01817F8E7F6C
:104A00003CC08091BE0181FBCC27C0F991E0C92751
:104A1000C0FB81F98093BE01CC2319F087EF9AE0A7
:104A200027C089EE9AE012C08091BE0182FBCC279C
:104A3000C0F991E0C927C0FB82F98093BE01CC2365
:104A400019F08AED9AE014C08AEC9AE00E94EB0516
:104A5000C7CF8091BE0183FBCC27C0F991E0C92765
:104A6000C0FB83F98093BE01CC2351F08EEB9AE01A
:104A70000E94EB058091BE0181608093BE015CC005
:104A800081EB9AE0E3CF82EA9AE00E94EB058FE7A0
:104A90009AE00E94EB058AE39AE00E94EB0583E12D
:104AA0009AE00E94EB058DED99E00E94EB058FEAFC
:104AB00099E0CCCF81EA99E00E94EB050E94F311C6
:104AC0001F928F9387E899E09F938F930E948406AB
:104AD00080910C011F928F9380E799E09F938F93B1
:104AE0000E94840680915B011F928F938DE599E06F
:104AF0009F938F930E9484060E944B1F9F938F93D6
:104B00007F936F9386E499E09F938F930E9484062E
:104B10008DB79EB742960FB6F8949EBF0FBE8DBF5D
:104B20005FCF80E001C08D510E94672459CF84E49B
:104B300099E00E94EB05C0E08C2FCF91089580E0B2
:104B4000089580E00895CF93C82F8091CE018130E1
:104B500069F020F0823009F446C03DC167E08FE083
:104B60000E947613882309F43CC106C067E08FE0F9
:104B70000E947613882349F08C2F0E949F25811173
:104B80002FC08C2F0E9485242CC08C2F0E94A12521
:104B9000811126C0C431E1F070F4CB3081F0C03116
:104BA000D1F40E942F238DE798E00E94EB0582E06C
:104BB0008093CE0115C0C93259F0C83361F48AE838
:104BC00098E00E94EB0581E898E00E94EB0508C0A0
:104BD0001092CE0104C18BE798E00E94EB05FFC064
:104BE00081E08170FEC0C43228F5CE3108F0C1C02A
:104BF000CB30A1F1D0F4C73009F0D3C08EE180935F
:104C0000140182E3809313018AE08093120184E10E
:104C10008093110188E08093100188E280930F0156
:104C200081E297E00E94EB05BFC0C33149F1C43176
:104C3000C1F0B7C0CB3409F4A9C028F4C93289F057
:104C4000C83361F0AEC0C13509F49EC0C23509F465
:104C500099C0CE3409F0A5C06AE09EC00E942F23FF
:104C6000A3C08091CD01882319F01092CD019CC082
:104C70008EE297E00E94EB0581E08093CE01B1C007
:104C800088E097E00E94EB0586EF96E00E94EB0536
:104C9000809114011F928F9383EF96E09F938F93DF
:104CA0000E94840681EF96E00E94EB058FED96E06E
:104CB0000E94EB05809113011F928F938CED96E07B
:104CC0009F938F930E9484068AED96E00E94EB05E5
:104CD0008BEC96E00E94EB05809112011F928F935E
:104CE00088EC96E09F938F930E94840686EC96E072
:104CF0000E94EB0585EB96E00E94EB058091110187
:104D00001F928F9382EB96E09F938F930E9484066D
:104D100080EB96E00E94EB058BE996E00E94EB05A4
:104D2000809110011F928F9388E996E09F938F9353
:104D30000E94840686E996E00E94EB058FE796E0E4
:104D40000E94EB0580910F011F928F938CE796E0F4
:104D50009F938F930E9484068AE796E00E94EB055A
:104D60008DB79EB748960FB6F8949EBF0FBE8DBF05
:104D70001BC0CE51EC2FF0E0E65DFE4F80818093AA
:104D8000CD0112C061E003C061E006C06AE080911D
:104D9000CD010E94462308C08091CD010E94E923E5
:104DA00003C08FE197E013C08091CD01882369F0A3
:104DB0001F928F9389E197E09F938F930E948406BF
:104DC0000F900F900F900F9004C086E197E00E9423
:104DD000EB0581E006C01092CE0180E002C080E0C9
:104DE00000CFCF91089504D06894B1118DC008957B
:104DF00070D088F09F5790F0B92F9927B751A0F045
:104E0000D1F0660F771F881F991F1AF0BA95C9F75E
:104E100012C0B13081F077D0B1E0089574C0672F2F
:104E2000782F8827B85F39F0B93FCCF3869577950E
:104E30006795B395D9F73EF49095809570956195F7
:104E40007F4F8F4F9F4F0895E89409C097FB3EF422
:104E500090958095709561957F4F8F4F9F4F9923C7
:104E6000A9F0F92F96E9BB279395F6958795779545
:104E70006795B795F111F8CFFAF4BB0F11F460FF05
:104E80001BC06F5F7F4F8F4F9F4F16C0882311F05D
:104E900096E911C0772321F09EE8872F762F05C071
:104EA000662371F096E8862F70E060E02AF09A950C
:104EB000660F771F881FDAF7880F9695879597F901
:104EC000089557FD9058440F551F59F05F3F71F0FA
:104ED0004795880F97FB991F61F09F3F79F0879561
:104EE0000895121613061406551FF2CF4695F1DFEA
:104EF00008C0161617061806991FF1CF869571057A
:104F0000610508940895E894BB2766277727CB01AD
:104F100097F908950BD078C069D028F06ED018F0BA
:104F2000952309F05AC05FC01124EECFCADFA0F369
:104F3000959FD1F3950F50E0551F629FF001729F2E
:104F4000BB27F00DB11D639FAA27F00DB11DAA1F4D
:104F5000649F6627B00DA11D661F829F2227B00D9A
:104F6000A11D621F739FB00DA11D621F839FA00D25
:104F7000611D221F749F3327A00D611D231F849F75
:104F8000600D211D822F762F6A2F11249F575040CC
:104F90008AF0E1F088234AF0EE0FFF1FBB1F661F67
:104FA000771F881F91505040A9F79E3F510570F020
:104FB00014C0AACF5F3FECF3983EDCF3869577955B
:104FC0006795B795F795E7959F5FC1F7FE2B880F1B
:104FD000911D9695879597F9089597F99F6780E8B1
:104FE00070E060E008959FEF80EC089500240A943B
:104FF0001616170618060906089500240A941216B4
:105000001306140605060895092E0394000C11F4E6
:10501000882352F0BB0F40F4BF2B11F460FF04C093
:105020006F5F7F4F8F4F9F4F0895991B79E004C0AA
:10503000991F961708F0961B881F7A95C9F78095D7
:10504000089597FB072E16F4009407D077FD09D03A
:105050000E943B2807FC05D03EF4909581959F4F18
:105060000895709561957F4F0895EE0FFF1F05908D
:10507000F491E02D0994AA1BBB1B51E107C0AA1FA4
:10508000BB1FA617B70710F0A61BB70B881F991FE9
:105090005A95A9F780959095BC01CD010895F89493
:0250A000FFCF40
:1050A200FFFF680A590B360B020BCF0A01B4012825
:1050B20008140A321E404D36229E0451041B04F984
:1050C2000385039E03B703D0030001020304050610
:0450D20007080900C2
:00000001FF
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Thu, 06 April 2017, 13:10:17
Hi All,

I'm following this handy little guide to convert the Apple Extended Keyboard II to USB:
http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/ (http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/)

I followed all of the instructions to the letter but I have a problem. The Teensy 2 powers on when plugged as does the Keyboard Num Lock, Caps Lock and Scroll Lock LEDs. The Teensy' LED is on constantly but flashes every 10 seconds. When it flashes the mouse pointer on the screen moves about an inch to the right.

I'm still a bit new to micro controllers and Hex Code so I can't debug the issue myself, to my eyes it seems all good. I've included the code used and my wiring.

Any advice is much appreciated!

Thanks!

http://imgur.com/a/omVjP (http://imgur.com/a/omVjP)

Code: [Select]
:100000000C9499050C94DD050C94DD050C94DD052C
:100010000C94DD050C94DD050C94DD050C94DD05D8
:100020000C94DD050C94DD050C94920F0C94641077
:100030000C940D1F0C94DD050C94DD050C94DD056E
:100040000C94DD050C94DD050C94DD050C94DD05A8
:100050000C94DD050C94801F0C94DD050C94DD05DB
:100060000C94DD050C94DD050C94DD050C94DD0588
:100070000C94DD050C94DD050C94DD050C94DD0578
:100080000C94DD050C94DD050C94DD050C94DD0568
:100090000C94DD050C94DD050C94DD050C94DD0558
:1000A0000C94DD050C94DD050C94DD05C910EB10F6
:1000B000D611EB10D6112D115011D611A511B81172
:1000C000B715B715E515E51541167D16801880188A
:1000D000951680188C178C175A18801880186E186F
:1000E00035A131A1041607090B0A1D1B0619640569
:1000F000141A08151C171E1F202123222E26242D1A
:1001000025273012182F0C13280F0D340E33C1364B
:10011000381110372B2CC02A5829E0E3E182E25035
:100120004F5152006C6365556D570053A9AAA854EE
:100130005800566D6E2E62595A5B5C5D5E5F6F6053
:10014000618987853E3F403C4142914490466B47E0
:10015000004365450048494A4B4C3D4D3B4E3AE50E
:10016000E6E40000AAA9A8090B0A1D1B06196405EC
:10017000141A08151C173A3B3C3D3F3E454240448B
:100180004143494718524648284B0D4F4A50C14DEC
:100190005111104E2B2CC04C5835E0E3E182E24A5D
:1001A0004D4E4B006CF565F66DF90053A9AAA8F504
:1001B000F600FA6D6EF4F4FBF1FCF2F1F3FA6FF075
:1001C000F98987853E3F403C4142914490466B47C8
:1001D000004365450048494A4B4C3D4D3B4E3AE58E
:1001E000E6E400006164625F686F73745F6B626471
:1001F0005F726563763A204552524F522825642932
:100200000A000A0025303458006164625F686F7329
:10021000745F6B62645F726563763A200045525288
:100220004F523A206D65646961206B6579300A0030
:100230004552524F523A206D65646961206B657971
:10024000310A005D0A0025640020002564007C005E
:100250002530325800200025303258006164625F3A
:100260006D6F757365207261773A205B000A002517
:1002700030313662006164625F686F73745F6D6F06
:100280007573655F726563763A20006465627567B1
:1002900020656E61626C65642E0A005363616E3A7C
:1002A00020616464723A25642C20726567333A25B4
:1002B0003034580A00416674657220696E69743A78
:1002C0000A00466F756E643A206D65646961206B43
:1002D0006579730A005363616E3A20616464723A0F
:1002E00025642C20726567333A253034580A004261
:1002F00065666F726520696E69743A0A004B6579AC
:10030000626F6172642073746172742E0A005553B7
:100310004220636F6E666967757265642E0A000D10
:100320000A696E69740A005B445D005B435D002EE0
:100330000341004400420020006B00650079006228
:10034000006F00610072006400200063006F006EA7
:100350000076006500720074006500720000000EF7
:100360000374002E006D002E006B002E00000004B0
:1003700003090409027400040100A032090400000A
:1003800001030101000921110100012240000705BC
:10039000810308000A090401000103010200092188
:1003A00011010001224D000705820308000A09041B
:1003B00002000103000000092111010001223600A2
:1003C0000705830308000A09040300020300000074
:1003D00009211101000122220007058403200001E8
:1003E000070504032000011201100100000008EDC0
:1003F000FEDB0A0101010200010631FF0974A101BF
:100400000975150026FF00952075088102097615EB
:100410000026FF00952075089102C005010980A102
:1004200001850216810026B7001A81002AB70075DF
:100430001095018100C0050C0901A1018503160179
:1004400000269C021A01002A9C0275109501810069
:10045000C005010902A1010901A10005091901292D
:10046000051500250195057501810295017503812A
:10047000010501093009311581257F950275088133
:100480000609381581257F950175088106050C0A36
:1004900038021581257F950175088106C0C00501C8
:1004A0000906A101050719E029E7150025019508AE
:1004B0007501810295017508810105081901290559
:1004C00095057501910295017503910105071900C4
:1004D00029FF150026FF00950675088100C0636F8F
:1004E0006E73756D65723A20253034580A00737941
:1004F0007374656D3A20253034580A000A0025309F
:10050000325820006B6579626F6172643A20004C4A
:1005100045443A20253032580A00253032583A20D6
:100520002530386225730A00722F63203031323350
:10053000343536370A00290A002575002F00257545
:10054000005D28002564002000256400200025644B
:100550000020002564007C0025303258006D6F7546
:1005600073656B6579205B62746E7C782079207688
:1005700020685D287265702F61636C293A205B00EA
:100580006D6B5F776865656C5F74696D655F746FCF
:100590005F6D6178203D2025640A006D6B5F776890
:1005A00065656C5F6D61785F7370656564203D2083
:1005B00025640A006D6B5F74696D655F746F5F6DB4
:1005C0006178203D2025640A006D6B5F6D61785F66
:1005D0007370656564203D2025640A006D6B5F695A
:1005E0006E74657276616C203D2025640A006D6B27
:1005F0005F64656C6179203D2025640A006D6B5F46
:10060000776865656C5F74696D655F746F5F6D6158
:1006100078203D2025640A006D6B5F776865656C06
:100620005F6D61785F7370656564203D2025640AA5
:10063000006D6B5F74696D655F746F5F6D617820CD
:100640003D2025640A006D6B5F6D61785F73706596
:100650006564203D2025640A006D6B5F696E7465DA
:100660007276616C203D2025640A006D6B5F6465C5
:100670006C6179203D2025640A000A00257500364A
:100680003A20776865656C5F74696D655F746F5F4C
:100690006D61783A20000A00257500353A207768A8
:1006A00065656C5F6D61785F73706565643A2000A5
:1006B0000A00257500343A2074696D655F746F5FB8
:1006C0006D61783A20000A00257500333A206D618B
:1006D000785F73706565643A20000A002575003202
:1006E0003A20696E74657276616C286D73293A20C0
:1006F000000A00257500313A2064656C6179282A6A
:1007000031306D73293A20000A092D2056616C752D
:100710006573202D0A004D3E004D25643E20003FAC
:10072000007365742064656661756C740A00433EED
:10073000200077686572652064656C74613A206397
:100740007572736F723D25642C20776865656C3D0A
:1007500025640A53656520687474703A2F2F656E9E
:100760002E77696B6970656469612E6F72672F7788
:10077000696B692F4D6F7573655F6B6579730A00DF
:100780000A092D204D6F7573656B6579202D0A451B
:1007900053432F713A09717569740A313A096465D6
:1007A0006C6179282A31306D73290A323A09696EF1
:1007B00074657276616C286D73290A333A096D612C
:1007C000785F73706565640A343A0974696D655FB2
:1007D000746F5F6D61780A353A09776865656C5F9B
:1007E0006D61785F73706565640A363A097768658C
:1007F000656C5F74696D655F746F5F6D61780A0A1F
:10080000703A097072696E742076616C7565730A4E
:10081000643A097365742064656661756C74730A63
:1008200075703A092B310A646F776E3A092D310AD7
:10083000706775703A092B31300A7067646F776E94
:100840003A092D31300A0A7370656564203D2064D1
:10085000656C7461202A206D61785F7370656564D2
:10086000202A2028726570656174202F2074696DBC
:10087000655F746F5F6D6178290A003F004D3E200F
:1008800000433E20004C25640A000A092D20436FD6
:100890006E736F6C65202D0A4553432F713A0971B1
:1008A0007569740A6D3A096D6F7573656B65790AC0
:1008B000000A092D204D61676963202D0A643A09F9
:1008C00064656275670A783A096465627567206DC8
:1008D00061747269780A6B3A096465627567206BA6
:1008E0006579626F6172640A6D3A09646562756761
:1008F000206D6F7573650A763A0976657273696F54
:100900006E0A733A097374617475730A633A096302
:100910006F6E736F6C65206D6F64650A302D343AAD
:10092000096C61796572302D34284631302D46349A
:10093000290A506175733A09626F6F746C6F616454
:1009400065720A003F0074696D65725F726561646B
:10095000333228293A202530346C580A006B6579E7
:10096000626F6172645F69646C653A2025580A00A1
:100970006B6579626F6172645F70726F746F636FC1
:100980006C3A2025580A00686F73745F6B65796252
:100990006F6172645F6C65647328293A2025580A78
:1009A000000A092D20537461747573202D0A0047C5
:1009B00043433A20342E382E31204156522D4C4993
:1009C00042433A20312E382E3073766E20415652F3
:1009D0005F415243483A20617672350A004F5054C5
:1009E000494F4E533A204C554641204D4F555345A3
:1009F0004B45592045585452414B455920434F4E81
:100A0000534F4C4520434F4D4D414E4420343039D7
:100A1000360A004255494C443A20346265666338D0
:100A200037202830303A30353A3233204170722046
:100A300020362032303137290A005649443A2030D6
:100A4000784645454428742E6D2E6B2E292050493A
:100A5000443A2030783041444228414442206B657A
:100A600079626F61726420636F6E7665727465720D
:100A700029205645523A203078303130310A00442E
:100A80004553433A20636F6E766572742041444249
:100A9000206B6579626F61726420746F20555342D8
:100AA0000A000A092D2056657273696F6E202D0A9F
:100AB000000A6D6F7573653A206F66660A000A6DED
:100AC0006F7573653A206F6E0A000A6B6579626F05
:100AD0006172643A206F66660A000A6B6579626F1C
:100AE0006172643A206F6E0A000A6D6174726978EF
:100AF0003A206F66660A000A6D61747269783A205E
:100B00006F6E0A000A64656275673A206F6E0A00AC
:100B10000A64656275673A206F66660A000A0A62AF
:100B20006F6F746C6F616465722E2E2E2000433ED1
:100B3000200011241FBECFEFDAE0DEBFCDBF04B628
:100B400003FE24C08091DC019091DD01A091DE01C3
:100B5000B091DF018730904BA740B04BB9F41092B1
:100B6000DC011092DD011092DE011092DF0114BE53
:100B700084B7877F84BF88E10FB6F89480936000C4
:100B8000109260000FBEE0E0F8E3099511E0A0E0EC
:100B9000B1E0E2EAF0E502C005900D92A433B1079E
:100BA000D9F721E0A4E3B1E001C01D92AC3DB2074A
:100BB000E1F70E94C50C0C944F280C940000FF93A1
:100BC000EF93E0913401F0913501309709F00995E8
:100BD000EF91FF910895FC018591803011F0EFDFD6
:100BE000FBCF0895FF27E0E230E247FF0CC04195BC
:100BF00097FF09C0EDE26095709580959095611D15
:100C0000711D811D911D27FF02C0219530E350E227
:100C1000AA27660F771F881F991FAA1FA41710F015
:100C2000A41B63955A95A9F7AA3008F0A95FA05DA7
:100C3000AF93F395611571058105910541F7ED328B
:100C400011F4EF93F395F21718F43F93F395FBCF5C
:100C50008F91B5DFFA95E1F70895E991F9918591C2
:100C6000803021F0853219F0AADFF9CF089520E015
:100C7000E89455915532C1F3503311F4689455916D
:100C80005A3348F4505390F3220F022E220F220FB2
:100C9000200D250FF4CF0EF42195899199915336AB
:100CA00019F3533729F1533559F1BC018827992796
:100CB000E8945C3621F48991999168945591543661
:100CC00039F446EF7EF077FF0DC08FEF9FEF0AC03B
:100CD00055374AE039F0583540E121F0523642E0CC
:100CE00009F00895FF93EF937DDFEF91FF91B7CF68
:100CF000FF93EF93FC0181918030B9F360DFFBCF6C
:100D0000FF93EF9368DFF1CFDF93CF93CDB7DEB7DB
:100D10002596A3DFCF91DF910895282F2770E82F24
:100D2000E695E695E695EF70F0E0E95CFE4F87FF0B
:100D30000CC081E090E0022E01C0880F0A94EAF70F
:100D40008095908189238083089581E090E0022E30
:100D500001C0880F0A94EAF79081982B9083089538
:100D60000F931F93CF93DF93569A5E9A0E949E092A
:100D70002FEF87EA91E6215080409040E1F700C0D4
:100D800000008FEE92E09F938F930E9484060F9055
:100D90000F90C1E0D0E005ED12E063E08C2F0E94DF
:100DA000A209009771F09F938F93DF93CF931F93C6
:100DB0000F930E9484060F900F900F900F900F904A
:100DC0000F909FEF29EF80E0915020408040E1F7A5
:100DD00000C000002196C031D105F9F663E082E041
:100DE0000E94A20999278131910511F174F487308D
:100DF0009105F1F024F404970297F0F419C08930BA
:100E00009105B1F00D97C1F413C08D31910581F0BA
:100E100034F48431910561F0499771F409C0843C40
:100E2000910531F0873C910519F0813C910521F441
:100E300081E080934C0102C010924C0163E087E096
:100E40000E94A20991E0823009F090E090934D0158
:100E5000992341F082EC92E09F938F930E94840645
:100E60000F900F9023E042E063E082E00E94270AA7
:100E700085EB92E09F938F930E9484060F900F90D2
:100E8000C1E0D0E00BE912E063E08C2F0E94A209E0
:100E9000009771F09F938F93DF93CF931F930F93DE
:100EA0000E9484060F900F900F900F900F900F905C
:100EB0008FEF99EF20E0815090402040E1F700C093
:100EC00000002196C031D105F9F6E7E3F1E0119277
:100ED00081E0E734F807D9F70E94F3110E94440932
:100EE0008091BE0181608093BE018BE892E00E94F8
:100EF000EB05569A5E98DF91CF911F910F9108955F
:100F0000CF93DF938FE79BEB0197F1F700C00000D1
:100F10000E94230AEC01009711F481E0C4C097FD00
:100F200005C080914701816080934701D7FF05C0CC
:100F3000809147018E7F809347018D2F99278F7372
:100F40009927AE014F735527C6FF02C0405451097F
:100F5000D6FF02C08054910960913601772767FD62
:100F60007095469F9001479F300D569F300D11247C
:100F700021384FEF340714F421E83FEF31952195E4
:100F8000310921384FEF340714F421E83FEF219560
:100F900020934801869F9001879F300D969F300DCA
:100FA000112421388FEF380714F421E83FEF882708
:100FB0009927821B930B81382FEF920714F481E855
:100FC0009FEF8195809349018091BE0183FF60C0AE
:100FD00085E792E00E94EB05DF93CF938FE692E0E6
:100FE0009F938F930E9484068DE692E00E94EB050A
:100FF0008CE592E00E94EB0520913601822F992723
:1010000087FD90959F932F9387E592E09F938F9311
:101010000E94840685E592E00E94EB0580914701DD
:101020001F928F9380E592E09F938F930E94840696
:101030008EE492E00E94EB0520914801822F9927CF
:1010400087FD90959F932F938BE492E09F938F93CE
:101050000E94840689E492E00E94EB0520914901F8
:10106000822F992787FD90959F932F9386E492E096
:101070009F938F930E94840683E492E00E94EB0585
:101080008DB79EB744960FB6F8949EBF0FBE8DBF26
:1010900087E491E00E9444128091360191E088300B
:1010A0000CF090E0890F80933601DF91CF91089585
:1010B0001F93CF93DF93C0910001D09101018FEF77
:1010C0009FEF9093010180930001CF3F8FEFD807EE
:1010D00009F06AC08FE79BEB0197F1F700C00000B1
:1010E00082E00E94200AEC01009709F05DC0809127
:1010F0004D01882309F458C087E00E94200A009718
:1011000009F452C09C012F77332722303105A1F01A
:1011100048F42115310569F02130310599F48078C2
:101120008A641AC02330310551F02F373105A1F000
:1011300009C08078826410C0807889640DC080788E
:1011400088640AC080E392E09F938F930E94840694
:101150000F900F9081E18EC0292F33272F773327EF
:101160002130310579F050F02230310579F023300B
:10117000310581F4EC01D078D86416C0EC01D07848
:10118000D26412C0EC01D078DA640EC0EC01D078E1
:10119000D9640AC08DE192E09F938F930E948406E8
:1011A0000F900F9080E166C08091BE0181FF18C052
:1011B000209709F45CC089E092E00E94EB05DF9380
:1011C000CF9384E092E09F938F930E94840682E005
:1011D00092E00E94EB050F900F900F900F9003C0CC
:1011E000209709F444C0CF379FE7D90711F48FE760
:1011F00005C0CF3F8FEFD80721F48FEF0E948D06F7
:1012000038C02D2F3327822F1C2F2F3F81F4DF93DF
:10121000CF9384EE91E09F938F930E9484060E9467
:10122000B0060F900F900F900F908C2F23C09091CD
:101230004C01992381F0A9014F775527423351057D
:1012400021F4822F80788A6006C04A30510519F453
:10125000822F807882630E948D061F3F51F0DC2F21
:10126000CC27CF6FD0930101C093000102C080E072
:1012700001C081E0DF91CF911F910895E82FF0E048
:10128000E95CFE4F80810895682F609582E00C94A0
:10129000620A509A83E091E00197F1F700C00000E4
:1012A00050989AEB9A95F1F700C00895509A8AEBFE
:1012B0008A95F1F700C0509883E091E00197F1F72B
:1012C00000C000000895EF92FF920F931F93CF93F9
:1012D000DF93C0E0D0E000E810E0E82EF12C9801A8
:1012E0000C2E02C0359527950A94E2F72E213F2156
:1012F000232B19F00E94560902C00E944909219629
:10130000C830D10561F7DF91CF911F910F91FF9008
:10131000EF900895489B07C023E02A95F1F700005D
:1013200001970097B9F70895489907C023E02A95D7
:10133000F1F7000001970097B9F708955898509871
:1013400008950895CF92DF92EF92FF920F931F932B
:10135000CF93DF931F92CDB7DEB7182FF894509A32
:1013600083EF9BE00197F1F700C0000069830E94C2
:10137000560969816C60E0E11E9FC0011124862B33
:101380000E9463090E94490984EF91E00E94940938
:10139000892B21F4789482EE9FEF48C084EF91E08E
:1013A0000E948A09892B21F4789480E090E03EC065
:1013B00021E1F22EC12CD12C32E8E32E82E890E01C
:1013C0000E9494098C01882359F199270E948A0967
:1013D000882331F1CC0CDD1C9E2D901B081B90172F
:1013E00018F46894C0F807C0F1E1FF1204C07894C3
:1013F0008CEE9FEF1BC0FA9409F78FE591E00E94F5
:101400009409892B21F478948BEE9FEF0FC08BE524
:1014100090E00E948A09892BB1F77894C60106C032
:1014200078948F2D90E09195819591090F90DF919F
:10143000CF911F910F91FF90EF90DF90CF90089583
:1014400060E00C94A20960E083E00C94A2091F9371
:10145000CF93DF9300D01F92CDB7DEB7182FF8944B
:10146000509A83EF9BE00197F1F700C000002B83B7
:101470004A8369830E9456096981862F886090E1BA
:10148000199FF00111248E2B0E9463090E944909C3
:10149000EFE1F3E03197F1F700C000000E94560938
:1014A0004A81842F0E9463092B81822F0E94630945
:1014B0000E94490978940F900F900F90DF91CF917F
:1014C0001F910895262F277040E062E00C94270AB0
:1014D00080915A0108959FB7F894109251019FBFCF
:1014E0009091D301943009F058C09091E9009F7019
:1014F0002091EC0020FF02C020E801C020E0292B51
:1015000094E09093E9009091EB0090FF43C090919C
:10151000EE0097FF3FC090914E01992321F09091EA
:10152000E80095FF37C010924E0196E03091E80038
:1015300035FD15C03091D301343061F53091EB00A9
:1015400035FD28C0915021F481E080934E0122C0E6
:10155000EFE9FFE03197F1F700C00000E7CF80939B
:10156000F1008091E80085FD0AC08091E80080FFCD
:10157000FCCF8091E8008E778093E80006C08FB79B
:10158000F89491E0909351018FBF2F702093E90060
:1015900080E008952F702093E9008FEF0895CF9396
:1015A000DF9300D01F92CDB7DEB72091D301243056
:1015B00019F523E029839B838A832093E9008FEF29
:1015C0009091E800815095FD06C095ED9A95F1F750
:1015D00000008111F5CF8091E80085FF0DC040E04B
:1015E00050E063E070E0CE0101960E94850D80918D
:1015F000E8008E778093E8000F900F900F90DF91B6
:10160000CF910895CF93DF9300D01F92CDB7DEB76F
:101610002091D301243021F522E029839B838A8302
:1016200083E08093E9008FEF9091E800815095FD71
:1016300006C095ED9A95F1F700008111F5CF8091E4
:10164000E80085FF0DC040E050E063E070E0CE01AF
:1016500001960E94850D8091E8008E778093E800C6
:101660000F900F900F90DF91CF9108952091D301AB
:101670002430F1F422E02093E9002FEF3091E800CC
:10168000215035FD06C035ED3A95F1F700002111E6
:10169000F5CF2091E80025FF0BC040E050E065E069
:1016A00070E00E94850D8091E8008E778093E800BD
:1016B0000895CF93DF93EC018091D301843039F505
:1016C00081E08093E9008FEF9091E800815095FDD3
:1016D00006C095ED9A95F1F700008111F5CF809144
:1016E000E80085FF14C040E050E068E070E0CE0103
:1016F0000E94850D8091E8008E778093E80088E055
:10170000FE01A2E5B1E001900D928A95E1F7DF912B
:10171000CF9108958BE293E00E94EB058091D20176
:10172000811109C00E94170F0E94740F8091E2007E
:1017300084608093E200089587E293E00E94EB05C5
:101740001092D2010895089580914F018F5F809388
:101750004F0162E30E941528911135C010924F018C
:1017600080915101882379F18091D301843049F52A
:101770008091E9008F709091EC0090FF02C090E89A
:1017800001C090E0982B84E08093E9008091EB0009
:1017900080FF14C08091EE0087FF10C08091E800A8
:1017A00085FF03C01092F100F9CF8091E80080FF1F
:1017B00005C08091E8008E778093E8009F70909339
:1017C000E90010925101089542E061EC81E00E942D
:1017D000910E42E061EC82E00E94910E42E061ECE9
:1017E00083E00E94910E42E261EC84E00C94910E41
:1017F0008091D501833009F453C030F4813071F009
:10180000823009F48CC008958A3009F478C08B3096
:1018100009F45EC0893009F09AC020C08091D401DB
:10182000813A09F094C08091E800877F8093E800B6
:101830008091D8019091D901892B21F060E080E05E
:1018400090E003C068E082E591E070E00E94CE0D78
:101850008091E8008B778093E80008958091D4010F
:10186000813209F074C08091D8019091D901892BFF
:1018700009F06DC08091E800877F8093E800809137
:10188000E80082FD05C08091D3018111F8CF5FC0CF
:101890008091F10080935A018091E8008B7753C0CA
:1018A0008091D401813A09F052C08091D801909181
:1018B000D901892B09F04BC08091E800877F809384
:1018C000E8008091E80080FFFCCF80910C0136C0D9
:1018D0008091D4018132D9F58091D8019091D901BC
:1018E000892BA9F58091E800877F8093E8000E940A
:1018F000C60E8091D60180930C010C94A1188091A2
:10190000D401813221F58091E800877F8093E8003F
:101910000E94C60E8091D70180935B01089580914B
:10192000D401813AA1F48091E800877F8093E80098
:101930008091E80080FFFCCF80915B018093F100F3
:101940008091E8008E778093E8000C94C60E08958D
:101950000895089580915A018093500110925A0180
:1019600080E00E9444090E9474130C94A1180C9406
:10197000AA0C0E94CE1E8091D101882329F00E94DA
:10198000F41E81110C946F0D089584B7877F84BF76
:1019900088E10FB6F89480936000109260000FBE4B
:1019A00090E080E80FB6F894809361009093610016
:1019B0000FBE8BE69AE00E94A31E8FE193E00E9487
:1019C000EB050E94A80C0E94AB120E94170F0E9408
:1019D000740F8091E20084608093E200789480919B
:1019E000D3018430E1F78EE093E00E94EB050E9482
:1019F000AD1282E091E00E94EE118DEF92E00E9424
:101A0000EB050E94A90C8091D301853019F40E9446
:101A1000B90CF9CF0E94B312F6CF0E94091F809132
:101A2000500180935A0108950C940D0D292F3327EE
:101A300023303105A9F06CF42130310509F442C09E
:101A40002230310509F043C084E790E023E733E01A
:101A500042C021323105C9F02232310519F137C0B7
:101A600099278130910541F08230910541F0892B11
:101A700071F5EFE6F3E005C0EFE5F3E002C0EFE259
:101A8000F3E0849190E09F0126C0643000F5E62FDA
:101A9000F0E0EE0FFF1FEF5DFE4F2081318189E006
:101AA00090E019C0643098F4E62FF0E0DF01AA0F4F
:101AB000BB1FA75EBE4F2D913C91EB5EFE4F808118
:101AC00090E009C082E190E027EE33E004C080E0BE
:101AD00090E020E030E0FA0131832083089580E136
:101AE00089BD82E189BD09B400FEFDCF8091D80097
:101AF0008F7D8093D8008091E00082608093E00029
:101B00008091E00081FDFCCF0895CF92DF92EF92AB
:101B1000FF920F931F93CF93DF937C018B01EA0118
:101B20000E94E70E811131C0209731F088819981A0
:101B3000081B190BE80EF91EC12CD12C011511053B
:101B400019F18091E80085FD14C08091E8008E773E
:101B50008093E800209741F0888199818C0D9D1D2C
:101B60009983888385E011C00E94E70E882331F3B2
:101B70000CC0F70181917F018093F10001501109A0
:101B8000FFEFCF1ADF0ADACF80E0DF91CF911F910C
:101B90000F91FF90EF90DF90CF9008952091DA01A0
:101BA0003091DB012617370748F06115710539F4CC
:101BB0002091E8002E772093E80001C0B901FC01D4
:101BC00020E061157105B9F18091D301882309F4F2
:101BD00040C0853009F43FC08091E80083FD3DC0DE
:101BE0008091E80082FF06C08091E80082FF26C055
:101BF00080E008958091E80080FFE3CF2091F3001A
:101C00008091F20090E0922B6115710551F08830BF
:101C1000910538F421912093F100615071090196EA
:101C2000F3CF21E0089709F020E08091E8008E775B
:101C30008093E800C6CF2111C7CFD6CF8091D301C2
:101C4000882339F0853039F08091E80083FFCCCFCC
:101C500004C082E0089583E0089581E00895209112
:101C6000DA013091DB012617370748F0611571055D
:101C700039F42091E8002E772093E80001C0B901E3
:101C8000FC0120E061157105C1F18091D301882329
:101C900009F441C0853009F440C08091E80083FD1B
:101CA0003EC08091E80082FF06C08091E80082FF7C
:101CB00027C080E008958091E80080FFE3CF209165
:101CC000F3008091F20090E0922B6115710559F0BC
:101CD0008830910540F424912093F10031966150B1
:101CE00071090196F2CF21E0089709F020E0809178
:101CF000E8008E778093E800C5CF2111C6CFD5CFFD
:101D00008091D301882339F0853039F08091E80043
:101D100083FFCBCF04C082E0089583E0089581E083
:101D20000895982F973058F59093E900981739F057
:101D30007091EC002091ED005091F00003C0242F31
:101D4000762F50E021FF19C03091EB003E7F309399
:101D5000EB003091ED003D7F3093ED003091EB00D2
:101D600031603093EB007093EC002093ED005093C2
:101D7000F0002091EE0027FF07C09F5FD3CF8F7048
:101D80008093E90081E0089580E008958091D40176
:101D900087FD05C08091E80080FF0EC012C08091D1
:101DA000E80082FD05C08091D3018111F8CF08952C
:101DB0008091E8008B7708C08091D3018111EACF30
:101DC00008958091E8008E778093E80008958091CF
:101DD000E4009091E50045E62091EC0020FF21C051
:101DE0002091E80020FD21C02091D301222389F019
:101DF000253089F02091EB0025FD0FC02091E400F3
:101E00003091E5002817390739F3415041F0C901F5
:101E1000E3CF82E0089583E0089581E0089584E0AF
:101E200008952091E80022FFDFCF80E008950E940E
:101E3000850F0E948D0FE0EEF0E08081816080834D
:101E4000E8EDF0E080818F77808319BCA7EDB0E0EA
:101E50008C918E7F8C9380818F7E80831092D201B3
:101E600008950F931F93CF93DF930E94850F0E94D5
:101E70008D0FC8EDD0E088818F7788838881806856
:101E8000888388818F7D888319BC1092D30110923A
:101E9000CF011092D1011092D00100EE10E0F801B4
:101EA00080818B7F808388818160888342E060E0CD
:101EB00080E00E94910EE1EEF0E080818E7F8083D1
:101EC000E2EEF0E0808181608083808188608083A1
:101ED000F80180818E7F8083888180618883DF9193
:101EE000CF911F910F910895E8EDF0E080818F7EF2
:101EF0008083E7EDF0E080818160808384E082BFB1
:101F000081E08093D2010C94310FE8EDF0E0808104
:101F10008E7F80831092E20008951092DA00109272
:101F2000E10008951F920F920FB60F9211242F9384
:101F30003F934F935F936F937F938F939F93AF9351
:101F4000BF93EF93FF938091E10082FF0BC08091DC
:101F5000E20082FF07C08091E1008B7F8093E10067
:101F60000E94A40B8091DA0080FF1FC08091D800EE
:101F700080FF1BC08091DA008E7F8093DA00809111
:101F8000D90080FF0DC080E189BD82E189BD09B41F
:101F900000FEFDCF81E08093D3010E948A0B05C033
:101FA00019BC1092D3010E949C0B8091E10080FF2C
:101FB00019C08091E20080FF15C08091E2008E7F01
:101FC0008093E2008091E20080618093E200809142
:101FD000D80080628093D80019BC85E08093D3013B
:101FE0000E94B70C8091E10084FF30C08091E20034
:101FF00084FF2CC080E189BD82E189BD09B400FE67
:10200000FDCF8091D8008F7D8093D8008091E10032
:102010008F7E8093E1008091E2008F7E8093E200CA
:102020008091E20081608093E2008091CF0188235B
:1020300011F084E007C08091E30087FF02C083E0D5
:1020400001C081E08093D3010E94140D8091E100D2
:1020500083FF29C08091E20083FF25C08091E100C9
:10206000877F8093E10082E08093D3011092CF01BB
:102070008091E1008E7F8093E1008091E2008E7F6D
:102080008093E2008091E20080618093E20042E070
:1020900060E080E00E94910E8091F0008860809363
:1020A000F0000E94A30BFF91EF91BF91AF919F9120
:1020B0008F917F916F915F914F913F912F910F90F1
:1020C0000FBE0F901F9018951F920F920FB60F9290
:1020D00011242F933F934F935F936F937F938F932D
:1020E0009F93AF93BF93CF93EF93FF93C091E9007A
:1020F000CF708091EC001092E9008091F000877F12
:102100008093F00078940E94A0101092E9008091D2
:10211000F00088608093F000C093E900FF91EF9198
:10212000CF91BF91AF919F918F917F916F915F916F
:102130004F913F912F910F900FBE0F901F901895C8
:102140001F93CF93DF93CDB7DEB7AA970FB6F8945E
:10215000DEBF0FBECDBFE4EDF1E08091F1008193D1
:1021600021E0EC3DF207C9F70E94F80B8091E800EE
:1021700083FF1CC12091D4013091D501832F90E0C1
:102180008A30910508F012C1FC01EA5AFF4F0C9405
:102190003528203881F0223809F008C18091D80113
:1021A0008F708093E9008091EB0085FB882780F990
:1021B0001092E90006C08091D0019091D101911157
:1021C00082609091E800977F9093E8008093F100FF
:1021D0001092F100C5C0822F8D7F09F0E7C0222345
:1021E00019F0223061F0E2C08091D601813009F00F
:1021F000DDC0333009F080E08093D10128C08091A8
:10220000D601811124C02091D8012F7009F4CEC0CD
:102210002093E9008091EB0080FF19C08091EB00D2
:10222000333011F4806211C080618093EB0081E053
:1022300090E0022E01C0880F0A94EAF78093EA002A
:102240001092EA008091EB0088608093EB0010927E
:10225000E9008091E800877F86C02111A7C0109116
:10226000D6011F778091E3008078812B8093E30073
:102270008091E800877F8093E8000E94C60E8091DD
:10228000E80080FFFCCF8091E30080688093E3004A
:10229000112311F083E001C082E08093D30186C056
:1022A0002058223008F082C08091D6019091D70149
:1022B0008C3D23E0920779F583E08A838AE2898363
:1022C0004FB7F894DE01139620E03EE051E2E32F91
:1022D000F0E050935700E49120FF03C0E295EF70C7
:1022E0003F5FEF708E2F90E0EA3010F0C79601C08C
:1022F000C0968D939D932F5F243149F74FBF8091F6
:10230000E800877F8093E8006AE270E0CE010196E2
:102310000E94CE0D14C0AE014F5F5F4F6091D80197
:102320000E94160D009709F441C02091E800277F14
:102330002093E800BC0189819A810E942F0E809130
:10234000E8008B778093E80031C0203879F58091E0
:10235000E800877F8093E8008091CF018093F100AF
:102360008091E8008E778093E8000E94C60E1EC020
:1023700021111CC09091D6019230C0F48091E800E8
:10238000877F8093E8009093CF010E94C60E8091D2
:10239000CF01811104C08091E30087FF02C084E077
:1023A00001C081E08093D3010E94E40B8091E8009A
:1023B00083FF0AC08091E800877F8093E8008091C6
:1023C000EB0080628093EB00AA960FB6F894DEBF14
:1023D0000FBECDBFDF91CF911F9108959093610102
:1023E000809360010895E0916001F0916101309760
:1023F00021F00190F081E02D099480E00895FF9292
:102400000F931F93CF93DF938C01E0916001F091C4
:102410006101309799F10280F381E02D0995809157
:10242000BE0182FF2BC080FF04C084E095E00E94C3
:10243000EB05E80188E0F82E0EEF14E08091BE0174
:1024400080FF0BC088811F928F931F930F930E9470
:1024500084060F900F900F900F90FA942196F11030
:10246000EDCF8091BE0180FF09C08CEF94E0DF9139
:10247000CF911F910F91FF900C94EB05DF91CF91BD
:102480001F910F91FF900895E0916001F09161011B
:10249000309721F00480F581E02D09940895CF93C1
:1024A000DF93EC0180915E0190915F01C817D9071D
:1024B00009F1D0935F01C0935E01E0916001F0915A
:1024C00061013097B9F00680F781E02DCE010995C2
:1024D0008091BE0182FF0EC080FF0CC0DF93CF93BE
:1024E0008EEE94E09F938F930E9484060F900F903E
:1024F0000F900F90DF91CF910895CF93DF93EC0170
:1025000080915C0190915D01C817D90709F1D093C2
:102510005D01C0935C01E0916001F0916101309731
:10252000B9F00084F185E02DCE0109958091BE01BE
:1025300082FF0EC080FF0CC0DF93CF938EED94E03E
:102540009F938F930E9484060F900F900F900F908F
:10255000DF91CF9108950C9475130E94361F0E944D
:10256000B0060C94A109CF92DF92EF92FF920F93E5
:102570001F93CF93DF9300D000D000D0CDB7DEB74C
:102580000E94580833E6E32E31E0F32E00E010E01D
:10259000C02E802F0E943E09F701D1907F01D826DE
:1025A000B1F40F5F1F4F0031110591F78FEF898351
:1025B0008A831B820E943F1F8160782F9D838C83BA
:1025C00049815A816B818D810E94C81348C09091C6
:1025D000BE0191FF04C08E830E9492138E8120E081
:1025E00030E04D2D50E0922FBA01022E02C07595B9
:1025F00067950A94E2F760FF2CC02983CA82EE2413
:10260000E394F12C02C0EE0CFF1C9A95E2F790E0E7
:102610008E219F2121E0892B09F420E02B830E9449
:102620003F1F8160782F9D838C8349815A816B8104
:102630008D810E94C81349815A816B817C818D8173
:102640000E94BB1EF801ED59FE4F80818E258083CC
:1026500006C02F5F3F4F2830310529F6A2CF0E94D8
:10266000BA1E0E9482220E948007109162010E947D
:10267000F311181741F10E94F311809362019091B8
:10268000BE0192FF0EC090FF0CC01F928F938FE08F
:1026900095E09F938F930E9484060F900F900F9068
:1026A0000F908091620126960FB6F894DEBF0FBEA0
:1026B000CDBFDF91CF911F910F91FF90EF90DF90F1
:1026C000CF900C94CC1E26960FB6F894DEBF0FBEAA
:1026D000CDBFDF91CF911F910F91FF90EF90DF90D1
:1026E000CF9008950C94440908950895CF93DF93F3
:1026F0001F92CDB7DEB769830E943E09282F30E0D4
:1027000081E090E0698102C0880F991F6A95E2F725
:102710002823392381E0232B09F480E00F90DF91F7
:10272000CF910895EF92FF920F931F93CF93DF9372
:1027300088E295E00E94EB05C0E0D0E089E2E82E57
:1027400081E0F82E0AE115E08C2F0E943E090E94DC
:10275000A81EFF92EF921F928F93DF93CF931F9348
:102760000F930E94840621968DB79EB708960FB6E8
:10277000F8949EBF0FBE8DBFC031D10529F7DF9100
:10278000CF911F910F91FF90EF90089508950895B4
:10279000CF93DF93CDB7DEB72B970FB6F894DEBF9C
:1027A0000FBECDBF4F83588769877A878B878A850D
:1027B0009B85892B31F05F3F11F080E003C04F3FD4
:1027C000E1F781E0811107C04F81588569857A85DD
:1027D0008B850E94BB1EDE01119686E0FD011192E1
:1027E0008A95E9F785E0FE01379601900D928A956A
:1027F000E1F749815A816B817C818D819E810E94A4
:102800007F1B2B960FB6F894DEBF0FBECDBFDF91B6
:10281000CF910895CF93C82F882309F4E7C0823859
:10282000A1F40E94F31181FDE1C089E30E94FC1D27
:102830000E947D1E2FEF81EE94E021508040904059
:10284000E1F700C0000089E315C08338C1F40E949D
:10285000F31180FDCBC083E50E94FC1D0E947D1E0C
:102860002FEF81EE94E0215080409040E1F700C0CE
:10287000000083E50E941D1ECF910C947D1E8438BC
:10288000A1F40E94F31182FDB1C087E40E94FC1DF7
:102890000E947D1E2FEF81EE94E0215080409040F9
:1028A000E1F700C0000087E4E5CF8CEF8C0F813AA0
:1028B00048F48C2F0E94A325811198C08C2F0E9470
:1028C000FC1DDACF80E28C0F883048F4C77081E0BD
:1028D00001C0880FCA95EAF70E94411ECDCF8BE553
:1028E0008C0F833078F4C53A29F0C63A31F482E887
:1028F00090E005C081E890E002C083E890E0CF91CD
:102900000C944F1288E58C0F853108F06FC0C83ADF
:1029100061F1C93A69F1CA3A71F1CB3A79F1CC3A2D
:1029200081F1CD3A89F1CE3A91F1CF3A99F1C13B9B
:10293000A1F1C03BA9F1C23BB1F1C33BB9F1C43B2A
:10294000C1F1C53BC9F1C63BD1F1C73BD9F1C83B89
:10295000E1F1C93BE9F1CA3BF1F1CB3BF9F1CC3BE9
:1029600009F03FC08AE292E03EC082EE90E03BC0B8
:1029700089EE90E038C08AEE90E035C085EB90E0BB
:1029800032C086EB90E02FC083EB90E02CC084EB4C
:1029900090E029C087EB90E026C08CEC90E023C04B
:1029A0008DEC90E020C083E891E01DC08AE891E0C2
:1029B0001AC082E991E017C084E991E014C081E275
:1029C00092E011C083E292E00EC084E292E00BC07C
:1029D00085E292E008C086E292E005C087E292E0DC
:1029E00002C080E090E0CF910C947D12CF910895C9
:1029F000882309F466C08238A1F40E94F31181FF94
:102A000060C089E30E94FC1D0E947D1E2FEF81EEB5
:102A100094E0215080409040E1F700C0000089E33D
:102A200015C08338B9F40E94F31180FF4AC083E5D2
:102A30000E94FC1D0E947D1E2FEF81EE94E021502C
:102A400080409040E1F700C0000083E50E941D1E19
:102A50000C947D1E8438A1F40E94F31182FF31C0D2
:102A600087E40E94FC1D0E947D1E2FEF81EE94E002
:102A7000215080409040E1F700C0000087E4E6CF9D
:102A80009CEF980F913A10F390E2980F983050F421
:102A9000877091E001C0990F8A95EAF7892F0E940B
:102AA000471ED6CF9BE5980F933020F480E090E04E
:102AB0000C944F12885A853120F480E090E00C94F9
:102AC0007D120895882321F00E94411E0C947D1EE2
:102AD0000895882321F00E94471E0C947D1E0895BE
:102AE000CF92DF92EF92FF920F931F93CF93DF93DA
:102AF000CDB7DEB728970FB6F894DEBF0FBECDBFB7
:102B00008C0185E0F801DE01119601900D928A9505
:102B1000E1F7F80140813181F280258122952F7003
:102B200083819481892B31F03F3F31F481E04F3F25
:102B300019F403C081E001C080E080FDE1C2498357
:102B40003A8389819A812F830E94BA1D9E83888748
:102B50000E94B91D0E94E11C4E81E42FE295EF70A6
:102B6000F0E0E05AFF4F2F8168850C943528842FC0
:102B7000807F142F1F70882311F01295107FFF2083
:102B800059F0112309F471C2812F68870E94541EE5
:102B90000E947D1E688569C2862F0E94F814112349
:102BA00009F4AEC2812F0E945A1E28960FB6F894DF
:102BB000DEBF0FBECDBFDF91CF911F910F91FF9070
:102BC000EF90DF90CF900C947D1E842F807F942F08
:102BD0009F70E92E803219F0E29480EFE82266239C
:102BE00019F0613001F129C0FF20A9F08E2D2223B8
:102BF00049F1213039F528960FB6F894DEBF0FBEA3
:102C0000CDBFDF91CF911F910F91FF90EF90DF909B
:102C1000CF900C94641E222319F0213009F470C265
:102C20000E94671E2CC0FF20E9F0263008F068C221
:102C30000E943E1E8E2129F022C0FF20F1F02111BA
:102C400015C08E2D28960FB6F894DEBF0FBECDBFEF
:102C5000DF91CF911F910F91FF90EF90DF90CF9078
:102C60000C946215253008F04BC209C0F80185812B
:102C700080FFFBC18F708583E4CF21110AC28E2DA6
:102C800078C1242F26952695237030E02115310533
:102C900021F021303105C9F033C2FF2021F0862F09
:102CA000942F937002C080E090E028960FB6F894BD
:102CB000DEBF0FBECDBFDF91CF911F910F91FF906F
:102CC000EF90DF90CF900C944F12FF2021F0862FD1
:102CD000942F937002C080E090E028960FB6F8948D
:102CE000DEBF0FBECDBFDF91CF911F910F91FF903F
:102CF000EF90DF90CF900C947D12862FFF2019F07B
:102D00000E94082102C00E94702128960FB6F894F4
:102D1000DEBF0FBECDBFDF91CF911F910F91FF900E
:102D2000EF90DF90CF900C94F521842F837009F001
:102D300076C0F110E5C1262F229526952770220F27
:102D4000220F862F8F70C82ED12CE12CF12C022E51
:102D500004C0CC0CDD1CEE1CFF1C0A94D2F764FFEF
:102D600010C06FE070E080E090E004C0660F771F55
:102D7000881F991F2A95D2F7609570958095909538
:102D800003C060E070E0CB01242F269526952370C8
:102D9000422F50E042305105D1F04330510559F1F6
:102DA0006C297D298E299F294130510541F12896B2
:102DB0000FB6F894DEBF0FBECDBFDF91CF911F914C
:102DC0000F91FF90EF90DF90CF900C94F61C6C2940
:102DD0007D298E299F2928960FB6F894DEBF0FBE55
:102DE000CDBFDF91CF911F910F91FF90EF90DF90BA
:102DF000CF900C94081D0E94F61CC701B6012896BE
:102E00000FB6F894DEBF0FBECDBFDF91CF911F91FB
:102E10000F91FF90EF90DF90CF900C94E41CFF2077
:102E200019F0842F817001C08695882309F468C148
:102E3000262F229526952770220F220F862F8F701E
:102E4000C82ED12CE12CF12C022E04C0CC0CDD1CA0
:102E5000EE1CFF1C0A94D2F764FF10C06FE070E014
:102E600080E090E004C0660F771F881F991F2A95A5
:102E7000D2F7609570958095909503C060E070E002
:102E8000CB01242F269526952370422F50E0423007
:102E90005105D1F04330510559F16C297D298E2916
:102EA0009F294130510541F128960FB6F894DEBFB5
:102EB0000FBECDBFDF91CF911F910F91FF90EF908B
:102EC000DF90CF900C94951D6C297D298E299F2928
:102ED00028960FB6F894DEBF0FBECDBFDF91CF911D
:102EE0001F910F91FF90EF90DF90CF900C94A71D52
:102EF0000E94951DC701B60128960FB6F894DEBF53
:102F00000FBECDBFDF91CF911F910F91FF90EF903A
:102F1000DF90CF900C94831D603FD9F128F480E4BA
:102F2000860F803250F09CC0623F09F461C008F403
:102F30004BC0633F09F470C093C0162F1071842FEB
:102F40008F716887FF2059F00E942E1D6885862F9B
:102F5000112319F08295807F75CE8F7073CE0E94F9
:102F6000491D6885862F112319F08295807F01C045
:102F70008F7028960FB6F894DEBF0FBECDBFDF91DD
:102F8000CF911F910F91FF90EF90DF90CF900C9415
:102F90006915FF20A9F0253008F0B2C0842F8F7189
:102FA00028960FB6F894DEBF0FBECDBFDF91CF914C
:102FB0001F910F91FF90EF90DF90CF900C94681DC0
:102FC000263008F09DC0EACFFF20A1F0842F8F713A
:102FD00028960FB6F894DEBF0FBECDBFDF91CF911C
:102FE0001F910F91FF90EF90DF90CF900C942E1DCA
:102FF000FF2061F3842F8F7128960FB6F894DEBFFF
:103000000FBECDBFDF91CF911F910F91FF90EF9039
:10301000DF90CF900C94491DFF2091F0842F8F7189
:1030200028960FB6F894DEBF0FBECDBFDF91CF91CB
:103030001F910F91FF90EF90DF90CF900C941F1D88
:1030400028960FB6F894DEBF0FBECDBFDF91CF91AB
:103050001F910F91FF90EF90DF90CF900C941A1D6D
:10306000FF20A1F0222309F4B1CF862F28960FB6B6
:10307000F894DEBF0FBECDBFDF91CF911F910F91AE
:10308000FF90EF90DF90CF900C940A14222309F464
:10309000B1CF862F28960FB6F894DEBF0FBECDBFF6
:1030A000DF91CF911F910F91FF90EF90DF90CF9024
:1030B0000C94F8144F70C8010E94C81F28960FB6D0
:1030C000F894DEBF0FBECDBFDF91CF911F910F915E
:1030D000FF90EF90DF90CF900C942C1C4F70C801A4
:1030E00028960FB6F894DEBF0FBECDBFDF91CF910B
:1030F0001F910F91FF90EF90DF90CF900C94CB1F1A
:1031000028960FB6F894DEBF0FBECDBFDF91CF91EA
:103110001F910F91FF90EF90DF90CF9008950E9444
:10312000611E0E94301E0E947D1E0E9423230E9469
:10313000F52180E090E00E944F1280E090E00C9436
:103140007D120E94511E0C948F180E94BA1D292FC7
:1031500022952F7030E02C3031054CF42A303105A7
:10316000C4F4225031092230310540F021C02C3006
:103170003105D1F02F303105B9F01AC0853A28F465
:103180008430C0F4823028F415C090E2980F983053
:1031900088F0883E30F4803E68F48450813A40F4F0
:1031A00009C0803F29F406C093FB882780F9089561
:1031B00080E0089581E00895CF93DF9300D000D0A0
:1031C0001F92CDB7DEB70F900F900F900F900F901A
:1031D000DF91CF910895CF93DF9300D000D000D03E
:1031E000CDB7DEB726960FB6F894DEBF0FBECDBFC3
:1031F000DF91CF9108951F93CF93DF93C091730117
:1032000016E080917401C81799F0D0E01C9FF0017E
:103210001D9FF00D1124EB58FE4F408151816281BA
:103220007381848195810E94EB182196C770E9CF44
:10323000DF91CF911F9108954091A5015091A60172
:103240006091A7017091A8018091A9019091AA01B4
:103250000C94EB18CF938091AA0182958F7009F09E
:103260005FC08091A701882309F45AC0209173019F
:10327000A09174016091A5017091A6018091A801AF
:103280009091A90131E06F3F09F030E0B32FC6E023
:103290002A1709F445C0009721F07F3F21F44B2FF6
:1032A00003C041E001C040E030E040FD35C0C29FB6
:1032B000F001C39FF00D1124EB58FE4F41817413B0
:1032C0002BC04081641328C04281411125C0438135
:1032D00054814817590710F441505109481B590BA4
:1032E000483C5105C8F48091AA018F708061809399
:1032F000AA0186E0829FF001839FF00D1124E65819
:10330000FE4F80818F708061808385EA91E00E940A
:103310007015CF910C94FB182F5F3F4F2770B8CFDB
:10332000CF910895CF92DF92EF92FF920F931F9368
:10333000CF93DF93CDB7DEB762970FB6F894DEBFB9
:103340000FBECDBF8C0185E0F801DE011D96019016
:103350000D928A95E1F7D8014C9111965C911197E5
:1033600012966C9112971396ED90FC9014977091B1
:10337000A501E091A6012091A8013091A901211594
:10338000310531F0EF3F31F481E07F3F19F403C0A4
:1033900081E001C080E0B82FB170CB2E80FD6CC100
:1033A000D090A701DD2009F4F5C0F091AA01E21642
:1033B000F30638F0C701821B930B883C910548F057
:1033C0009BC0209530952E0D3F1D283C310508F0FF
:1033D00093C08F2F807F09F052C0E51314C074137F
:1033E00012C0D62E61110FC0FF70F061F093AA01D8
:1033F0000E941C1985EA91E00E9470158091AA0133
:10340000F80185836CC1EF2831F05F3F31F481E032
:103410004F3F19F403C081E001C080E080FD03C08C
:1034200081E0862701C080E0F82FF170FF2E80FF39
:103430001CC0809173012091740136E0821709F459
:1034400028C190E0389FF001399FF00D1124EB580E
:10345000FE4F7181571306C07081471303C07281FC
:10346000671303C001968770E9CFD62E662309F44F
:1034700036C18091AA0181608093AA0153C0E513EF
:1034800008C0741306C0611104C0D8011596FC93DE
:10349000AEC04D875E878D859E856A8B0E94A5187C
:1034A0006A89882329F1D62E662311F12091AA0179
:1034B000822F82958F7090E002970CF460C080910B
:1034C000A5019091A60198878F831986FB86EA86CD
:1034D0002C87CE01079651C0E51731F14D875E87E5
:1034E0008D859E856A8B0E94A5186A8981112EC0E0
:1034F000C8010E947015A4C08F2F807F69F77E2DB0
:10350000F98AE88A89890E94DC1885EA91E00E949C
:103510007015E5EAF1E086E0DF011D928A95E9F792
:103520000E941C19D12CDBC07413D8CF6111D6CFE7
:10353000D8011596FC93C8010E947015E5EAF1E0E8
:1035400086E0DF011D928A95E9F7C9C0D62E662371
:1035500079F22091AA01822F82958F7090E00297D4
:1035600074F08091A5019091A6019A8389831B82B2
:10357000FD82EC822E83CE0101960E94701586E0BA
:10358000F801A5EAB1E001900D928A95E1F70E9459
:103590002A196FC0E216F30628F0C701821B930BAD
:1035A0009C0104C0209530952E0D3F1D283C31050F
:1035B00008F052C0D62E662309F49ACFE5132CC02A
:1035C00074132AC08091AA0180FD1DC0982F929586
:1035D0009F70C9F0D80115968C9315979F3039F0DC
:1035E0009F5F9295907F8F70892B15968C93C80161
:1035F0000E94701586E0F801A5EAB1E001900D92F5
:103600008A95E1F736C086E0F801A5EAB1E00190BD
:103610000D928A95E1F763C04D875E878D859E8503
:103620000E94A518882379F086E0F801A5EAB1E0A8
:1036300001900D928A95E1F70E942A190E941C19A7
:10364000DD24D3944CC08091AA0181608093AA01AB
:10365000C8010E94701543C07E2DF98AE88A8989C5
:103660000E94DC18E5EAF1E086E0DF011D928A9510
:10367000E9F70E941C1933C0662309F439CF4D873E
:103680005E878D859E850E94A518882309F430CF1A
:10369000CBCF4D875E878D859E850E94BA1D292FD1
:1036A00022952F7030E0223031052CF49F7041F0CC
:1036B000811106C00CC0243031052CF49F7049F4F0
:1036C000805E883020F0C8010E947015CF2CDC2C61
:1036D00006C0D80115969C91907F91F7F8CF8D2D5B
:1036E00062960FB6F894DEBF0FBECDBFDF91CF91CB
:1036F0001F910F91FF90EF90DF90CF9008951F934F
:10370000CF93DF93CDB7DEB72C970FB6F894DEBF1B
:103710000FBECDBF4F83588769877A878B879C8779
:10372000CE0107960E9492198823C1F02F81388517
:103730008A859B85892B31F03F3F11F080E003C0E3
:103740002F3FE1F781E0811147C04F81588569859E
:103750007A858B859C850E94EB183EC086E0FE0131
:103760003796DE01119601900D928A95E1F7FF815F
:10377000E8854A855B854115510531F0EF3F31F40D
:1037800081E0FF3F19F403C081E001C080E080FDCB
:1037900023C02091740130E0C901019687709927F8
:1037A0006091730170E086179707F1F1F983EA835E
:1037B0005D834C8396E0929FD001939FB00D1124BE
:1037C000AB58BE4FFE01319601900D929A95E1F7EC
:1037D000809374010E94FB1816E080917301909110
:1037E0007401891779F1189FC00111248B589E4FDD
:1037F0000E949219882331F1E09173011E9FF0011C
:103800001124EB58FE4F4081518162817381848184
:1038100095810E94EB188091730190E0019687706A
:10382000992780937301D9CF0E94A1181092740137
:1038300010927301E5EAF1E086E0DF011D928A95BE
:10384000E9F7CACF2C960FB6F894DEBF0FBECDBFF6
:10385000DF91CF911F910895DF92EF92FF920F9326
:103860001F93CF93DF93FC01009709F48AC0E12CEA
:10387000F12CDD24D394EF0121968491853709F44E
:1038800061C058F4843708F04EC0843008F06AC034
:103890008130D1F0823071F174C0883709F45DC095
:1038A00050F4863709F455C0873709F06AC08E2D69
:1038B0000E944E1E54C09CE7980F903708F061C0DC
:1038C0008F770E94F81450C08F010E5F1F4FFE01CA
:1038D000849190E2980F983050F48770FD2D01C0CC
:1038E000FF0F8A95EAF78F2F0E94541E15C00E9481
:1038F0000A1414C08F010E5F1F4FFE01849190E2E5
:10390000980F983068F48770FD2D01C0FF0F8A95DD
:10391000EAF78F2F0E945A1E0E947D1EE80124C0E4
:103920000E94F814FBCF9F012E5F3F4FFE01C49110
:10393000CC2369F08FE99FE00197F1F700C0000008
:10394000C150F6CF9F012E5F3F4FFE01F490E90179
:103950000BC00E943E1EE82E07C00E94511E0E940E
:103960007D1E02C00E940A149F2D992341F0EFE9A9
:10397000FFE03197F1F700C000009150F6CFFE0153
:103980007ACFDF91CF911F910F91FF90EF90DF9051
:1039900008956093AF017093B0018093B10190934B
:1039A000B2010E94CA1E0C948F186093AB017093F1
:1039B000AC018093AD019093AE010E94CB1E0C949C
:1039C0008F1808950C94C91C0F931F930091AF0199
:1039D0001091B0012091B1013091B201602B712B97
:1039E000822B932B1F910F910C94C91C0F931F9343
:1039F0000091AF011091B0012091B1013091B2015D
:103A000060237123822393231F910F910C94C91C6F
:103A10000F931F930091AF011091B0012091B1015C
:103A20003091B20160277127822793271F910F9150
:103A30000C94C91C60E070E0CB010C94D51C41E0F3
:103A400050E060E070E004C0440F551F661F771F10
:103A50008A95D2F7CB01BA010C94D51C41E050E015
:103A600060E070E004C0440F551F661F771F8A9501
:103A7000D2F78091AB019091AC01A091AD01B091D2
:103A8000AE01482B592B6A2B7B2BCB01BA010C942E
:103A9000D51C41E050E060E070E004C0440F551FC9
:103AA000661F771F8A95D2F740955095609570955F
:103AB0008091AB019091AC01A091AD01B091AE01AC
:103AC000482359236A237B23CB01BA010C94D51CCC
:103AD00041E050E060E070E004C0440F551F661FF5
:103AE000771F8A95D2F78091AB019091AC01A0919C
:103AF000AD01B091AE01482759276A277B27CB013A
:103B0000BA010C94D51C0F931F930091AB01109137
:103B1000AC012091AD013091AE01602B712B822B55
:103B2000932B1F910F910C94D51C0F931F93009111
:103B3000AB011091AC012091AD013091AE01602339
:103B40007123822393231F910F910C94D51C0F9303
:103B50001F930091AB011091AC012091AD01309108
:103B6000AE0160277127822793271F910F910C9434
:103B7000D51C0895CF92DF92EF92FF920F931F937F
:103B8000CF93DF93EC01C090AF01D090B001E090F3
:103B9000B101F090B2018091AB019091AC01A09184
:103BA000AD01B091AE01C82AD92AEA2AFB2A0FE159
:103BB00010E0B701A601002E04C0769567955795D1
:103BC00047950A94D2F740FF07C0BE01802F0E949C
:103BD000E71F8130910539F40150110950F7BE01FA
:103BE00080E00E94E71FDF91CF911F910F91FF901E
:103BF000EF90DF90CF90089540910D0150910E010C
:103C000020E030E09FEFFA01E20FF31F62816817B6
:103C100099F09F3F19F4611101C0922F2F5F3F4F20
:103C20002630310581F79F3F39F0FA01E90FF11D88
:103C300097FDFA9582830895089540910D01509162
:103C40000E0120E030E0FA01E20FF31F9281981399
:103C500001C012822F5F3F4F26303105A1F7089532
:103C600081E090E0E0910D01F0910E01E80FF91F65
:103C70001082019688309105A9F708958091BD01C1
:103C800008959091BD01982B9093BD010895809562
:103C90009091BD0198239093BD0108958093BD013B
:103CA00008951092BD0108959091BC01982B9093B6
:103CB000BC01089580959091BC0198239093BC011C
:103CC00008951092BC0108958093B3010895109255
:103CD000B301089540910D0150910E0120E030E0B4
:103CE00080E0FA01E20FF31F918191118F5F2F5F46
:103CF0003F4F27303105A9F70895E0910D01F0916C
:103D00000E018091BD018083E0910D01F0910E01C3
:103D100080819091BC01892B80839091B30199237C
:103D200061F0E0910D01F0910E018081892B80837B
:103D30000E946A1E81111092B30180910D01909131
:103D40000E010C94FF119093350180933401089576
:103D50008295982F9C7C96959695837344E0849FDA
:103D600090011124922B892F8A7A86959575990F47
:103D7000892B08950895CF93DF9300D000D01F9230
:103D8000CDB7DEB70F900F900F900F900F90DF918F
:103D9000CF910895089508950C9472138091D301E2
:103DA000843009F11092BF0120E488E190E00FB661
:103DB000F894A895809360000FBE2093600083B7AD
:103DC000817F846083BF83B7816083BF7894889547
:103DD00083B78E7F83BF88E10FB6F894809360002D
:103DE000109260000FBE0895CF930E94C6130E94E8
:103DF00058080E94C713C0E08C2F0E943E09811111
:103E000005C0CF5FC031C1F780E001C081E0CF9134
:103E100008950E9474130C94A1181F920F920FB66C
:103E20000F9211248F939F93AF93BF938091BF0103
:103E3000811113C08091C0019091C101A091C20174
:103E4000B091C3014196A11DB11D8093C001909313
:103E5000C101A093C201B093C301BF91AF919F91E3
:103E60008F910F900FBE0F901F90189582E084BD28
:103E700093E095BD9AEF97BD80936E0008952FB79C
:103E8000F8948091C0019091C101A091C201B091BC
:103E9000C3012FBF08952FB7F8946091C0017091AE
:103EA000C1018091C2019091C3012FBF0895CF92AB
:103EB000DF92EF92FF920F931F932FB7F8944091E8
:103EC000C0015091C1016091C2017091C3012FBF27
:103ED0006A017B01EE24FF248C0120E030E0C01653
:103EE000D106E206F30610F441505109481B590B64
:103EF000CA011F910F91FF90EF90DF90CF9008952E
:103F00001F920F920FB60F9211248F939F93AF932E
:103F1000BF938091C0019091C101A091C201B09165
:103F2000C3010196A11DB11D8093C0019093C101F1
:103F3000A093C201B093C301BF91AF919F918F91A4
:103F40000F900FBE0F901F9018950E94170FF894B6
:103F50002FEF87EA91E6215080409040E1F700C0C2
:103F6000000087E090EBDC018093DC019093DD01A1
:103F7000A093DE01B093DF012CE088E190E00FB662
:103F8000F894A895809360000FBE20936000FFCF47
:103F900080E090E008950895E72FF0E090E1899F98
:103FA000E00DF11D112483E0EE0FFF1F8A95E1F76C
:103FB000E60FF11DEC51FF4F84910895E82FF0E0DA
:103FC000EE0FFF1FE05AF0408591949108950E94F2
:103FD000CC1F90E4980F903218F40E94DE1F0895D1
:103FE0008D3B60F4883AA0F5853A38F5843010F5B9
:103FF000813009F088C021E030E087C0883E98F425
:10400000803EC0F48F3B09F07EC00E94A1182FEFC4
:1040100080E792E0215080409040E1F700C000002E
:104020000E94A51F70C0803F08F46DC0282F30E0AB
:1040300030656BC0282F30E068C0853A21F0863AA1
:1040400021F492E803C091E801C093E880E458C0ED
:10405000883A51F1893A51F18A3A51F18B3A51F14A
:104060008C3A51F18D3A51F18E3A51F18F3A51F12A
:10407000813B51F1803B51F1823B51F1833B51F146
:10408000843B51F1853B51F1863B59F1873B59F116
:10409000883B59F1893B59F18A3B59F18B3B59F1E6
:1040A0008C3B61F59AE228C092EE29C099EE27C0B8
:1040B0009AEE25C095EB23C096EB21C093EB1FC071
:1040C00094EB1DC097EB1BC09CEC19C09DEC17C076
:1040D00093E805C09AE803C092E901C094E985E439
:1040E0000FC091E209C093E207C094E205C095E2D7
:1040F00003C096E201C097E286E402C090E084E447
:10410000292F382F02C020E030E0C90108958091A6
:10411000C60180FF0BC06091120185E0689FB0016D
:10412000112475956795759567952AC081FF09C01B
:104130006091120185E0689FB00111247595679523
:104140001FC082FF07C06091120185E0689FB00127
:10415000112416C04091C7014423C9F06091110198
:10416000461788F72091120185E0289F90011124BD
:10417000429FC001439F900D112470E00E942128AE
:104180006038710540F46115710539F002C065E0D1
:1041900070E0862F08958FE7089581E0089580915B
:1041A000C60180FF08C06091100170E075956795A9
:1041B0007595679521C081FF06C06091100170E080
:1041C0007595679519C082FF04C06091100170E079
:1041D00010C08091C7018823C1F060910F0186173C
:1041E000A0F790911001989FC001112470E00E94E7
:1041F00021286038710528F46115710521F0862F9A
:1042000008958FE7089581E0089561E070E0F4CFAC
:10421000803F21F40E948720819504C0813F29F4CA
:104220000E9487208093CA010895823F21F40E9452
:104230008720819504C0833F29F40E9487208093C2
:10424000C9010895893F19F40E94CF2005C08A3F13
:1042500031F40E94CF2081958093CB0108958B3F4C
:1042600021F40E94CF20819504C08C3F29F40E9444
:10427000CF208093CC010895843F21F48091C80120
:10428000816017C0853F21F48091C801826011C010
:10429000863F21F48091C80184600BC0873F21F4E0
:1042A0008091C801886005C0883F31F48091C801C1
:1042B00080618093C80108958D3F21F48091C601EB
:1042C00081600BC08E3F21F48091C601826005C0E1
:1042D0008F3F29F48091C60184608093C6010895C0
:1042E000803F39F48091CA0187FF6CC01092CA01E7
:1042F00069C0813F29F48091CA011816BCF362C0DD
:104300009091C901823F29F497FF5CC01092C901C6
:1043100059C0833F19F41916CCF354C0893F41F4B6
:104320008091CB0118160CF04DC01092CB014AC001
:104330008A3F29F48091CB0187FF44C0F6CF8B3FA1
:1043400039F48091CC0187FF3DC01092CC013AC076
:104350008C3F29F48091CC011816BCF333C0843F04
:1043600021F48091C8018E7F17C0853F21F4809190
:10437000C8018D7F11C0863F21F48091C8018B7FD9
:104380000BC0873F21F48091C801877F05C0883F1B
:1043900031F48091C8018F7E8093C80113C08D3F96
:1043A00021F48091C6018E7F0BC08E3F21F4809155
:1043B000C6018D7F05C08F3F29F48091C6018B7F98
:1043C0008093C6018091C90181110EC08091CA01FC
:1043D00081110AC08091CB01811106C08091CC016E
:1043E000811102C01092C70108958091BE0183FF20
:1043F0007EC08DE595E00E94EB058091C8011F927B
:104400008F9388E595E09F938F930E94840686E5BD
:1044100095E00E94EB052091C901822F992787FD25
:1044200090959F932F9383E595E09F938F930E94A0
:10443000840681E595E00E94EB052091CA01822F58
:10444000992787FD90959F932F938EE495E09F93F6
:104450008F930E9484068CE495E00E94EB052091E6
:10446000CB01822F992787FD90959F932F9389E405
:1044700095E09F938F930E94840687E495E00E94C5
:10448000EB052091CC01822F992787FD90959F9372
:104490002F9384E495E09F938F930E94840681E498
:1044A00095E00E94EB058091C7011F928F938EE3E8
:1044B00095E09F938F930E9484068CE395E00E9481
:1044C000EB058091C6011F928F9389E395E09F933E
:1044D0008F930E94840686E395E00E94EB058DB7DA
:1044E0009EB74C960FB6F8949EBF0FBE8DBF88EC5A
:1044F00091E00E9444120E943F1F9093C501809357
:10450000C40108951F93CF93DF938091C4019091CC
:10451000C5010E94571F4091C701442321F02091FB
:10452000130130E006C0209114015AE0259F90014C
:1045300011248217930708F482C08091C901109159
:10454000CA01D091CB01C091CC01811107C01111DA
:1045500005C0D11103C0CC2309F471C04F3F19F03D
:104560004F5F4093C701181624F40E948720809360
:10457000C9018091C90187FF05C00E9487208195EC
:104580008093C901111624F40E9487208093CA01E8
:104590008091CA0187FF05C00E9487208195809382
:1045A000CA016091C901662339F11091CA01112332
:1045B00019F1772767FD7095872F972F0E9426277F
:1045C00023E333E343E35FE30E948A270E94F32659
:1045D0006093C901612F772767FD7095872F972F0B
:1045E0000E94262723E333E343E35FE30E948A2705
:1045F0000E94F3266093CA011D1624F40E94CF2066
:104600008093CB018091CB0187FF05C00E94CF2012
:1046100081958093CB011C1624F40E94CF208093B7
:10462000CC018091CC0187FF05C00E94CF208195ED
:104630008093CC01DF91CF911F910C94F521DF91F4
:10464000CF911F910895E8ECF1E085E0DF011D9224
:104650008A95E9F71092C7011092C601089580E883
:1046600097E00E94EB051F9281E08F931F9285E0F7
:104670008F9382E397E09F938F930E9484060F901D
:104680000F900F900F900F900F9008958330E9F1E5
:1046900028F4813061F0823009F10895853009F401
:1046A00062C008F449C0863009F474C008952091AE
:1046B0001401862F90E0820F911D8F3F910520F409
:1046C000620F6093140103C08FEF809314018091F7
:1046D00014011F928F938BE696E072C02091130114
:1046E000862F90E0820F911D8F3F910520F4620F7D
:1046F0006093130103C08FEF809313018091130126
:104700001F928F9389E596E05BC020911201862F5E
:1047100090E0820F911D8F3F910520F4620F60930E
:10472000120103C08FEF80931201809112011F923A
:104730008F9386E496E044C020911101862F90E08B
:10474000820F911D8F3F910520F4620F609311013C
:1047500003C08FEF80931101809111011F928F93FD
:1047600081E396E02DC020911001862F90E0820F0A
:10477000911D8F3F910520F4620F6093100103C0DB
:104780008FEF80931001809110011F928F9388E129
:1047900096E016C020910F01862F90E0820F911DA8
:1047A0008F3F910520F4620F60930F0103C08FEFDC
:1047B00080930F0180910F011F928F938DEF95E0F1
:1047C0009F938F930E9484060F900F900F900F90ED
:1047D0000895833081F128F4813059F08230D1F08E
:1047E0000895853009F449C0B8F1863009F456C0FF
:1047F000089580911401681720F4861B809314019A
:1048000002C010921401809114011F928F938EEEBA
:1048100095E054C080911301681720F4861B8093A3
:10482000130102C010921301809113011F928F9304
:104830008CED95E043C080911201681720F4861B2F
:104840008093120102C010921201809112011F92F6
:104850008F9389EC95E032C080911101681720F4A4
:10486000861B8093110102C01092110180911101E9
:104870001F928F9384EB95E021C0809110016817FF
:1048800020F4861B8093100102C0109210018091C9
:1048900010011F928F938BE995E010C080910F015A
:1048A000681720F4861B80930F0102C010920F013D
:1048B00080910F011F928F9380E895E09F938F93D3
:1048C0000E9484060F900F900F900F900895CF9341
:1048D000C82F1F928F9325E838E03F932F930E94B3
:1048E000840661E070E080E090E004C0660F771F0E
:1048F000881F991FCA95D2F70E94E21C0F900F9053
:104900000F900F90CF910C94A118CF93873288F518
:104910008E3108F008C18E3009F486C0D8F4873093
:1049200009F460C08B3009F44FC0863009F0FFC035
:104930008091BE01817F8E7F8093BE018AE898E0DE
:104940000E94EB058EE29BE00E94EB0581E08093E4
:10495000CE0146C0863109F4ADC020F4803109F49F
:1049600078C0E5C0893109F48EC08B3109F449C0A3
:10497000DEC0883349F150F4893209F4D2C085335E
:1049800009F4CFC0873209F0D2C0CBC0833409F418
:10499000C8C028F48A3308F4CAC08953C5C0883413
:1049A00009F0C5C00E94A1188DE19BE00E94EB05B3
:1049B0002FEF83ED90E3215080409040E1F700C05D
:1049C00000000E94A51F0CC081EB98E03FC084E06E
:1049D0009BE00E94EB058091BE0181608093BE0147
:1049E000C1E0AAC08091BE01C82FC17080FFEFCF87
:1049F00080E19BE00E94EB058091BE01817F8E7F6C
:104A00003CC08091BE0181FBCC27C0F991E0C92751
:104A1000C0FB81F98093BE01CC2319F087EF9AE0A7
:104A200027C089EE9AE012C08091BE0182FBCC279C
:104A3000C0F991E0C927C0FB82F98093BE01CC2365
:104A400019F08AED9AE014C08AEC9AE00E94EB0516
:104A5000C7CF8091BE0183FBCC27C0F991E0C92765
:104A6000C0FB83F98093BE01CC2351F08EEB9AE01A
:104A70000E94EB058091BE0181608093BE015CC005
:104A800081EB9AE0E3CF82EA9AE00E94EB058FE7A0
:104A90009AE00E94EB058AE39AE00E94EB0583E12D
:104AA0009AE00E94EB058DED99E00E94EB058FEAFC
:104AB00099E0CCCF81EA99E00E94EB050E94F311C6
:104AC0001F928F9387E899E09F938F930E948406AB
:104AD00080910C011F928F9380E799E09F938F93B1
:104AE0000E94840680915B011F928F938DE599E06F
:104AF0009F938F930E9484060E944B1F9F938F93D6
:104B00007F936F9386E499E09F938F930E9484062E
:104B10008DB79EB742960FB6F8949EBF0FBE8DBF5D
:104B20005FCF80E001C08D510E94672459CF84E49B
:104B300099E00E94EB05C0E08C2FCF91089580E0B2
:104B4000089580E00895CF93C82F8091CE018130E1
:104B500069F020F0823009F446C03DC167E08FE083
:104B60000E947613882309F43CC106C067E08FE0F9
:104B70000E947613882349F08C2F0E949F25811173
:104B80002FC08C2F0E9485242CC08C2F0E94A12521
:104B9000811126C0C431E1F070F4CB3081F0C03116
:104BA000D1F40E942F238DE798E00E94EB0582E06C
:104BB0008093CE0115C0C93259F0C83361F48AE838
:104BC00098E00E94EB0581E898E00E94EB0508C0A0
:104BD0001092CE0104C18BE798E00E94EB05FFC064
:104BE00081E08170FEC0C43228F5CE3108F0C1C02A
:104BF000CB30A1F1D0F4C73009F0D3C08EE180935F
:104C0000140182E3809313018AE08093120184E10E
:104C10008093110188E08093100188E280930F0156
:104C200081E297E00E94EB05BFC0C33149F1C43176
:104C3000C1F0B7C0CB3409F4A9C028F4C93289F057
:104C4000C83361F0AEC0C13509F49EC0C23509F465
:104C500099C0CE3409F0A5C06AE09EC00E942F23FF
:104C6000A3C08091CD01882319F01092CD019CC082
:104C70008EE297E00E94EB0581E08093CE01B1C007
:104C800088E097E00E94EB0586EF96E00E94EB0536
:104C9000809114011F928F9383EF96E09F938F93DF
:104CA0000E94840681EF96E00E94EB058FED96E06E
:104CB0000E94EB05809113011F928F938CED96E07B
:104CC0009F938F930E9484068AED96E00E94EB05E5
:104CD0008BEC96E00E94EB05809112011F928F935E
:104CE00088EC96E09F938F930E94840686EC96E072
:104CF0000E94EB0585EB96E00E94EB058091110187
:104D00001F928F9382EB96E09F938F930E9484066D
:104D100080EB96E00E94EB058BE996E00E94EB05A4
:104D2000809110011F928F9388E996E09F938F9353
:104D30000E94840686E996E00E94EB058FE796E0E4
:104D40000E94EB0580910F011F928F938CE796E0F4
:104D50009F938F930E9484068AE796E00E94EB055A
:104D60008DB79EB748960FB6F8949EBF0FBE8DBF05
:104D70001BC0CE51EC2FF0E0E65DFE4F80818093AA
:104D8000CD0112C061E003C061E006C06AE080911D
:104D9000CD010E94462308C08091CD010E94E923E5
:104DA00003C08FE197E013C08091CD01882369F0A3
:104DB0001F928F9389E197E09F938F930E948406BF
:104DC0000F900F900F900F9004C086E197E00E9423
:104DD000EB0581E006C01092CE0180E002C080E0C9
:104DE00000CFCF91089504D06894B1118DC008957B
:104DF00070D088F09F5790F0B92F9927B751A0F045
:104E0000D1F0660F771F881F991F1AF0BA95C9F75E
:104E100012C0B13081F077D0B1E0089574C0672F2F
:104E2000782F8827B85F39F0B93FCCF3869577950E
:104E30006795B395D9F73EF49095809570956195F7
:104E40007F4F8F4F9F4F0895E89409C097FB3EF422
:104E500090958095709561957F4F8F4F9F4F9923C7
:104E6000A9F0F92F96E9BB279395F6958795779545
:104E70006795B795F111F8CFFAF4BB0F11F460FF05
:104E80001BC06F5F7F4F8F4F9F4F16C0882311F05D
:104E900096E911C0772321F09EE8872F762F05C071
:104EA000662371F096E8862F70E060E02AF09A950C
:104EB000660F771F881FDAF7880F9695879597F901
:104EC000089557FD9058440F551F59F05F3F71F0FA
:104ED0004795880F97FB991F61F09F3F79F0879561
:104EE0000895121613061406551FF2CF4695F1DFEA
:104EF00008C0161617061806991FF1CF869571057A
:104F0000610508940895E894BB2766277727CB01AD
:104F100097F908950BD078C069D028F06ED018F0BA
:104F2000952309F05AC05FC01124EECFCADFA0F369
:104F3000959FD1F3950F50E0551F629FF001729F2E
:104F4000BB27F00DB11D639FAA27F00DB11DAA1F4D
:104F5000649F6627B00DA11D661F829F2227B00D9A
:104F6000A11D621F739FB00DA11D621F839FA00D25
:104F7000611D221F749F3327A00D611D231F849F75
:104F8000600D211D822F762F6A2F11249F575040CC
:104F90008AF0E1F088234AF0EE0FFF1FBB1F661F67
:104FA000771F881F91505040A9F79E3F510570F020
:104FB00014C0AACF5F3FECF3983EDCF3869577955B
:104FC0006795B795F795E7959F5FC1F7FE2B880F1B
:104FD000911D9695879597F9089597F99F6780E8B1
:104FE00070E060E008959FEF80EC089500240A943B
:104FF0001616170618060906089500240A941216B4
:105000001306140605060895092E0394000C11F4E6
:10501000882352F0BB0F40F4BF2B11F460FF04C093
:105020006F5F7F4F8F4F9F4F0895991B79E004C0AA
:10503000991F961708F0961B881F7A95C9F78095D7
:10504000089597FB072E16F4009407D077FD09D03A
:105050000E943B2807FC05D03EF4909581959F4F18
:105060000895709561957F4F0895EE0FFF1F05908D
:10507000F491E02D0994AA1BBB1B51E107C0AA1FA4
:10508000BB1FA617B70710F0A61BB70B881F991FE9
:105090005A95A9F780959095BC01CD010895F89493
:0250A000FFCF40
:1050A200FFFF680A590B360B020BCF0A01B4012825
:1050B20008140A321E404D36229E0451041B04F984
:1050C2000385039E03B703D0030001020304050610
:0450D20007080900C2
:00000001FF

Post your Makefie here. I'm pretty sure that will need to be edited.
Title: Re: ADB to USB keyboard converter
Post by: mrrm14 on Thu, 06 April 2017, 13:24:18
Hi All,

I'm following this handy little guide to convert the Apple Extended Keyboard II to USB:
http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/ (http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/)

I followed all of the instructions to the letter but I have a problem. The Teensy 2 powers on when plugged as does the Keyboard Num Lock, Caps Lock and Scroll Lock LEDs. The Teensy' LED is on constantly but flashes every 10 seconds. When it flashes the mouse pointer on the screen moves about an inch to the right.

I'm still a bit new to micro controllers and Hex Code so I can't debug the issue myself, to my eyes it seems all good. I've included the code used and my wiring.

Any advice is much appreciated!

Thanks!

http://imgur.com/a/omVjP (http://imgur.com/a/omVjP)

Code: [Select]
:100000000C9499050C94DD050C94DD050C94DD052C
:100010000C94DD050C94DD050C94DD050C94DD05D8
:100020000C94DD050C94DD050C94920F0C94641077
:100030000C940D1F0C94DD050C94DD050C94DD056E
:100040000C94DD050C94DD050C94DD050C94DD05A8
:100050000C94DD050C94801F0C94DD050C94DD05DB
:100060000C94DD050C94DD050C94DD050C94DD0588
:100070000C94DD050C94DD050C94DD050C94DD0578
:100080000C94DD050C94DD050C94DD050C94DD0568
:100090000C94DD050C94DD050C94DD050C94DD0558
:1000A0000C94DD050C94DD050C94DD05C910EB10F6
:1000B000D611EB10D6112D115011D611A511B81172
:1000C000B715B715E515E51541167D16801880188A
:1000D000951680188C178C175A18801880186E186F
:1000E00035A131A1041607090B0A1D1B0619640569
:1000F000141A08151C171E1F202123222E26242D1A
:1001000025273012182F0C13280F0D340E33C1364B
:10011000381110372B2CC02A5829E0E3E182E25035
:100120004F5152006C6365556D570053A9AAA854EE
:100130005800566D6E2E62595A5B5C5D5E5F6F6053
:10014000618987853E3F403C4142914490466B47E0
:10015000004365450048494A4B4C3D4D3B4E3AE50E
:10016000E6E40000AAA9A8090B0A1D1B06196405EC
:10017000141A08151C173A3B3C3D3F3E454240448B
:100180004143494718524648284B0D4F4A50C14DEC
:100190005111104E2B2CC04C5835E0E3E182E24A5D
:1001A0004D4E4B006CF565F66DF90053A9AAA8F504
:1001B000F600FA6D6EF4F4FBF1FCF2F1F3FA6FF075
:1001C000F98987853E3F403C4142914490466B47C8
:1001D000004365450048494A4B4C3D4D3B4E3AE58E
:1001E000E6E400006164625F686F73745F6B626471
:1001F0005F726563763A204552524F522825642932
:100200000A000A0025303458006164625F686F7329
:10021000745F6B62645F726563763A200045525288
:100220004F523A206D65646961206B6579300A0030
:100230004552524F523A206D65646961206B657971
:10024000310A005D0A0025640020002564007C005E
:100250002530325800200025303258006164625F3A
:100260006D6F757365207261773A205B000A002517
:1002700030313662006164625F686F73745F6D6F06
:100280007573655F726563763A20006465627567B1
:1002900020656E61626C65642E0A005363616E3A7C
:1002A00020616464723A25642C20726567333A25B4
:1002B0003034580A00416674657220696E69743A78
:1002C0000A00466F756E643A206D65646961206B43
:1002D0006579730A005363616E3A20616464723A0F
:1002E00025642C20726567333A253034580A004261
:1002F00065666F726520696E69743A0A004B6579AC
:10030000626F6172642073746172742E0A005553B7
:100310004220636F6E666967757265642E0A000D10
:100320000A696E69740A005B445D005B435D002EE0
:100330000341004400420020006B00650079006228
:10034000006F00610072006400200063006F006EA7
:100350000076006500720074006500720000000EF7
:100360000374002E006D002E006B002E00000004B0
:1003700003090409027400040100A032090400000A
:1003800001030101000921110100012240000705BC
:10039000810308000A090401000103010200092188
:1003A00011010001224D000705820308000A09041B
:1003B00002000103000000092111010001223600A2
:1003C0000705830308000A09040300020300000074
:1003D00009211101000122220007058403200001E8
:1003E000070504032000011201100100000008EDC0
:1003F000FEDB0A0101010200010631FF0974A101BF
:100400000975150026FF00952075088102097615EB
:100410000026FF00952075089102C005010980A102
:1004200001850216810026B7001A81002AB70075DF
:100430001095018100C0050C0901A1018503160179
:1004400000269C021A01002A9C0275109501810069
:10045000C005010902A1010901A10005091901292D
:10046000051500250195057501810295017503812A
:10047000010501093009311581257F950275088133
:100480000609381581257F950175088106050C0A36
:1004900038021581257F950175088106C0C00501C8
:1004A0000906A101050719E029E7150025019508AE
:1004B0007501810295017508810105081901290559
:1004C00095057501910295017503910105071900C4
:1004D00029FF150026FF00950675088100C0636F8F
:1004E0006E73756D65723A20253034580A00737941
:1004F0007374656D3A20253034580A000A0025309F
:10050000325820006B6579626F6172643A20004C4A
:1005100045443A20253032580A00253032583A20D6
:100520002530386225730A00722F63203031323350
:10053000343536370A00290A002575002F00257545
:10054000005D28002564002000256400200025644B
:100550000020002564007C0025303258006D6F7546
:1005600073656B6579205B62746E7C782079207688
:1005700020685D287265702F61636C293A205B00EA
:100580006D6B5F776865656C5F74696D655F746FCF
:100590005F6D6178203D2025640A006D6B5F776890
:1005A00065656C5F6D61785F7370656564203D2083
:1005B00025640A006D6B5F74696D655F746F5F6DB4
:1005C0006178203D2025640A006D6B5F6D61785F66
:1005D0007370656564203D2025640A006D6B5F695A
:1005E0006E74657276616C203D2025640A006D6B27
:1005F0005F64656C6179203D2025640A006D6B5F46
:10060000776865656C5F74696D655F746F5F6D6158
:1006100078203D2025640A006D6B5F776865656C06
:100620005F6D61785F7370656564203D2025640AA5
:10063000006D6B5F74696D655F746F5F6D617820CD
:100640003D2025640A006D6B5F6D61785F73706596
:100650006564203D2025640A006D6B5F696E7465DA
:100660007276616C203D2025640A006D6B5F6465C5
:100670006C6179203D2025640A000A00257500364A
:100680003A20776865656C5F74696D655F746F5F4C
:100690006D61783A20000A00257500353A207768A8
:1006A00065656C5F6D61785F73706565643A2000A5
:1006B0000A00257500343A2074696D655F746F5FB8
:1006C0006D61783A20000A00257500333A206D618B
:1006D000785F73706565643A20000A002575003202
:1006E0003A20696E74657276616C286D73293A20C0
:1006F000000A00257500313A2064656C6179282A6A
:1007000031306D73293A20000A092D2056616C752D
:100710006573202D0A004D3E004D25643E20003FAC
:10072000007365742064656661756C740A00433EED
:10073000200077686572652064656C74613A206397
:100740007572736F723D25642C20776865656C3D0A
:1007500025640A53656520687474703A2F2F656E9E
:100760002E77696B6970656469612E6F72672F7788
:10077000696B692F4D6F7573655F6B6579730A00DF
:100780000A092D204D6F7573656B6579202D0A451B
:1007900053432F713A09717569740A313A096465D6
:1007A0006C6179282A31306D73290A323A09696EF1
:1007B00074657276616C286D73290A333A096D612C
:1007C000785F73706565640A343A0974696D655FB2
:1007D000746F5F6D61780A353A09776865656C5F9B
:1007E0006D61785F73706565640A363A097768658C
:1007F000656C5F74696D655F746F5F6D61780A0A1F
:10080000703A097072696E742076616C7565730A4E
:10081000643A097365742064656661756C74730A63
:1008200075703A092B310A646F776E3A092D310AD7
:10083000706775703A092B31300A7067646F776E94
:100840003A092D31300A0A7370656564203D2064D1
:10085000656C7461202A206D61785F7370656564D2
:10086000202A2028726570656174202F2074696DBC
:10087000655F746F5F6D6178290A003F004D3E200F
:1008800000433E20004C25640A000A092D20436FD6
:100890006E736F6C65202D0A4553432F713A0971B1
:1008A0007569740A6D3A096D6F7573656B65790AC0
:1008B000000A092D204D61676963202D0A643A09F9
:1008C00064656275670A783A096465627567206DC8
:1008D00061747269780A6B3A096465627567206BA6
:1008E0006579626F6172640A6D3A09646562756761
:1008F000206D6F7573650A763A0976657273696F54
:100900006E0A733A097374617475730A633A096302
:100910006F6E736F6C65206D6F64650A302D343AAD
:10092000096C61796572302D34284631302D46349A
:10093000290A506175733A09626F6F746C6F616454
:1009400065720A003F0074696D65725F726561646B
:10095000333228293A202530346C580A006B6579E7
:10096000626F6172645F69646C653A2025580A00A1
:100970006B6579626F6172645F70726F746F636FC1
:100980006C3A2025580A00686F73745F6B65796252
:100990006F6172645F6C65647328293A2025580A78
:1009A000000A092D20537461747573202D0A0047C5
:1009B00043433A20342E382E31204156522D4C4993
:1009C00042433A20312E382E3073766E20415652F3
:1009D0005F415243483A20617672350A004F5054C5
:1009E000494F4E533A204C554641204D4F555345A3
:1009F0004B45592045585452414B455920434F4E81
:100A0000534F4C4520434F4D4D414E4420343039D7
:100A1000360A004255494C443A20346265666338D0
:100A200037202830303A30353A3233204170722046
:100A300020362032303137290A005649443A2030D6
:100A4000784645454428742E6D2E6B2E292050493A
:100A5000443A2030783041444228414442206B657A
:100A600079626F61726420636F6E7665727465720D
:100A700029205645523A203078303130310A00442E
:100A80004553433A20636F6E766572742041444249
:100A9000206B6579626F61726420746F20555342D8
:100AA0000A000A092D2056657273696F6E202D0A9F
:100AB000000A6D6F7573653A206F66660A000A6DED
:100AC0006F7573653A206F6E0A000A6B6579626F05
:100AD0006172643A206F66660A000A6B6579626F1C
:100AE0006172643A206F6E0A000A6D6174726978EF
:100AF0003A206F66660A000A6D61747269783A205E
:100B00006F6E0A000A64656275673A206F6E0A00AC
:100B10000A64656275673A206F66660A000A0A62AF
:100B20006F6F746C6F616465722E2E2E2000433ED1
:100B3000200011241FBECFEFDAE0DEBFCDBF04B628
:100B400003FE24C08091DC019091DD01A091DE01C3
:100B5000B091DF018730904BA740B04BB9F41092B1
:100B6000DC011092DD011092DE011092DF0114BE53
:100B700084B7877F84BF88E10FB6F89480936000C4
:100B8000109260000FBEE0E0F8E3099511E0A0E0EC
:100B9000B1E0E2EAF0E502C005900D92A433B1079E
:100BA000D9F721E0A4E3B1E001C01D92AC3DB2074A
:100BB000E1F70E94C50C0C944F280C940000FF93A1
:100BC000EF93E0913401F0913501309709F00995E8
:100BD000EF91FF910895FC018591803011F0EFDFD6
:100BE000FBCF0895FF27E0E230E247FF0CC04195BC
:100BF00097FF09C0EDE26095709580959095611D15
:100C0000711D811D911D27FF02C0219530E350E227
:100C1000AA27660F771F881F991FAA1FA41710F015
:100C2000A41B63955A95A9F7AA3008F0A95FA05DA7
:100C3000AF93F395611571058105910541F7ED328B
:100C400011F4EF93F395F21718F43F93F395FBCF5C
:100C50008F91B5DFFA95E1F70895E991F9918591C2
:100C6000803021F0853219F0AADFF9CF089520E015
:100C7000E89455915532C1F3503311F4689455916D
:100C80005A3348F4505390F3220F022E220F220FB2
:100C9000200D250FF4CF0EF42195899199915336AB
:100CA00019F3533729F1533559F1BC018827992796
:100CB000E8945C3621F48991999168945591543661
:100CC00039F446EF7EF077FF0DC08FEF9FEF0AC03B
:100CD00055374AE039F0583540E121F0523642E0CC
:100CE00009F00895FF93EF937DDFEF91FF91B7CF68
:100CF000FF93EF93FC0181918030B9F360DFFBCF6C
:100D0000FF93EF9368DFF1CFDF93CF93CDB7DEB7DB
:100D10002596A3DFCF91DF910895282F2770E82F24
:100D2000E695E695E695EF70F0E0E95CFE4F87FF0B
:100D30000CC081E090E0022E01C0880F0A94EAF70F
:100D40008095908189238083089581E090E0022E30
:100D500001C0880F0A94EAF79081982B9083089538
:100D60000F931F93CF93DF93569A5E9A0E949E092A
:100D70002FEF87EA91E6215080409040E1F700C0D4
:100D800000008FEE92E09F938F930E9484060F9055
:100D90000F90C1E0D0E005ED12E063E08C2F0E94DF
:100DA000A209009771F09F938F93DF93CF931F93C6
:100DB0000F930E9484060F900F900F900F900F904A
:100DC0000F909FEF29EF80E0915020408040E1F7A5
:100DD00000C000002196C031D105F9F663E082E041
:100DE0000E94A20999278131910511F174F487308D
:100DF0009105F1F024F404970297F0F419C08930BA
:100E00009105B1F00D97C1F413C08D31910581F0BA
:100E100034F48431910561F0499771F409C0843C40
:100E2000910531F0873C910519F0813C910521F441
:100E300081E080934C0102C010924C0163E087E096
:100E40000E94A20991E0823009F090E090934D0158
:100E5000992341F082EC92E09F938F930E94840645
:100E60000F900F9023E042E063E082E00E94270AA7
:100E700085EB92E09F938F930E9484060F900F90D2
:100E8000C1E0D0E00BE912E063E08C2F0E94A209E0
:100E9000009771F09F938F93DF93CF931F930F93DE
:100EA0000E9484060F900F900F900F900F900F905C
:100EB0008FEF99EF20E0815090402040E1F700C093
:100EC00000002196C031D105F9F6E7E3F1E0119277
:100ED00081E0E734F807D9F70E94F3110E94440932
:100EE0008091BE0181608093BE018BE892E00E94F8
:100EF000EB05569A5E98DF91CF911F910F9108955F
:100F0000CF93DF938FE79BEB0197F1F700C00000D1
:100F10000E94230AEC01009711F481E0C4C097FD00
:100F200005C080914701816080934701D7FF05C0CC
:100F3000809147018E7F809347018D2F99278F7372
:100F40009927AE014F735527C6FF02C0405451097F
:100F5000D6FF02C08054910960913601772767FD62
:100F60007095469F9001479F300D569F300D11247C
:100F700021384FEF340714F421E83FEF31952195E4
:100F8000310921384FEF340714F421E83FEF219560
:100F900020934801869F9001879F300D969F300DCA
:100FA000112421388FEF380714F421E83FEF882708
:100FB0009927821B930B81382FEF920714F481E855
:100FC0009FEF8195809349018091BE0183FF60C0AE
:100FD00085E792E00E94EB05DF93CF938FE692E0E6
:100FE0009F938F930E9484068DE692E00E94EB050A
:100FF0008CE592E00E94EB0520913601822F992723
:1010000087FD90959F932F9387E592E09F938F9311
:101010000E94840685E592E00E94EB0580914701DD
:101020001F928F9380E592E09F938F930E94840696
:101030008EE492E00E94EB0520914801822F9927CF
:1010400087FD90959F932F938BE492E09F938F93CE
:101050000E94840689E492E00E94EB0520914901F8
:10106000822F992787FD90959F932F9386E492E096
:101070009F938F930E94840683E492E00E94EB0585
:101080008DB79EB744960FB6F8949EBF0FBE8DBF26
:1010900087E491E00E9444128091360191E088300B
:1010A0000CF090E0890F80933601DF91CF91089585
:1010B0001F93CF93DF93C0910001D09101018FEF77
:1010C0009FEF9093010180930001CF3F8FEFD807EE
:1010D00009F06AC08FE79BEB0197F1F700C00000B1
:1010E00082E00E94200AEC01009709F05DC0809127
:1010F0004D01882309F458C087E00E94200A009718
:1011000009F452C09C012F77332722303105A1F01A
:1011100048F42115310569F02130310599F48078C2
:101120008A641AC02330310551F02F373105A1F000
:1011300009C08078826410C0807889640DC080788E
:1011400088640AC080E392E09F938F930E94840694
:101150000F900F9081E18EC0292F33272F773327EF
:101160002130310579F050F02230310579F023300B
:10117000310581F4EC01D078D86416C0EC01D07848
:10118000D26412C0EC01D078DA640EC0EC01D078E1
:10119000D9640AC08DE192E09F938F930E948406E8
:1011A0000F900F9080E166C08091BE0181FF18C052
:1011B000209709F45CC089E092E00E94EB05DF9380
:1011C000CF9384E092E09F938F930E94840682E005
:1011D00092E00E94EB050F900F900F900F9003C0CC
:1011E000209709F444C0CF379FE7D90711F48FE760
:1011F00005C0CF3F8FEFD80721F48FEF0E948D06F7
:1012000038C02D2F3327822F1C2F2F3F81F4DF93DF
:10121000CF9384EE91E09F938F930E9484060E9467
:10122000B0060F900F900F900F908C2F23C09091CD
:101230004C01992381F0A9014F775527423351057D
:1012400021F4822F80788A6006C04A30510519F453
:10125000822F807882630E948D061F3F51F0DC2F21
:10126000CC27CF6FD0930101C093000102C080E072
:1012700001C081E0DF91CF911F910895E82FF0E048
:10128000E95CFE4F80810895682F609582E00C94A0
:10129000620A509A83E091E00197F1F700C00000E4
:1012A00050989AEB9A95F1F700C00895509A8AEBFE
:1012B0008A95F1F700C0509883E091E00197F1F72B
:1012C00000C000000895EF92FF920F931F93CF93F9
:1012D000DF93C0E0D0E000E810E0E82EF12C9801A8
:1012E0000C2E02C0359527950A94E2F72E213F2156
:1012F000232B19F00E94560902C00E944909219629
:10130000C830D10561F7DF91CF911F910F91FF9008
:10131000EF900895489B07C023E02A95F1F700005D
:1013200001970097B9F70895489907C023E02A95D7
:10133000F1F7000001970097B9F708955898509871
:1013400008950895CF92DF92EF92FF920F931F932B
:10135000CF93DF931F92CDB7DEB7182FF894509A32
:1013600083EF9BE00197F1F700C0000069830E94C2
:10137000560969816C60E0E11E9FC0011124862B33
:101380000E9463090E94490984EF91E00E94940938
:10139000892B21F4789482EE9FEF48C084EF91E08E
:1013A0000E948A09892B21F4789480E090E03EC065
:1013B00021E1F22EC12CD12C32E8E32E82E890E01C
:1013C0000E9494098C01882359F199270E948A0967
:1013D000882331F1CC0CDD1C9E2D901B081B90172F
:1013E00018F46894C0F807C0F1E1FF1204C07894C3
:1013F0008CEE9FEF1BC0FA9409F78FE591E00E94F5
:101400009409892B21F478948BEE9FEF0FC08BE524
:1014100090E00E948A09892BB1F77894C60106C032
:1014200078948F2D90E09195819591090F90DF919F
:10143000CF911F910F91FF90EF90DF90CF90089583
:1014400060E00C94A20960E083E00C94A2091F9371
:10145000CF93DF9300D01F92CDB7DEB7182FF8944B
:10146000509A83EF9BE00197F1F700C000002B83B7
:101470004A8369830E9456096981862F886090E1BA
:10148000199FF00111248E2B0E9463090E944909C3
:10149000EFE1F3E03197F1F700C000000E94560938
:1014A0004A81842F0E9463092B81822F0E94630945
:1014B0000E94490978940F900F900F90DF91CF917F
:1014C0001F910895262F277040E062E00C94270AB0
:1014D00080915A0108959FB7F894109251019FBFCF
:1014E0009091D301943009F058C09091E9009F7019
:1014F0002091EC0020FF02C020E801C020E0292B51
:1015000094E09093E9009091EB0090FF43C090919C
:10151000EE0097FF3FC090914E01992321F09091EA
:10152000E80095FF37C010924E0196E03091E80038
:1015300035FD15C03091D301343061F53091EB00A9
:1015400035FD28C0915021F481E080934E0122C0E6
:10155000EFE9FFE03197F1F700C00000E7CF80939B
:10156000F1008091E80085FD0AC08091E80080FFCD
:10157000FCCF8091E8008E778093E80006C08FB79B
:10158000F89491E0909351018FBF2F702093E90060
:1015900080E008952F702093E9008FEF0895CF9396
:1015A000DF9300D01F92CDB7DEB72091D301243056
:1015B00019F523E029839B838A832093E9008FEF29
:1015C0009091E800815095FD06C095ED9A95F1F750
:1015D00000008111F5CF8091E80085FF0DC040E04B
:1015E00050E063E070E0CE0101960E94850D80918D
:1015F000E8008E778093E8000F900F900F90DF91B6
:10160000CF910895CF93DF9300D01F92CDB7DEB76F
:101610002091D301243021F522E029839B838A8302
:1016200083E08093E9008FEF9091E800815095FD71
:1016300006C095ED9A95F1F700008111F5CF8091E4
:10164000E80085FF0DC040E050E063E070E0CE01AF
:1016500001960E94850D8091E8008E778093E800C6
:101660000F900F900F90DF91CF9108952091D301AB
:101670002430F1F422E02093E9002FEF3091E800CC
:10168000215035FD06C035ED3A95F1F700002111E6
:10169000F5CF2091E80025FF0BC040E050E065E069
:1016A00070E00E94850D8091E8008E778093E800BD
:1016B0000895CF93DF93EC018091D301843039F505
:1016C00081E08093E9008FEF9091E800815095FDD3
:1016D00006C095ED9A95F1F700008111F5CF809144
:1016E000E80085FF14C040E050E068E070E0CE0103
:1016F0000E94850D8091E8008E778093E80088E055
:10170000FE01A2E5B1E001900D928A95E1F7DF912B
:10171000CF9108958BE293E00E94EB058091D20176
:10172000811109C00E94170F0E94740F8091E2007E
:1017300084608093E200089587E293E00E94EB05C5
:101740001092D2010895089580914F018F5F809388
:101750004F0162E30E941528911135C010924F018C
:1017600080915101882379F18091D301843049F52A
:101770008091E9008F709091EC0090FF02C090E89A
:1017800001C090E0982B84E08093E9008091EB0009
:1017900080FF14C08091EE0087FF10C08091E800A8
:1017A00085FF03C01092F100F9CF8091E80080FF1F
:1017B00005C08091E8008E778093E8009F70909339
:1017C000E90010925101089542E061EC81E00E942D
:1017D000910E42E061EC82E00E94910E42E061ECE9
:1017E00083E00E94910E42E261EC84E00C94910E41
:1017F0008091D501833009F453C030F4813071F009
:10180000823009F48CC008958A3009F478C08B3096
:1018100009F45EC0893009F09AC020C08091D401DB
:10182000813A09F094C08091E800877F8093E800B6
:101830008091D8019091D901892B21F060E080E05E
:1018400090E003C068E082E591E070E00E94CE0D78
:101850008091E8008B778093E80008958091D4010F
:10186000813209F074C08091D8019091D901892BFF
:1018700009F06DC08091E800877F8093E800809137
:10188000E80082FD05C08091D3018111F8CF5FC0CF
:101890008091F10080935A018091E8008B7753C0CA
:1018A0008091D401813A09F052C08091D801909181
:1018B000D901892B09F04BC08091E800877F809384
:1018C000E8008091E80080FFFCCF80910C0136C0D9
:1018D0008091D4018132D9F58091D8019091D901BC
:1018E000892BA9F58091E800877F8093E8000E940A
:1018F000C60E8091D60180930C010C94A1188091A2
:10190000D401813221F58091E800877F8093E8003F
:101910000E94C60E8091D70180935B01089580914B
:10192000D401813AA1F48091E800877F8093E80098
:101930008091E80080FFFCCF80915B018093F100F3
:101940008091E8008E778093E8000C94C60E08958D
:101950000895089580915A018093500110925A0180
:1019600080E00E9444090E9474130C94A1180C9406
:10197000AA0C0E94CE1E8091D101882329F00E94DA
:10198000F41E81110C946F0D089584B7877F84BF76
:1019900088E10FB6F89480936000109260000FBE4B
:1019A00090E080E80FB6F894809361009093610016
:1019B0000FBE8BE69AE00E94A31E8FE193E00E9487
:1019C000EB050E94A80C0E94AB120E94170F0E9408
:1019D000740F8091E20084608093E200789480919B
:1019E000D3018430E1F78EE093E00E94EB050E9482
:1019F000AD1282E091E00E94EE118DEF92E00E9424
:101A0000EB050E94A90C8091D301853019F40E9446
:101A1000B90CF9CF0E94B312F6CF0E94091F809132
:101A2000500180935A0108950C940D0D292F3327EE
:101A300023303105A9F06CF42130310509F442C09E
:101A40002230310509F043C084E790E023E733E01A
:101A500042C021323105C9F02232310519F137C0B7
:101A600099278130910541F08230910541F0892B11
:101A700071F5EFE6F3E005C0EFE5F3E002C0EFE259
:101A8000F3E0849190E09F0126C0643000F5E62FDA
:101A9000F0E0EE0FFF1FEF5DFE4F2081318189E006
:101AA00090E019C0643098F4E62FF0E0DF01AA0F4F
:101AB000BB1FA75EBE4F2D913C91EB5EFE4F808118
:101AC00090E009C082E190E027EE33E004C080E0BE
:101AD00090E020E030E0FA0131832083089580E136
:101AE00089BD82E189BD09B400FEFDCF8091D80097
:101AF0008F7D8093D8008091E00082608093E00029
:101B00008091E00081FDFCCF0895CF92DF92EF92AB
:101B1000FF920F931F93CF93DF937C018B01EA0118
:101B20000E94E70E811131C0209731F088819981A0
:101B3000081B190BE80EF91EC12CD12C011511053B
:101B400019F18091E80085FD14C08091E8008E773E
:101B50008093E800209741F0888199818C0D9D1D2C
:101B60009983888385E011C00E94E70E882331F3B2
:101B70000CC0F70181917F018093F10001501109A0
:101B8000FFEFCF1ADF0ADACF80E0DF91CF911F910C
:101B90000F91FF90EF90DF90CF9008952091DA01A0
:101BA0003091DB012617370748F06115710539F4CC
:101BB0002091E8002E772093E80001C0B901FC01D4
:101BC00020E061157105B9F18091D301882309F4F2
:101BD00040C0853009F43FC08091E80083FD3DC0DE
:101BE0008091E80082FF06C08091E80082FF26C055
:101BF00080E008958091E80080FFE3CF2091F3001A
:101C00008091F20090E0922B6115710551F08830BF
:101C1000910538F421912093F100615071090196EA
:101C2000F3CF21E0089709F020E08091E8008E775B
:101C30008093E800C6CF2111C7CFD6CF8091D301C2
:101C4000882339F0853039F08091E80083FFCCCFCC
:101C500004C082E0089583E0089581E00895209112
:101C6000DA013091DB012617370748F0611571055D
:101C700039F42091E8002E772093E80001C0B901E3
:101C8000FC0120E061157105C1F18091D301882329
:101C900009F441C0853009F440C08091E80083FD1B
:101CA0003EC08091E80082FF06C08091E80082FF7C
:101CB00027C080E008958091E80080FFE3CF209165
:101CC000F3008091F20090E0922B6115710559F0BC
:101CD0008830910540F424912093F10031966150B1
:101CE00071090196F2CF21E0089709F020E0809178
:101CF000E8008E778093E800C5CF2111C6CFD5CFFD
:101D00008091D301882339F0853039F08091E80043
:101D100083FFCBCF04C082E0089583E0089581E083
:101D20000895982F973058F59093E900981739F057
:101D30007091EC002091ED005091F00003C0242F31
:101D4000762F50E021FF19C03091EB003E7F309399
:101D5000EB003091ED003D7F3093ED003091EB00D2
:101D600031603093EB007093EC002093ED005093C2
:101D7000F0002091EE0027FF07C09F5FD3CF8F7048
:101D80008093E90081E0089580E008958091D40176
:101D900087FD05C08091E80080FF0EC012C08091D1
:101DA000E80082FD05C08091D3018111F8CF08952C
:101DB0008091E8008B7708C08091D3018111EACF30
:101DC00008958091E8008E778093E80008958091CF
:101DD000E4009091E50045E62091EC0020FF21C051
:101DE0002091E80020FD21C02091D301222389F019
:101DF000253089F02091EB0025FD0FC02091E400F3
:101E00003091E5002817390739F3415041F0C901F5
:101E1000E3CF82E0089583E0089581E0089584E0AF
:101E200008952091E80022FFDFCF80E008950E940E
:101E3000850F0E948D0FE0EEF0E08081816080834D
:101E4000E8EDF0E080818F77808319BCA7EDB0E0EA
:101E50008C918E7F8C9380818F7E80831092D201B3
:101E600008950F931F93CF93DF930E94850F0E94D5
:101E70008D0FC8EDD0E088818F7788838881806856
:101E8000888388818F7D888319BC1092D30110923A
:101E9000CF011092D1011092D00100EE10E0F801B4
:101EA00080818B7F808388818160888342E060E0CD
:101EB00080E00E94910EE1EEF0E080818E7F8083D1
:101EC000E2EEF0E0808181608083808188608083A1
:101ED000F80180818E7F8083888180618883DF9193
:101EE000CF911F910F910895E8EDF0E080818F7EF2
:101EF0008083E7EDF0E080818160808384E082BFB1
:101F000081E08093D2010C94310FE8EDF0E0808104
:101F10008E7F80831092E20008951092DA00109272
:101F2000E10008951F920F920FB60F9211242F9384
:101F30003F934F935F936F937F938F939F93AF9351
:101F4000BF93EF93FF938091E10082FF0BC08091DC
:101F5000E20082FF07C08091E1008B7F8093E10067
:101F60000E94A40B8091DA0080FF1FC08091D800EE
:101F700080FF1BC08091DA008E7F8093DA00809111
:101F8000D90080FF0DC080E189BD82E189BD09B41F
:101F900000FEFDCF81E08093D3010E948A0B05C033
:101FA00019BC1092D3010E949C0B8091E10080FF2C
:101FB00019C08091E20080FF15C08091E2008E7F01
:101FC0008093E2008091E20080618093E200809142
:101FD000D80080628093D80019BC85E08093D3013B
:101FE0000E94B70C8091E10084FF30C08091E20034
:101FF00084FF2CC080E189BD82E189BD09B400FE67
:10200000FDCF8091D8008F7D8093D8008091E10032
:102010008F7E8093E1008091E2008F7E8093E200CA
:102020008091E20081608093E2008091CF0188235B
:1020300011F084E007C08091E30087FF02C083E0D5
:1020400001C081E08093D3010E94140D8091E100D2
:1020500083FF29C08091E20083FF25C08091E100C9
:10206000877F8093E10082E08093D3011092CF01BB
:102070008091E1008E7F8093E1008091E2008E7F6D
:102080008093E2008091E20080618093E20042E070
:1020900060E080E00E94910E8091F0008860809363
:1020A000F0000E94A30BFF91EF91BF91AF919F9120
:1020B0008F917F916F915F914F913F912F910F90F1
:1020C0000FBE0F901F9018951F920F920FB60F9290
:1020D00011242F933F934F935F936F937F938F932D
:1020E0009F93AF93BF93CF93EF93FF93C091E9007A
:1020F000CF708091EC001092E9008091F000877F12
:102100008093F00078940E94A0101092E9008091D2
:10211000F00088608093F000C093E900FF91EF9198
:10212000CF91BF91AF919F918F917F916F915F916F
:102130004F913F912F910F900FBE0F901F901895C8
:102140001F93CF93DF93CDB7DEB7AA970FB6F8945E
:10215000DEBF0FBECDBFE4EDF1E08091F1008193D1
:1021600021E0EC3DF207C9F70E94F80B8091E800EE
:1021700083FF1CC12091D4013091D501832F90E0C1
:102180008A30910508F012C1FC01EA5AFF4F0C9405
:102190003528203881F0223809F008C18091D80113
:1021A0008F708093E9008091EB0085FB882780F990
:1021B0001092E90006C08091D0019091D101911157
:1021C00082609091E800977F9093E8008093F100FF
:1021D0001092F100C5C0822F8D7F09F0E7C0222345
:1021E00019F0223061F0E2C08091D601813009F00F
:1021F000DDC0333009F080E08093D10128C08091A8
:10220000D601811124C02091D8012F7009F4CEC0CD
:102210002093E9008091EB0080FF19C08091EB00D2
:10222000333011F4806211C080618093EB0081E053
:1022300090E0022E01C0880F0A94EAF78093EA002A
:102240001092EA008091EB0088608093EB0010927E
:10225000E9008091E800877F86C02111A7C0109116
:10226000D6011F778091E3008078812B8093E30073
:102270008091E800877F8093E8000E94C60E8091DD
:10228000E80080FFFCCF8091E30080688093E3004A
:10229000112311F083E001C082E08093D30186C056
:1022A0002058223008F082C08091D6019091D70149
:1022B0008C3D23E0920779F583E08A838AE2898363
:1022C0004FB7F894DE01139620E03EE051E2E32F91
:1022D000F0E050935700E49120FF03C0E295EF70C7
:1022E0003F5FEF708E2F90E0EA3010F0C79601C08C
:1022F000C0968D939D932F5F243149F74FBF8091F6
:10230000E800877F8093E8006AE270E0CE010196E2
:102310000E94CE0D14C0AE014F5F5F4F6091D80197
:102320000E94160D009709F441C02091E800277F14
:102330002093E800BC0189819A810E942F0E809130
:10234000E8008B778093E80031C0203879F58091E0
:10235000E800877F8093E8008091CF018093F100AF
:102360008091E8008E778093E8000E94C60E1EC020
:1023700021111CC09091D6019230C0F48091E800E8
:10238000877F8093E8009093CF010E94C60E8091D2
:10239000CF01811104C08091E30087FF02C084E077
:1023A00001C081E08093D3010E94E40B8091E8009A
:1023B00083FF0AC08091E800877F8093E8008091C6
:1023C000EB0080628093EB00AA960FB6F894DEBF14
:1023D0000FBECDBFDF91CF911F9108959093610102
:1023E000809360010895E0916001F0916101309760
:1023F00021F00190F081E02D099480E00895FF9292
:102400000F931F93CF93DF938C01E0916001F091C4
:102410006101309799F10280F381E02D0995809157
:10242000BE0182FF2BC080FF04C084E095E00E94C3
:10243000EB05E80188E0F82E0EEF14E08091BE0174
:1024400080FF0BC088811F928F931F930F930E9470
:1024500084060F900F900F900F90FA942196F11030
:10246000EDCF8091BE0180FF09C08CEF94E0DF9139
:10247000CF911F910F91FF900C94EB05DF91CF91BD
:102480001F910F91FF900895E0916001F09161011B
:10249000309721F00480F581E02D09940895CF93C1
:1024A000DF93EC0180915E0190915F01C817D9071D
:1024B00009F1D0935F01C0935E01E0916001F0915A
:1024C00061013097B9F00680F781E02DCE010995C2
:1024D0008091BE0182FF0EC080FF0CC0DF93CF93BE
:1024E0008EEE94E09F938F930E9484060F900F903E
:1024F0000F900F90DF91CF910895CF93DF93EC0170
:1025000080915C0190915D01C817D90709F1D093C2
:102510005D01C0935C01E0916001F0916101309731
:10252000B9F00084F185E02DCE0109958091BE01BE
:1025300082FF0EC080FF0CC0DF93CF938EED94E03E
:102540009F938F930E9484060F900F900F900F908F
:10255000DF91CF9108950C9475130E94361F0E944D
:10256000B0060C94A109CF92DF92EF92FF920F93E5
:102570001F93CF93DF9300D000D000D0CDB7DEB74C
:102580000E94580833E6E32E31E0F32E00E010E01D
:10259000C02E802F0E943E09F701D1907F01D826DE
:1025A000B1F40F5F1F4F0031110591F78FEF898351
:1025B0008A831B820E943F1F8160782F9D838C83BA
:1025C00049815A816B818D810E94C81348C09091C6
:1025D000BE0191FF04C08E830E9492138E8120E081
:1025E00030E04D2D50E0922FBA01022E02C07595B9
:1025F00067950A94E2F760FF2CC02983CA82EE2413
:10260000E394F12C02C0EE0CFF1C9A95E2F790E0E7
:102610008E219F2121E0892B09F420E02B830E9449
:102620003F1F8160782F9D838C8349815A816B8104
:102630008D810E94C81349815A816B817C818D8173
:102640000E94BB1EF801ED59FE4F80818E258083CC
:1026500006C02F5F3F4F2830310529F6A2CF0E94D8
:10266000BA1E0E9482220E948007109162010E947D
:10267000F311181741F10E94F311809362019091B8
:10268000BE0192FF0EC090FF0CC01F928F938FE08F
:1026900095E09F938F930E9484060F900F900F9068
:1026A0000F908091620126960FB6F894DEBF0FBEA0
:1026B000CDBFDF91CF911F910F91FF90EF90DF90F1
:1026C000CF900C94CC1E26960FB6F894DEBF0FBEAA
:1026D000CDBFDF91CF911F910F91FF90EF90DF90D1
:1026E000CF9008950C94440908950895CF93DF93F3
:1026F0001F92CDB7DEB769830E943E09282F30E0D4
:1027000081E090E0698102C0880F991F6A95E2F725
:102710002823392381E0232B09F480E00F90DF91F7
:10272000CF910895EF92FF920F931F93CF93DF9372
:1027300088E295E00E94EB05C0E0D0E089E2E82E57
:1027400081E0F82E0AE115E08C2F0E943E090E94DC
:10275000A81EFF92EF921F928F93DF93CF931F9348
:102760000F930E94840621968DB79EB708960FB6E8
:10277000F8949EBF0FBE8DBFC031D10529F7DF9100
:10278000CF911F910F91FF90EF90089508950895B4
:10279000CF93DF93CDB7DEB72B970FB6F894DEBF9C
:1027A0000FBECDBF4F83588769877A878B878A850D
:1027B0009B85892B31F05F3F11F080E003C04F3FD4
:1027C000E1F781E0811107C04F81588569857A85DD
:1027D0008B850E94BB1EDE01119686E0FD011192E1
:1027E0008A95E9F785E0FE01379601900D928A956A
:1027F000E1F749815A816B817C818D819E810E94A4
:102800007F1B2B960FB6F894DEBF0FBECDBFDF91B6
:10281000CF910895CF93C82F882309F4E7C0823859
:10282000A1F40E94F31181FDE1C089E30E94FC1D27
:102830000E947D1E2FEF81EE94E021508040904059
:10284000E1F700C0000089E315C08338C1F40E949D
:10285000F31180FDCBC083E50E94FC1D0E947D1E0C
:102860002FEF81EE94E0215080409040E1F700C0CE
:10287000000083E50E941D1ECF910C947D1E8438BC
:10288000A1F40E94F31182FDB1C087E40E94FC1DF7
:102890000E947D1E2FEF81EE94E0215080409040F9
:1028A000E1F700C0000087E4E5CF8CEF8C0F813AA0
:1028B00048F48C2F0E94A325811198C08C2F0E9470
:1028C000FC1DDACF80E28C0F883048F4C77081E0BD
:1028D00001C0880FCA95EAF70E94411ECDCF8BE553
:1028E0008C0F833078F4C53A29F0C63A31F482E887
:1028F00090E005C081E890E002C083E890E0CF91CD
:102900000C944F1288E58C0F853108F06FC0C83ADF
:1029100061F1C93A69F1CA3A71F1CB3A79F1CC3A2D
:1029200081F1CD3A89F1CE3A91F1CF3A99F1C13B9B
:10293000A1F1C03BA9F1C23BB1F1C33BB9F1C43B2A
:10294000C1F1C53BC9F1C63BD1F1C73BD9F1C83B89
:10295000E1F1C93BE9F1CA3BF1F1CB3BF9F1CC3BE9
:1029600009F03FC08AE292E03EC082EE90E03BC0B8
:1029700089EE90E038C08AEE90E035C085EB90E0BB
:1029800032C086EB90E02FC083EB90E02CC084EB4C
:1029900090E029C087EB90E026C08CEC90E023C04B
:1029A0008DEC90E020C083E891E01DC08AE891E0C2
:1029B0001AC082E991E017C084E991E014C081E275
:1029C00092E011C083E292E00EC084E292E00BC07C
:1029D00085E292E008C086E292E005C087E292E0DC
:1029E00002C080E090E0CF910C947D12CF910895C9
:1029F000882309F466C08238A1F40E94F31181FF94
:102A000060C089E30E94FC1D0E947D1E2FEF81EEB5
:102A100094E0215080409040E1F700C0000089E33D
:102A200015C08338B9F40E94F31180FF4AC083E5D2
:102A30000E94FC1D0E947D1E2FEF81EE94E021502C
:102A400080409040E1F700C0000083E50E941D1E19
:102A50000C947D1E8438A1F40E94F31182FF31C0D2
:102A600087E40E94FC1D0E947D1E2FEF81EE94E002
:102A7000215080409040E1F700C0000087E4E6CF9D
:102A80009CEF980F913A10F390E2980F983050F421
:102A9000877091E001C0990F8A95EAF7892F0E940B
:102AA000471ED6CF9BE5980F933020F480E090E04E
:102AB0000C944F12885A853120F480E090E00C94F9
:102AC0007D120895882321F00E94411E0C947D1EE2
:102AD0000895882321F00E94471E0C947D1E0895BE
:102AE000CF92DF92EF92FF920F931F93CF93DF93DA
:102AF000CDB7DEB728970FB6F894DEBF0FBECDBFB7
:102B00008C0185E0F801DE01119601900D928A9505
:102B1000E1F7F80140813181F280258122952F7003
:102B200083819481892B31F03F3F31F481E04F3F25
:102B300019F403C081E001C080E080FDE1C2498357
:102B40003A8389819A812F830E94BA1D9E83888748
:102B50000E94B91D0E94E11C4E81E42FE295EF70A6
:102B6000F0E0E05AFF4F2F8168850C943528842FC0
:102B7000807F142F1F70882311F01295107FFF2083
:102B800059F0112309F471C2812F68870E94541EE5
:102B90000E947D1E688569C2862F0E94F814112349
:102BA00009F4AEC2812F0E945A1E28960FB6F894DF
:102BB000DEBF0FBECDBFDF91CF911F910F91FF9070
:102BC000EF90DF90CF900C947D1E842F807F942F08
:102BD0009F70E92E803219F0E29480EFE82266239C
:102BE00019F0613001F129C0FF20A9F08E2D2223B8
:102BF00049F1213039F528960FB6F894DEBF0FBEA3
:102C0000CDBFDF91CF911F910F91FF90EF90DF909B
:102C1000CF900C94641E222319F0213009F470C265
:102C20000E94671E2CC0FF20E9F0263008F068C221
:102C30000E943E1E8E2129F022C0FF20F1F02111BA
:102C400015C08E2D28960FB6F894DEBF0FBECDBFEF
:102C5000DF91CF911F910F91FF90EF90DF90CF9078
:102C60000C946215253008F04BC209C0F80185812B
:102C700080FFFBC18F708583E4CF21110AC28E2DA6
:102C800078C1242F26952695237030E02115310533
:102C900021F021303105C9F033C2FF2021F0862F09
:102CA000942F937002C080E090E028960FB6F894BD
:102CB000DEBF0FBECDBFDF91CF911F910F91FF906F
:102CC000EF90DF90CF900C944F12FF2021F0862FD1
:102CD000942F937002C080E090E028960FB6F8948D
:102CE000DEBF0FBECDBFDF91CF911F910F91FF903F
:102CF000EF90DF90CF900C947D12862FFF2019F07B
:102D00000E94082102C00E94702128960FB6F894F4
:102D1000DEBF0FBECDBFDF91CF911F910F91FF900E
:102D2000EF90DF90CF900C94F521842F837009F001
:102D300076C0F110E5C1262F229526952770220F27
:102D4000220F862F8F70C82ED12CE12CF12C022E51
:102D500004C0CC0CDD1CEE1CFF1C0A94D2F764FFEF
:102D600010C06FE070E080E090E004C0660F771F55
:102D7000881F991F2A95D2F7609570958095909538
:102D800003C060E070E0CB01242F269526952370C8
:102D9000422F50E042305105D1F04330510559F1F6
:102DA0006C297D298E299F294130510541F12896B2
:102DB0000FB6F894DEBF0FBECDBFDF91CF911F914C
:102DC0000F91FF90EF90DF90CF900C94F61C6C2940
:102DD0007D298E299F2928960FB6F894DEBF0FBE55
:102DE000CDBFDF91CF911F910F91FF90EF90DF90BA
:102DF000CF900C94081D0E94F61CC701B6012896BE
:102E00000FB6F894DEBF0FBECDBFDF91CF911F91FB
:102E10000F91FF90EF90DF90CF900C94E41CFF2077
:102E200019F0842F817001C08695882309F468C148
:102E3000262F229526952770220F220F862F8F701E
:102E4000C82ED12CE12CF12C022E04C0CC0CDD1CA0
:102E5000EE1CFF1C0A94D2F764FF10C06FE070E014
:102E600080E090E004C0660F771F881F991F2A95A5
:102E7000D2F7609570958095909503C060E070E002
:102E8000CB01242F269526952370422F50E0423007
:102E90005105D1F04330510559F16C297D298E2916
:102EA0009F294130510541F128960FB6F894DEBFB5
:102EB0000FBECDBFDF91CF911F910F91FF90EF908B
:102EC000DF90CF900C94951D6C297D298E299F2928
:102ED00028960FB6F894DEBF0FBECDBFDF91CF911D
:102EE0001F910F91FF90EF90DF90CF900C94A71D52
:102EF0000E94951DC701B60128960FB6F894DEBF53
:102F00000FBECDBFDF91CF911F910F91FF90EF903A
:102F1000DF90CF900C94831D603FD9F128F480E4BA
:102F2000860F803250F09CC0623F09F461C008F403
:102F30004BC0633F09F470C093C0162F1071842FEB
:102F40008F716887FF2059F00E942E1D6885862F9B
:102F5000112319F08295807F75CE8F7073CE0E94F9
:102F6000491D6885862F112319F08295807F01C045
:102F70008F7028960FB6F894DEBF0FBECDBFDF91DD
:102F8000CF911F910F91FF90EF90DF90CF900C9415
:102F90006915FF20A9F0253008F0B2C0842F8F7189
:102FA00028960FB6F894DEBF0FBECDBFDF91CF914C
:102FB0001F910F91FF90EF90DF90CF900C94681DC0
:102FC000263008F09DC0EACFFF20A1F0842F8F713A
:102FD00028960FB6F894DEBF0FBECDBFDF91CF911C
:102FE0001F910F91FF90EF90DF90CF900C942E1DCA
:102FF000FF2061F3842F8F7128960FB6F894DEBFFF
:103000000FBECDBFDF91CF911F910F91FF90EF9039
:10301000DF90CF900C94491DFF2091F0842F8F7189
:1030200028960FB6F894DEBF0FBECDBFDF91CF91CB
:103030001F910F91FF90EF90DF90CF900C941F1D88
:1030400028960FB6F894DEBF0FBECDBFDF91CF91AB
:103050001F910F91FF90EF90DF90CF900C941A1D6D
:10306000FF20A1F0222309F4B1CF862F28960FB6B6
:10307000F894DEBF0FBECDBFDF91CF911F910F91AE
:10308000FF90EF90DF90CF900C940A14222309F464
:10309000B1CF862F28960FB6F894DEBF0FBECDBFF6
:1030A000DF91CF911F910F91FF90EF90DF90CF9024
:1030B0000C94F8144F70C8010E94C81F28960FB6D0
:1030C000F894DEBF0FBECDBFDF91CF911F910F915E
:1030D000FF90EF90DF90CF900C942C1C4F70C801A4
:1030E00028960FB6F894DEBF0FBECDBFDF91CF910B
:1030F0001F910F91FF90EF90DF90CF900C94CB1F1A
:1031000028960FB6F894DEBF0FBECDBFDF91CF91EA
:103110001F910F91FF90EF90DF90CF9008950E9444
:10312000611E0E94301E0E947D1E0E9423230E9469
:10313000F52180E090E00E944F1280E090E00C9436
:103140007D120E94511E0C948F180E94BA1D292FC7
:1031500022952F7030E02C3031054CF42A303105A7
:10316000C4F4225031092230310540F021C02C3006
:103170003105D1F02F303105B9F01AC0853A28F465
:103180008430C0F4823028F415C090E2980F983053
:1031900088F0883E30F4803E68F48450813A40F4F0
:1031A00009C0803F29F406C093FB882780F9089561
:1031B00080E0089581E00895CF93DF9300D000D0A0
:1031C0001F92CDB7DEB70F900F900F900F900F901A
:1031D000DF91CF910895CF93DF9300D000D000D03E
:1031E000CDB7DEB726960FB6F894DEBF0FBECDBFC3
:1031F000DF91CF9108951F93CF93DF93C091730117
:1032000016E080917401C81799F0D0E01C9FF0017E
:103210001D9FF00D1124EB58FE4F408151816281BA
:103220007381848195810E94EB182196C770E9CF44
:10323000DF91CF911F9108954091A5015091A60172
:103240006091A7017091A8018091A9019091AA01B4
:103250000C94EB18CF938091AA0182958F7009F09E
:103260005FC08091A701882309F45AC0209173019F
:10327000A09174016091A5017091A6018091A801AF
:103280009091A90131E06F3F09F030E0B32FC6E023
:103290002A1709F445C0009721F07F3F21F44B2FF6
:1032A00003C041E001C040E030E040FD35C0C29FB6
:1032B000F001C39FF00D1124EB58FE4F41817413B0
:1032C0002BC04081641328C04281411125C0438135
:1032D00054814817590710F441505109481B590BA4
:1032E000483C5105C8F48091AA018F708061809399
:1032F000AA0186E0829FF001839FF00D1124E65819
:10330000FE4F80818F708061808385EA91E00E940A
:103310007015CF910C94FB182F5F3F4F2770B8CFDB
:10332000CF910895CF92DF92EF92FF920F931F9368
:10333000CF93DF93CDB7DEB762970FB6F894DEBFB9
:103340000FBECDBF8C0185E0F801DE011D96019016
:103350000D928A95E1F7D8014C9111965C911197E5
:1033600012966C9112971396ED90FC9014977091B1
:10337000A501E091A6012091A8013091A901211594
:10338000310531F0EF3F31F481E07F3F19F403C0A4
:1033900081E001C080E0B82FB170CB2E80FD6CC100
:1033A000D090A701DD2009F4F5C0F091AA01E21642
:1033B000F30638F0C701821B930B883C910548F057
:1033C0009BC0209530952E0D3F1D283C310508F0FF
:1033D00093C08F2F807F09F052C0E51314C074137F
:1033E00012C0D62E61110FC0FF70F061F093AA01D8
:1033F0000E941C1985EA91E00E9470158091AA0133
:10340000F80185836CC1EF2831F05F3F31F481E032
:103410004F3F19F403C081E001C080E080FD03C08C
:1034200081E0862701C080E0F82FF170FF2E80FF39
:103430001CC0809173012091740136E0821709F459
:1034400028C190E0389FF001399FF00D1124EB580E
:10345000FE4F7181571306C07081471303C07281FC
:10346000671303C001968770E9CFD62E662309F44F
:1034700036C18091AA0181608093AA0153C0E513EF
:1034800008C0741306C0611104C0D8011596FC93DE
:10349000AEC04D875E878D859E856A8B0E94A5187C
:1034A0006A89882329F1D62E662311F12091AA0179
:1034B000822F82958F7090E002970CF460C080910B
:1034C000A5019091A60198878F831986FB86EA86CD
:1034D0002C87CE01079651C0E51731F14D875E87E5
:1034E0008D859E856A8B0E94A5186A8981112EC0E0
:1034F000C8010E947015A4C08F2F807F69F77E2DB0
:10350000F98AE88A89890E94DC1885EA91E00E949C
:103510007015E5EAF1E086E0DF011D928A95E9F792
:103520000E941C19D12CDBC07413D8CF6111D6CFE7
:10353000D8011596FC93C8010E947015E5EAF1E0E8
:1035400086E0DF011D928A95E9F7C9C0D62E662371
:1035500079F22091AA01822F82958F7090E00297D4
:1035600074F08091A5019091A6019A8389831B82B2
:10357000FD82EC822E83CE0101960E94701586E0BA
:10358000F801A5EAB1E001900D928A95E1F70E9459
:103590002A196FC0E216F30628F0C701821B930BAD
:1035A0009C0104C0209530952E0D3F1D283C31050F
:1035B00008F052C0D62E662309F49ACFE5132CC02A
:1035C00074132AC08091AA0180FD1DC0982F929586
:1035D0009F70C9F0D80115968C9315979F3039F0DC
:1035E0009F5F9295907F8F70892B15968C93C80161
:1035F0000E94701586E0F801A5EAB1E001900D92F5
:103600008A95E1F736C086E0F801A5EAB1E00190BD
:103610000D928A95E1F763C04D875E878D859E8503
:103620000E94A518882379F086E0F801A5EAB1E0A8
:1036300001900D928A95E1F70E942A190E941C19A7
:10364000DD24D3944CC08091AA0181608093AA01AB
:10365000C8010E94701543C07E2DF98AE88A8989C5
:103660000E94DC18E5EAF1E086E0DF011D928A9510
:10367000E9F70E941C1933C0662309F439CF4D873E
:103680005E878D859E850E94A518882309F430CF1A
:10369000CBCF4D875E878D859E850E94BA1D292FD1
:1036A00022952F7030E0223031052CF49F7041F0CC
:1036B000811106C00CC0243031052CF49F7049F4F0
:1036C000805E883020F0C8010E947015CF2CDC2C61
:1036D00006C0D80115969C91907F91F7F8CF8D2D5B
:1036E00062960FB6F894DEBF0FBECDBFDF91CF91CB
:1036F0001F910F91FF90EF90DF90CF9008951F934F
:10370000CF93DF93CDB7DEB72C970FB6F894DEBF1B
:103710000FBECDBF4F83588769877A878B879C8779
:10372000CE0107960E9492198823C1F02F81388517
:103730008A859B85892B31F03F3F11F080E003C0E3
:103740002F3FE1F781E0811147C04F81588569859E
:103750007A858B859C850E94EB183EC086E0FE0131
:103760003796DE01119601900D928A95E1F7FF815F
:10377000E8854A855B854115510531F0EF3F31F40D
:1037800081E0FF3F19F403C081E001C080E080FDCB
:1037900023C02091740130E0C901019687709927F8
:1037A0006091730170E086179707F1F1F983EA835E
:1037B0005D834C8396E0929FD001939FB00D1124BE
:1037C000AB58BE4FFE01319601900D929A95E1F7EC
:1037D000809374010E94FB1816E080917301909110
:1037E0007401891779F1189FC00111248B589E4FDD
:1037F0000E949219882331F1E09173011E9FF0011C
:103800001124EB58FE4F4081518162817381848184
:1038100095810E94EB188091730190E0019687706A
:10382000992780937301D9CF0E94A1181092740137
:1038300010927301E5EAF1E086E0DF011D928A95BE
:10384000E9F7CACF2C960FB6F894DEBF0FBECDBFF6
:10385000DF91CF911F910895DF92EF92FF920F9326
:103860001F93CF93DF93FC01009709F48AC0E12CEA
:10387000F12CDD24D394EF0121968491853709F44E
:1038800061C058F4843708F04EC0843008F06AC034
:103890008130D1F0823071F174C0883709F45DC095
:1038A00050F4863709F455C0873709F06AC08E2D69
:1038B0000E944E1E54C09CE7980F903708F061C0DC
:1038C0008F770E94F81450C08F010E5F1F4FFE01CA
:1038D000849190E2980F983050F48770FD2D01C0CC
:1038E000FF0F8A95EAF78F2F0E94541E15C00E9481
:1038F0000A1414C08F010E5F1F4FFE01849190E2E5
:10390000980F983068F48770FD2D01C0FF0F8A95DD
:10391000EAF78F2F0E945A1E0E947D1EE80124C0E4
:103920000E94F814FBCF9F012E5F3F4FFE01C49110
:10393000CC2369F08FE99FE00197F1F700C0000008
:10394000C150F6CF9F012E5F3F4FFE01F490E90179
:103950000BC00E943E1EE82E07C00E94511E0E940E
:103960007D1E02C00E940A149F2D992341F0EFE9A9
:10397000FFE03197F1F700C000009150F6CFFE0153
:103980007ACFDF91CF911F910F91FF90EF90DF9051
:1039900008956093AF017093B0018093B10190934B
:1039A000B2010E94CA1E0C948F186093AB017093F1
:1039B000AC018093AD019093AE010E94CB1E0C949C
:1039C0008F1808950C94C91C0F931F930091AF0199
:1039D0001091B0012091B1013091B201602B712B97
:1039E000822B932B1F910F910C94C91C0F931F9343
:1039F0000091AF011091B0012091B1013091B2015D
:103A000060237123822393231F910F910C94C91C6F
:103A10000F931F930091AF011091B0012091B1015C
:103A20003091B20160277127822793271F910F9150
:103A30000C94C91C60E070E0CB010C94D51C41E0F3
:103A400050E060E070E004C0440F551F661F771F10
:103A50008A95D2F7CB01BA010C94D51C41E050E015
:103A600060E070E004C0440F551F661F771F8A9501
:103A7000D2F78091AB019091AC01A091AD01B091D2
:103A8000AE01482B592B6A2B7B2BCB01BA010C942E
:103A9000D51C41E050E060E070E004C0440F551FC9
:103AA000661F771F8A95D2F740955095609570955F
:103AB0008091AB019091AC01A091AD01B091AE01AC
:103AC000482359236A237B23CB01BA010C94D51CCC
:103AD00041E050E060E070E004C0440F551F661FF5
:103AE000771F8A95D2F78091AB019091AC01A0919C
:103AF000AD01B091AE01482759276A277B27CB013A
:103B0000BA010C94D51C0F931F930091AB01109137
:103B1000AC012091AD013091AE01602B712B822B55
:103B2000932B1F910F910C94D51C0F931F93009111
:103B3000AB011091AC012091AD013091AE01602339
:103B40007123822393231F910F910C94D51C0F9303
:103B50001F930091AB011091AC012091AD01309108
:103B6000AE0160277127822793271F910F910C9434
:103B7000D51C0895CF92DF92EF92FF920F931F937F
:103B8000CF93DF93EC01C090AF01D090B001E090F3
:103B9000B101F090B2018091AB019091AC01A09184
:103BA000AD01B091AE01C82AD92AEA2AFB2A0FE159
:103BB00010E0B701A601002E04C0769567955795D1
:103BC00047950A94D2F740FF07C0BE01802F0E949C
:103BD000E71F8130910539F40150110950F7BE01FA
:103BE00080E00E94E71FDF91CF911F910F91FF901E
:103BF000EF90DF90CF90089540910D0150910E010C
:103C000020E030E09FEFFA01E20FF31F62816817B6
:103C100099F09F3F19F4611101C0922F2F5F3F4F20
:103C20002630310581F79F3F39F0FA01E90FF11D88
:103C300097FDFA9582830895089540910D01509162
:103C40000E0120E030E0FA01E20FF31F9281981399
:103C500001C012822F5F3F4F26303105A1F7089532
:103C600081E090E0E0910D01F0910E01E80FF91F65
:103C70001082019688309105A9F708958091BD01C1
:103C800008959091BD01982B9093BD010895809562
:103C90009091BD0198239093BD0108958093BD013B
:103CA00008951092BD0108959091BC01982B9093B6
:103CB000BC01089580959091BC0198239093BC011C
:103CC00008951092BC0108958093B3010895109255
:103CD000B301089540910D0150910E0120E030E0B4
:103CE00080E0FA01E20FF31F918191118F5F2F5F46
:103CF0003F4F27303105A9F70895E0910D01F0916C
:103D00000E018091BD018083E0910D01F0910E01C3
:103D100080819091BC01892B80839091B30199237C
:103D200061F0E0910D01F0910E018081892B80837B
:103D30000E946A1E81111092B30180910D01909131
:103D40000E010C94FF119093350180933401089576
:103D50008295982F9C7C96959695837344E0849FDA
:103D600090011124922B892F8A7A86959575990F47
:103D7000892B08950895CF93DF9300D000D01F9230
:103D8000CDB7DEB70F900F900F900F900F90DF918F
:103D9000CF910895089508950C9472138091D301E2
:103DA000843009F11092BF0120E488E190E00FB661
:103DB000F894A895809360000FBE2093600083B7AD
:103DC000817F846083BF83B7816083BF7894889547
:103DD00083B78E7F83BF88E10FB6F894809360002D
:103DE000109260000FBE0895CF930E94C6130E94E8
:103DF00058080E94C713C0E08C2F0E943E09811111
:103E000005C0CF5FC031C1F780E001C081E0CF9134
:103E100008950E9474130C94A1181F920F920FB66C
:103E20000F9211248F939F93AF93BF938091BF0103
:103E3000811113C08091C0019091C101A091C20174
:103E4000B091C3014196A11DB11D8093C001909313
:103E5000C101A093C201B093C301BF91AF919F91E3
:103E60008F910F900FBE0F901F90189582E084BD28
:103E700093E095BD9AEF97BD80936E0008952FB79C
:103E8000F8948091C0019091C101A091C201B091BC
:103E9000C3012FBF08952FB7F8946091C0017091AE
:103EA000C1018091C2019091C3012FBF0895CF92AB
:103EB000DF92EF92FF920F931F932FB7F8944091E8
:103EC000C0015091C1016091C2017091C3012FBF27
:103ED0006A017B01EE24FF248C0120E030E0C01653
:103EE000D106E206F30610F441505109481B590B64
:103EF000CA011F910F91FF90EF90DF90CF9008952E
:103F00001F920F920FB60F9211248F939F93AF932E
:103F1000BF938091C0019091C101A091C201B09165
:103F2000C3010196A11DB11D8093C0019093C101F1
:103F3000A093C201B093C301BF91AF919F918F91A4
:103F40000F900FBE0F901F9018950E94170FF894B6
:103F50002FEF87EA91E6215080409040E1F700C0C2
:103F6000000087E090EBDC018093DC019093DD01A1
:103F7000A093DE01B093DF012CE088E190E00FB662
:103F8000F894A895809360000FBE20936000FFCF47
:103F900080E090E008950895E72FF0E090E1899F98
:103FA000E00DF11D112483E0EE0FFF1F8A95E1F76C
:103FB000E60FF11DEC51FF4F84910895E82FF0E0DA
:103FC000EE0FFF1FE05AF0408591949108950E94F2
:103FD000CC1F90E4980F903218F40E94DE1F0895D1
:103FE0008D3B60F4883AA0F5853A38F5843010F5B9
:103FF000813009F088C021E030E087C0883E98F425
:10400000803EC0F48F3B09F07EC00E94A1182FEFC4
:1040100080E792E0215080409040E1F700C000002E
:104020000E94A51F70C0803F08F46DC0282F30E0AB
:1040300030656BC0282F30E068C0853A21F0863AA1
:1040400021F492E803C091E801C093E880E458C0ED
:10405000883A51F1893A51F18A3A51F18B3A51F14A
:104060008C3A51F18D3A51F18E3A51F18F3A51F12A
:10407000813B51F1803B51F1823B51F1833B51F146
:10408000843B51F1853B51F1863B59F1873B59F116
:10409000883B59F1893B59F18A3B59F18B3B59F1E6
:1040A0008C3B61F59AE228C092EE29C099EE27C0B8
:1040B0009AEE25C095EB23C096EB21C093EB1FC071
:1040C00094EB1DC097EB1BC09CEC19C09DEC17C076
:1040D00093E805C09AE803C092E901C094E985E439
:1040E0000FC091E209C093E207C094E205C095E2D7
:1040F00003C096E201C097E286E402C090E084E447
:10410000292F382F02C020E030E0C90108958091A6
:10411000C60180FF0BC06091120185E0689FB0016D
:10412000112475956795759567952AC081FF09C01B
:104130006091120185E0689FB00111247595679523
:104140001FC082FF07C06091120185E0689FB00127
:10415000112416C04091C7014423C9F06091110198
:10416000461788F72091120185E0289F90011124BD
:10417000429FC001439F900D112470E00E942128AE
:104180006038710540F46115710539F002C065E0D1
:1041900070E0862F08958FE7089581E0089580915B
:1041A000C60180FF08C06091100170E075956795A9
:1041B0007595679521C081FF06C06091100170E080
:1041C0007595679519C082FF04C06091100170E079
:1041D00010C08091C7018823C1F060910F0186173C
:1041E000A0F790911001989FC001112470E00E94E7
:1041F00021286038710528F46115710521F0862F9A
:1042000008958FE7089581E0089561E070E0F4CFAC
:10421000803F21F40E948720819504C0813F29F4CA
:104220000E9487208093CA010895823F21F40E9452
:104230008720819504C0833F29F40E9487208093C2
:10424000C9010895893F19F40E94CF2005C08A3F13
:1042500031F40E94CF2081958093CB0108958B3F4C
:1042600021F40E94CF20819504C08C3F29F40E9444
:10427000CF208093CC010895843F21F48091C80120
:10428000816017C0853F21F48091C801826011C010
:10429000863F21F48091C80184600BC0873F21F4E0
:1042A0008091C801886005C0883F31F48091C801C1
:1042B00080618093C80108958D3F21F48091C601EB
:1042C00081600BC08E3F21F48091C601826005C0E1
:1042D0008F3F29F48091C60184608093C6010895C0
:1042E000803F39F48091CA0187FF6CC01092CA01E7
:1042F00069C0813F29F48091CA011816BCF362C0DD
:104300009091C901823F29F497FF5CC01092C901C6
:1043100059C0833F19F41916CCF354C0893F41F4B6
:104320008091CB0118160CF04DC01092CB014AC001
:104330008A3F29F48091CB0187FF44C0F6CF8B3FA1
:1043400039F48091CC0187FF3DC01092CC013AC076
:104350008C3F29F48091CC011816BCF333C0843F04
:1043600021F48091C8018E7F17C0853F21F4809190
:10437000C8018D7F11C0863F21F48091C8018B7FD9
:104380000BC0873F21F48091C801877F05C0883F1B
:1043900031F48091C8018F7E8093C80113C08D3F96
:1043A00021F48091C6018E7F0BC08E3F21F4809155
:1043B000C6018D7F05C08F3F29F48091C6018B7F98
:1043C0008093C6018091C90181110EC08091CA01FC
:1043D00081110AC08091CB01811106C08091CC016E
:1043E000811102C01092C70108958091BE0183FF20
:1043F0007EC08DE595E00E94EB058091C8011F927B
:104400008F9388E595E09F938F930E94840686E5BD
:1044100095E00E94EB052091C901822F992787FD25
:1044200090959F932F9383E595E09F938F930E94A0
:10443000840681E595E00E94EB052091CA01822F58
:10444000992787FD90959F932F938EE495E09F93F6
:104450008F930E9484068CE495E00E94EB052091E6
:10446000CB01822F992787FD90959F932F9389E405
:1044700095E09F938F930E94840687E495E00E94C5
:10448000EB052091CC01822F992787FD90959F9372
:104490002F9384E495E09F938F930E94840681E498
:1044A00095E00E94EB058091C7011F928F938EE3E8
:1044B00095E09F938F930E9484068CE395E00E9481
:1044C000EB058091C6011F928F9389E395E09F933E
:1044D0008F930E94840686E395E00E94EB058DB7DA
:1044E0009EB74C960FB6F8949EBF0FBE8DBF88EC5A
:1044F00091E00E9444120E943F1F9093C501809357
:10450000C40108951F93CF93DF938091C4019091CC
:10451000C5010E94571F4091C701442321F02091FB
:10452000130130E006C0209114015AE0259F90014C
:1045300011248217930708F482C08091C901109159
:10454000CA01D091CB01C091CC01811107C01111DA
:1045500005C0D11103C0CC2309F471C04F3F19F03D
:104560004F5F4093C701181624F40E948720809360
:10457000C9018091C90187FF05C00E9487208195EC
:104580008093C901111624F40E9487208093CA01E8
:104590008091CA0187FF05C00E9487208195809382
:1045A000CA016091C901662339F11091CA01112332
:1045B00019F1772767FD7095872F972F0E9426277F
:1045C00023E333E343E35FE30E948A270E94F32659
:1045D0006093C901612F772767FD7095872F972F0B
:1045E0000E94262723E333E343E35FE30E948A2705
:1045F0000E94F3266093CA011D1624F40E94CF2066
:104600008093CB018091CB0187FF05C00E94CF2012
:1046100081958093CB011C1624F40E94CF208093B7
:10462000CC018091CC0187FF05C00E94CF208195ED
:104630008093CC01DF91CF911F910C94F521DF91F4
:10464000CF911F910895E8ECF1E085E0DF011D9224
:104650008A95E9F71092C7011092C601089580E883
:1046600097E00E94EB051F9281E08F931F9285E0F7
:104670008F9382E397E09F938F930E9484060F901D
:104680000F900F900F900F900F9008958330E9F1E5
:1046900028F4813061F0823009F10895853009F401
:1046A00062C008F449C0863009F474C008952091AE
:1046B0001401862F90E0820F911D8F3F910520F409
:1046C000620F6093140103C08FEF809314018091F7
:1046D00014011F928F938BE696E072C02091130114
:1046E000862F90E0820F911D8F3F910520F4620F7D
:1046F0006093130103C08FEF809313018091130126
:104700001F928F9389E596E05BC020911201862F5E
:1047100090E0820F911D8F3F910520F4620F60930E
:10472000120103C08FEF80931201809112011F923A
:104730008F9386E496E044C020911101862F90E08B
:10474000820F911D8F3F910520F4620F609311013C
:1047500003C08FEF80931101809111011F928F93FD
:1047600081E396E02DC020911001862F90E0820F0A
:10477000911D8F3F910520F4620F6093100103C0DB
:104780008FEF80931001809110011F928F9388E129
:1047900096E016C020910F01862F90E0820F911DA8
:1047A0008F3F910520F4620F60930F0103C08FEFDC
:1047B00080930F0180910F011F928F938DEF95E0F1
:1047C0009F938F930E9484060F900F900F900F90ED
:1047D0000895833081F128F4813059F08230D1F08E
:1047E0000895853009F449C0B8F1863009F456C0FF
:1047F000089580911401681720F4861B809314019A
:1048000002C010921401809114011F928F938EEEBA
:1048100095E054C080911301681720F4861B8093A3
:10482000130102C010921301809113011F928F9304
:104830008CED95E043C080911201681720F4861B2F
:104840008093120102C010921201809112011F92F6
:104850008F9389EC95E032C080911101681720F4A4
:10486000861B8093110102C01092110180911101E9
:104870001F928F9384EB95E021C0809110016817FF
:1048800020F4861B8093100102C0109210018091C9
:1048900010011F928F938BE995E010C080910F015A
:1048A000681720F4861B80930F0102C010920F013D
:1048B00080910F011F928F9380E895E09F938F93D3
:1048C0000E9484060F900F900F900F900895CF9341
:1048D000C82F1F928F9325E838E03F932F930E94B3
:1048E000840661E070E080E090E004C0660F771F0E
:1048F000881F991FCA95D2F70E94E21C0F900F9053
:104900000F900F90CF910C94A118CF93873288F518
:104910008E3108F008C18E3009F486C0D8F4873093
:1049200009F460C08B3009F44FC0863009F0FFC035
:104930008091BE01817F8E7F8093BE018AE898E0DE
:104940000E94EB058EE29BE00E94EB0581E08093E4
:10495000CE0146C0863109F4ADC020F4803109F49F
:1049600078C0E5C0893109F48EC08B3109F449C0A3
:10497000DEC0883349F150F4893209F4D2C085335E
:1049800009F4CFC0873209F0D2C0CBC0833409F418
:10499000C8C028F48A3308F4CAC08953C5C0883413
:1049A00009F0C5C00E94A1188DE19BE00E94EB05B3
:1049B0002FEF83ED90E3215080409040E1F700C05D
:1049C00000000E94A51F0CC081EB98E03FC084E06E
:1049D0009BE00E94EB058091BE0181608093BE0147
:1049E000C1E0AAC08091BE01C82FC17080FFEFCF87
:1049F00080E19BE00E94EB058091BE01817F8E7F6C
:104A00003CC08091BE0181FBCC27C0F991E0C92751
:104A1000C0FB81F98093BE01CC2319F087EF9AE0A7
:104A200027C089EE9AE012C08091BE0182FBCC279C
:104A3000C0F991E0C927C0FB82F98093BE01CC2365
:104A400019F08AED9AE014C08AEC9AE00E94EB0516
:104A5000C7CF8091BE0183FBCC27C0F991E0C92765
:104A6000C0FB83F98093BE01CC2351F08EEB9AE01A
:104A70000E94EB058091BE0181608093BE015CC005
:104A800081EB9AE0E3CF82EA9AE00E94EB058FE7A0
:104A90009AE00E94EB058AE39AE00E94EB0583E12D
:104AA0009AE00E94EB058DED99E00E94EB058FEAFC
:104AB00099E0CCCF81EA99E00E94EB050E94F311C6
:104AC0001F928F9387E899E09F938F930E948406AB
:104AD00080910C011F928F9380E799E09F938F93B1
:104AE0000E94840680915B011F928F938DE599E06F
:104AF0009F938F930E9484060E944B1F9F938F93D6
:104B00007F936F9386E499E09F938F930E9484062E
:104B10008DB79EB742960FB6F8949EBF0FBE8DBF5D
:104B20005FCF80E001C08D510E94672459CF84E49B
:104B300099E00E94EB05C0E08C2FCF91089580E0B2
:104B4000089580E00895CF93C82F8091CE018130E1
:104B500069F020F0823009F446C03DC167E08FE083
:104B60000E947613882309F43CC106C067E08FE0F9
:104B70000E947613882349F08C2F0E949F25811173
:104B80002FC08C2F0E9485242CC08C2F0E94A12521
:104B9000811126C0C431E1F070F4CB3081F0C03116
:104BA000D1F40E942F238DE798E00E94EB0582E06C
:104BB0008093CE0115C0C93259F0C83361F48AE838
:104BC00098E00E94EB0581E898E00E94EB0508C0A0
:104BD0001092CE0104C18BE798E00E94EB05FFC064
:104BE00081E08170FEC0C43228F5CE3108F0C1C02A
:104BF000CB30A1F1D0F4C73009F0D3C08EE180935F
:104C0000140182E3809313018AE08093120184E10E
:104C10008093110188E08093100188E280930F0156
:104C200081E297E00E94EB05BFC0C33149F1C43176
:104C3000C1F0B7C0CB3409F4A9C028F4C93289F057
:104C4000C83361F0AEC0C13509F49EC0C23509F465
:104C500099C0CE3409F0A5C06AE09EC00E942F23FF
:104C6000A3C08091CD01882319F01092CD019CC082
:104C70008EE297E00E94EB0581E08093CE01B1C007
:104C800088E097E00E94EB0586EF96E00E94EB0536
:104C9000809114011F928F9383EF96E09F938F93DF
:104CA0000E94840681EF96E00E94EB058FED96E06E
:104CB0000E94EB05809113011F928F938CED96E07B
:104CC0009F938F930E9484068AED96E00E94EB05E5
:104CD0008BEC96E00E94EB05809112011F928F935E
:104CE00088EC96E09F938F930E94840686EC96E072
:104CF0000E94EB0585EB96E00E94EB058091110187
:104D00001F928F9382EB96E09F938F930E9484066D
:104D100080EB96E00E94EB058BE996E00E94EB05A4
:104D2000809110011F928F9388E996E09F938F9353
:104D30000E94840686E996E00E94EB058FE796E0E4
:104D40000E94EB0580910F011F928F938CE796E0F4
:104D50009F938F930E9484068AE796E00E94EB055A
:104D60008DB79EB748960FB6F8949EBF0FBE8DBF05
:104D70001BC0CE51EC2FF0E0E65DFE4F80818093AA
:104D8000CD0112C061E003C061E006C06AE080911D
:104D9000CD010E94462308C08091CD010E94E923E5
:104DA00003C08FE197E013C08091CD01882369F0A3
:104DB0001F928F9389E197E09F938F930E948406BF
:104DC0000F900F900F900F9004C086E197E00E9423
:104DD000EB0581E006C01092CE0180E002C080E0C9
:104DE00000CFCF91089504D06894B1118DC008957B
:104DF00070D088F09F5790F0B92F9927B751A0F045
:104E0000D1F0660F771F881F991F1AF0BA95C9F75E
:104E100012C0B13081F077D0B1E0089574C0672F2F
:104E2000782F8827B85F39F0B93FCCF3869577950E
:104E30006795B395D9F73EF49095809570956195F7
:104E40007F4F8F4F9F4F0895E89409C097FB3EF422
:104E500090958095709561957F4F8F4F9F4F9923C7
:104E6000A9F0F92F96E9BB279395F6958795779545
:104E70006795B795F111F8CFFAF4BB0F11F460FF05
:104E80001BC06F5F7F4F8F4F9F4F16C0882311F05D
:104E900096E911C0772321F09EE8872F762F05C071
:104EA000662371F096E8862F70E060E02AF09A950C
:104EB000660F771F881FDAF7880F9695879597F901
:104EC000089557FD9058440F551F59F05F3F71F0FA
:104ED0004795880F97FB991F61F09F3F79F0879561
:104EE0000895121613061406551FF2CF4695F1DFEA
:104EF00008C0161617061806991FF1CF869571057A
:104F0000610508940895E894BB2766277727CB01AD
:104F100097F908950BD078C069D028F06ED018F0BA
:104F2000952309F05AC05FC01124EECFCADFA0F369
:104F3000959FD1F3950F50E0551F629FF001729F2E
:104F4000BB27F00DB11D639FAA27F00DB11DAA1F4D
:104F5000649F6627B00DA11D661F829F2227B00D9A
:104F6000A11D621F739FB00DA11D621F839FA00D25
:104F7000611D221F749F3327A00D611D231F849F75
:104F8000600D211D822F762F6A2F11249F575040CC
:104F90008AF0E1F088234AF0EE0FFF1FBB1F661F67
:104FA000771F881F91505040A9F79E3F510570F020
:104FB00014C0AACF5F3FECF3983EDCF3869577955B
:104FC0006795B795F795E7959F5FC1F7FE2B880F1B
:104FD000911D9695879597F9089597F99F6780E8B1
:104FE00070E060E008959FEF80EC089500240A943B
:104FF0001616170618060906089500240A941216B4
:105000001306140605060895092E0394000C11F4E6
:10501000882352F0BB0F40F4BF2B11F460FF04C093
:105020006F5F7F4F8F4F9F4F0895991B79E004C0AA
:10503000991F961708F0961B881F7A95C9F78095D7
:10504000089597FB072E16F4009407D077FD09D03A
:105050000E943B2807FC05D03EF4909581959F4F18
:105060000895709561957F4F0895EE0FFF1F05908D
:10507000F491E02D0994AA1BBB1B51E107C0AA1FA4
:10508000BB1FA617B70710F0A61BB70B881F991FE9
:105090005A95A9F780959095BC01CD010895F89493
:0250A000FFCF40
:1050A200FFFF680A590B360B020BCF0A01B4012825
:1050B20008140A321E404D36229E0451041B04F984
:1050C2000385039E03B703D0030001020304050610
:0450D20007080900C2
:00000001FF

Post your Makefie here. I'm pretty sure that will need to be edited.

Makefile.teensy
Code: [Select]
TARGET = adb_usb_teensy
MCU = atmega32u4
include Makefile

Makefile
[code]# Target file name (without extension).
TARGET ?= adb_usb

# Directory common source filess exist
TMK_DIR ?= ../../tmk_core

# Directory keyboard dependent files exist
TARGET_DIR ?= .

# project specific files
SRC ?=   matrix.c \
   led.c \
   adb.c

CONFIG_H = config.h


# MCU name
# atmega32u4    Teensy2.0
# atemga32u4   TMK Converter rev.1
# atemga32u2   TMK Converter rev.2
MCU ?= atmega32u2

# Processor frequency.
#     This will define a symbol, F_CPU, in all source code files equal to the
#     processor frequency in Hz. You can then use this symbol in your source code to
#  &nbs
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Thu, 06 April 2017, 14:11:46
Rename Makefile (note no extension) to Makefie.orig - that way you can always get it back.

Save this as Makefile (note no extension) and try it again

Code: [Select]
# Target file name (without extension).
TARGET ?= adb_usb

# Directory common source filess exist
TMK_DIR ?= ../../tmk_core

# Directory keyboard dependent files exist
TARGET_DIR ?= .

# project specific files
SRC ?= matrix.c \
led.c \
adb.c

CONFIG_H = config.h


# MCU name
# atmega32u4 Teensy2.0
# atemga32u4 TMK Converter rev.1
# atemga32u2 TMK Converter rev.2
MCU ?= atmega32u4

# Processor frequency.
#     This will define a symbol, F_CPU, in all source code files equal to the
#     processor frequency in Hz. You can then use this symbol in your source code to
#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
#     automatically to create a 32-bit value in your source code.
#
#     This will be an integer division of F_USB below, as it is sourced by
#     F_USB after it has run through any CPU prescalers. Note that this value
#     does not *change* the processor frequency - it should merely be updated to
#     reflect the processor speed set externally so that the code can use accurate
#     software delays.
F_CPU ?= 16000000


#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH ?= AVR8

# Input clock frequency.
#     This will define a symbol, F_USB, in all source code files equal to the
#     input clock frequency (before any prescaling is performed) in Hz. This value may
#     differ from F_CPU if prescaling is used on the latter, and is required as the
#     raw input clock is fed directly to the PLL sections of the AVR for high speed
#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
#     at the end, this will be done automatically to create a 32-bit value in your
#     source code.
#
#     If no clock division is performed on the input clock inside the AVR (via the
#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB ?= $(F_CPU)

# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Boot Section Size in *bytes*
#   Teensy halfKay   512
#   Teensy++ halfKay 1024
#   Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
#   LUFA bootloader  4096
#   USBaspLoader     2048
OPT_DEFS += -DBOOTLOADER_SIZE=512


# Build Options
#   comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes    # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover
ADB_MOUSE_ENABLE = yes
#UNIMAP_ENABLE = yes
#ACTIONMAP_ENABLE = yes         # Use 16bit actionmap instead of 8bit keymap
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor

# ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8


# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax


#
# Keymap file
#
ifdef UNIMAP_ENABLE
    KEYMAP_FILE = unimap
else
    ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
    else
KEYMAP_FILE = keymap
    endif
endif
ifdef KEYMAP
    SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
    SRC := $(KEYMAP_FILE)_plain.c $(SRC)
endif


# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)

include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk
Title: Re: ADB to USB keyboard converter
Post by: mrrm14 on Thu, 06 April 2017, 18:13:39
Tried the new Makefile but still the same issue.

Just so I know and can learn, what did you edit in the Makefile?

I am suspect the keyboard I have is dead :(
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Thu, 06 April 2017, 20:32:42
Tried the new Makefile but still the same issue.

Just so I know and can learn, what did you edit in the Makefile?

I am suspect the keyboard I have is dead :(

I just changed a couple of things to set the Makefile up for a Teensy 2.0:

From "MCU ?= atmega32u2" to "MCU ?= atmega32u4"

From "OPT_DEFS += -DBOOTLOADER_SIZE=4096" to "OPT_DEFS += -DBOOTLOADER_SIZE=512"
Title: Re: ADB to USB keyboard converter
Post by: secutor on Mon, 24 April 2017, 12:57:01
Hello there :)

edit: nevermind, rebooting fixed the issue? lol, ok.

i already got a working converter with a teensy 2 for almost 2 years now, but still didnt fix the iso map or the mechanical caps lock. Today I tried to make an updated hexfile for flashing but after tpying the make command into the Terminal, i'm macOS btw, i just get... nothing. Not a single file is created. Same problem happens when I try to make the file under linux, already installed gcc-avr and dfu-programmer. So is anything wrong or is it my fault?

Here the terminal output:
More
make -f Makefile.teensy clean

-------- begin --------

rm -f adb_usb_teensy.hex
rm -f adb_usb_teensy.eep
rm -f adb_usb_teensy.cof
rm -f adb_usb_teensy.elf
rm -f adb_usb_teensy.map
rm -f adb_usb_teensy.sym
rm -f adb_usb_teensy.lss
rm -f obj_adb_usb_teensy/keymap_plain.o obj_adb_usb_teensy/matrix.o obj_adb_usb_teensy/led.o obj_adb_usb_teensy/adb.o obj_adb_usb_teensy/protocol/lufa/lufa.o obj_adb_usb_teensy/protocol/lufa/descriptor.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.o obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.o obj_adb_usb_teensy/common/host.o obj_adb_usb_teensy/common/keyboard.o obj_adb_usb_teensy/common/matrix.o obj_adb_usb_teensy/common/action.o obj_adb_usb_teensy/common/action_tapping.o obj_adb_usb_teensy/common/action_macro.o obj_adb_usb_teensy/common/action_layer.o obj_adb_usb_teensy/common/action_util.o obj_adb_usb_teensy/common/print.o obj_adb_usb_teensy/common/debug.o obj_adb_usb_teensy/common/util.o obj_adb_usb_teensy/common/hook.o obj_adb_usb_teensy/common/avr/suspend.o obj_adb_usb_teensy/common/avr/xprintf.o obj_adb_usb_teensy/common/avr/timer.o obj_adb_usb_teensy/common/avr/bootloader.o obj_adb_usb_teensy/common/keymap.o obj_adb_usb_teensy/common/mousekey.o obj_adb_usb_teensy/common/command.o
rm -f obj_adb_usb_teensy/keymap_plain.lst obj_adb_usb_teensy/matrix.lst obj_adb_usb_teensy/led.lst obj_adb_usb_teensy/adb.lst obj_adb_usb_teensy/protocol/lufa/lufa.lst obj_adb_usb_teensy/protocol/lufa/descriptor.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.lst obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.lst obj_adb_usb_teensy/common/host.lst obj_adb_usb_teensy/common/keyboard.lst obj_adb_usb_teensy/common/matrix.lst obj_adb_usb_teensy/common/action.lst obj_adb_usb_teensy/common/action_tapping.lst obj_adb_usb_teensy/common/action_macro.lst obj_adb_usb_teensy/common/action_layer.lst obj_adb_usb_teensy/common/action_util.lst obj_adb_usb_teensy/common/print.lst obj_adb_usb_teensy/common/debug.lst obj_adb_usb_teensy/common/util.lst obj_adb_usb_teensy/common/hook.lst obj_adb_usb_teensy/common/avr/suspend.lst obj_adb_usb_teensy/common/avr/xprintf.lst obj_adb_usb_teensy/common/avr/timer.lst obj_adb_usb_teensy/common/avr/bootloader.lst obj_adb_usb_teensy/common/keymap.lst obj_adb_usb_teensy/common/mousekey.lst obj_adb_usb_teensy/common/command.lst
rm -f obj_adb_usb_teensy/keymap_plain.s obj_adb_usb_teensy/matrix.s obj_adb_usb_teensy/led.s obj_adb_usb_teensy/adb.s obj_adb_usb_teensy/protocol/lufa/lufa.s obj_adb_usb_teensy/protocol/lufa/descriptor.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.s obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.s obj_adb_usb_teensy/common/host.s obj_adb_usb_teensy/common/keyboard.s obj_adb_usb_teensy/common/matrix.s obj_adb_usb_teensy/common/action.s obj_adb_usb_teensy/common/action_tapping.s obj_adb_usb_teensy/common/action_macro.s obj_adb_usb_teensy/common/action_layer.s obj_adb_usb_teensy/common/action_util.s obj_adb_usb_teensy/common/print.s obj_adb_usb_teensy/common/debug.s obj_adb_usb_teensy/common/util.s obj_adb_usb_teensy/common/hook.s obj_adb_usb_teensy/common/avr/suspend.s obj_adb_usb_teensy/common/avr/xprintf.s obj_adb_usb_teensy/common/avr/timer.s obj_adb_usb_teensy/common/avr/bootloader.s obj_adb_usb_teensy/common/keymap.s obj_adb_usb_teensy/common/mousekey.s obj_adb_usb_teensy/common/command.s
rm -f obj_adb_usb_teensy/keymap_plain.i obj_adb_usb_teensy/matrix.i obj_adb_usb_teensy/led.i obj_adb_usb_teensy/adb.i obj_adb_usb_teensy/protocol/lufa/lufa.i obj_adb_usb_teensy/protocol/lufa/descriptor.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.i obj_adb_usb_teensy/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.i obj_adb_usb_teensy/common/host.i obj_adb_usb_teensy/common/keyboard.i obj_adb_usb_teensy/common/matrix.i obj_adb_usb_teensy/common/action.i obj_adb_usb_teensy/common/action_tapping.i obj_adb_usb_teensy/common/action_macro.i obj_adb_usb_teensy/common/action_layer.i obj_adb_usb_teensy/common/action_util.i obj_adb_usb_teensy/common/print.i obj_adb_usb_teensy/common/debug.i obj_adb_usb_teensy/common/util.i obj_adb_usb_teensy/common/hook.i obj_adb_usb_teensy/common/avr/suspend.i obj_adb_usb_teensy/common/avr/xprintf.i obj_adb_usb_teensy/common/avr/timer.i obj_adb_usb_teensy/common/avr/bootloader.i obj_adb_usb_teensy/common/keymap.i obj_adb_usb_teensy/common/mousekey.i obj_adb_usb_teensy/common/command.i
rm -f -r .dep
rm -f -r obj_adb_usb_teensy
-------- end --------


thanks in advance :)
nic
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 30 April 2017, 05:38:00
oh, Hasu i could kiss you! &^%$ Brilliant! THANK YOU, THANK YOU, for all your time and effort into these projects.

i just put together an adb to usb converter using a teensy 2.0 i had laying around for another project and it is all that i hoped for and more! (little late to the party i know....)

anyway, looooooong time mac user (started on a IIci at work) & within last 5 years or so have gotten into the mechanical keyboard scene. i bought a Griffin iMate when i managed to get my hands on an apple adjustable keyboard. it does what it's supposed to do, but you can't re-program it etc... this little converter is the best thing that has happened to my old mac keyboards since they were made.

seriously, if there is anyway i can give back or help, testing, etc, anything, please let me know.

ADB boards i have:
ADB Keyboard (IIGS style with stepped keys) - 658-4081
Apple Adjustable (including separate number pad) - M1242
Macally mk96
Apple Design (not that anyone would want to use it, but it is adb) - M2980

... and hope to get some of the m0110 family here soon
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 01 May 2017, 13:44:37
for those getting repeating/missing keystrokes on a freshly resurrected apple adjustable keyboard (one that's been sitting for a long time).... i'm pretty sure this is a issue with the switches in this board and not the firmware/controller. it does get better with use. not sure if the switches get oxidation/film on the contacts or something but it usually just takes some use or repeatedly clicking the switches to get it to start behaving again. i'ts doing it to me right now and it did it to me before when i first got it (many years ago) and was using the iMate adapter. if i remember correctly, this was documented somewhere else before. just wanted to add this little tidbit.

oh, also, after playing with hasu's fantastic firmware for a little bit.... these are some of the smartest function keys i've ever used. (admittedly, very new to custom keyboard firmware. just got a GH60 a couple months ago as a replacement PCB for my KBT Pure that stopped recognizing some keys)

example:
quick click of switch = normal character " ' " (grave accent)
shift + quick click of switch = normal shifted character " ~ " (tilde)
press & hold switch (now acting as function key) = Fn (now add 2nd key to get desired Fn output)

no more dedicated/single use function keys. super smart!

....sorry, gushing again.
Title: Re: ADB to USB keyboard converter
Post by: Mononobe on Mon, 29 May 2017, 09:30:36
Herro, I'm Mononobe, live in Japan.
I want compile .hex fire from Source code for .hex fire, by use Cygwin & AVR.
Can I know how-to "compile & write .hex fire for board "...
finally I want know load map for  "I can use this converter"
Please give me announce or advice, I can't understand wiki very much.

I can use autotranslation. Thank you Regard.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 29 May 2017, 14:00:23
Mononobe, what keyboard do you want to use this with?

There is an online configurator for Hasu's converters: http://www.tmk-kbd.com/tmk_keyboard/editor/index.html
Title: Re: ADB to USB keyboard converter
Post by: Mononobe on Tue, 30 May 2017, 03:51:24
Thanks for your reply, I want to use a square ADB mouse.
The keyboard uses hex file which exists online, and it is usable. ;D
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 30 May 2017, 05:26:50
oh, ok. which type of converter are you using? one purchased from hasu or are you using a teensy with the ADB to USB firmware on it?

Looks like the implementation is already there.
Quote
Mouse support

ADB mouse support was added by @mek-apelsin on Apr,2015. It supports only one button as of now. https://github.com/tmk/tmk_keyboard/pull/207
from: https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb

I have similar hardware & can test it too. (i just have to re-flash back to the ADB firmware, currently running the m0110 firmware)

Typically, the mouse would be connected to the keyboard & the keyboard connected to the converter then obviously the converter to the computer.

The only issue i can think of is if you are using the teensty method & don't have a pullup resistor.

I'll try it later when i get a chance.
Title: Re: ADB to USB keyboard converter
Post by: Mononobe on Tue, 30 May 2017, 07:12:30
Tank you for your Reply.
I use Da Vinci32U board.
I tried your advice on new one.
Finaly I can use Mouse, Thank you! Regard! :cool:
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 30 May 2017, 09:24:10
No problem. Glad you got it working.
Title: Re: ADB to USB keyboard converter
Post by: Tcow1015 on Sat, 17 June 2017, 10:45:40
Tried to build this, no luck. the keyboard is not recognized and mouse pointer randomly jumps around. Here is a picture of my wiring, I looked up the teensy 2.0 pinout and it said that the pin labeled b0 on mine was PD0 but I have a pin labeled D0 so I guess the next step would be to try that, any help would be appreciated.
Thanks!

Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 17 June 2017, 15:13:04
it seems you understand what to do correctly but your soldering is iffy.  I'd recommend to dump existent all wires and resister then do it again from beginning. and use 1k ohm if it is not.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sat, 17 June 2017, 16:41:35
looks like you have a couple wires in the wrong place.

signal should be on PD0 (on my teensy it's labaled D0) looks like you have it on B0

[attachimg=1]

1k ohm pull up resistor between Vcc & PD0 (D0) which is signal
   (check resistor wit with a multimeter if unsure of value)

also make sure you have tapped the right traces on the keyboard

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


reference: https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb
Title: Re: ADB to USB keyboard converter
Post by: superbia on Tue, 20 June 2017, 12:06:38
Quote
Quick start for people who bought 32u4 arduino clones on ebay (5$):

1. get avrdude (for flashing)  :thumb:
2. make the software, as hasu sugested  :thumb:
2. use avrdude to flash the firmware
2.b note: you need to press "reset" once, than fast 2 times to get into bootloader (or if you dont have the button short RST and GND pins), so you need to short it total of 3 times  :thumb:
2.c dont wait long and use this command to flash it $ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_lufa.hex:i          ( replace /dev/ttyACM0 with your port)  :thumb:


I was following my own guide and I face a problem now.
I had to modify my old layout and swap some keys in notepad (i reused my old aekii . c keymap)
These are the steps i used:
$ make -f Makefile clean
$ make -f Makefile [KEYMAP=aekii]
$ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_lufa.hex:i

The last command spits this:
More
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "adb_usb_lufa.hex"
avrdude: can't open input file adb_usb_lufa.hex: No such file or directory
avrdude: read from file 'adb_usb_lufa.hex' failed

avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)

avrdude done.  Thank you.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 20 June 2017, 13:28:57
not familiar with AVRdude, but it sounds like it can't find the file. if you are doing this by a command prompt make sure you have the full file path not just the file name.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Tue, 20 June 2017, 13:53:02
not familiar with AVRdude, but it sounds like it can't find the file. if you are doing this by a command prompt make sure you have the full file path not just the file name.

I am positioned inside tmk_keyboard/converter/adb-usb/
I suspect the process of make changed and the filename changed etc. I hope hasu will help me out  :eek:
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 20 June 2017, 14:17:45
ok. looked it up quick, yes, it is a command prompt program. so, you'll need to specify the full path to your hex file or AVRdude won't be able to find it. should be something like: /Users/*user_name*/Desktop/tmk_keyboard/converter/adb-usb/adb_usb_lufa.hex
this is not what you should copy/paste as we have no idea what your computer username, OS, etc are. but your file path should look something like this and not just the file name "adb_usb_lufa.hex"
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 20 June 2017, 14:24:01
the other option is to navigate {cd change directories} to tmk_keyboard/converter/adb-usb/ within the prompt. then you could just use the filename "adb_usb_lufa.hex"
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 20 June 2017, 21:17:40
With plain 'Makefile' it spits out firmware for TMK converter(with ATMega32u2) now, I don't remember when it changed but long ago. You will have to configure Makefile properly for your controller, you may be able to use Makefile. teensy or rev1 but I don't know.

And you have to give avrdude correct firmware file name, the filename also may be changed but it should be clear with seeing files in the directry.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Wed, 21 June 2017, 03:25:46
With plain 'Makefile' it spits out firmware for TMK converter(with ATMega32u2) now, I don't remember when it changed but long ago. You will have to configure Makefile properly for your controller, you may be able to use Makefile. teensy or rev1 but I don't know.

And you have to give avrdude correct firmware file name, the filename also may be changed but it should be clear with seeing files in the directry.

If I succeed in tweaking the newest version, I will post the results and complete guide.
If not, I will rollback the git to the approximate time of when I made that last post.


UPDATE:
$ make -f Makefile.teensy clean
$ make -f Makefile.teensy [KEYMAP=aekii]
$ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_teensy.hex:i

Using this I was able to flash my 32u4 and the keyboard works but it's not flashed with my layout, but instead with stock us layout.
My layout file https://gist.github.com/anonymous/1c3e7aec0c12827710594ecada57beeb

Is my old layout file valid, and how do I Make it?  :rolleyes:
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 21 June 2017, 04:41:52
With plain 'Makefile' it spits out firmware for TMK converter(with ATMega32u2) now, I don't remember when it changed but long ago. You will have to configure Makefile properly for your controller, you may be able to use Makefile. teensy or rev1 but I don't know.

And you have to give avrdude correct firmware file name, the filename also may be changed but it should be clear with seeing files in the directry.

If I succeed in tweaking the newest version, I will post the results and complete guide.
If not, I will rollback the git to the approximate time of when I made that last post.


UPDATE:
$ make -f Makefile.teensy clean
$ make -f Makefile.teensy [KEYMAP=aekii]
$ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_teensy.hex:i

Using this I was able to flash my 32u4 and the keyboard works but it's not flashed with my layout, but instead with stock us layout.
My layout file https://gist.github.com/anonymous/1c3e7aec0c12827710594ecada57beeb

Is my old layout file valid, and how do I Make it?  :rolleyes:

I think it seems to be still valid, what is actually your problem?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 21 June 2017, 05:00:54
I had the same thing happen. (Tried to specify custom keymap) But don't think I had the map variable  formatted correctly in the prompt, so it was ignored. So what I did was edit my copy of the default keymap and then did the clean, make, again and ended up with firmware with my changes to keymap.

Sent from my SM-G900V using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 21 June 2017, 05:06:32
Might be something happening (or not happening) when a custom keymap and the teensy variables are used at the same time.

Sent from my SM-G900V using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 21 June 2017, 05:12:58
hmm, it seems commands below works for me to compile with my keymap_hasu.c file.

Code: [Select]
$ make -f Makefile.teensy clean
$ make -f Makefile.teensy KEYMAP=hasu

I may be missing somehting, let me know if you find bug.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 21 June 2017, 05:20:42
Ok, that's what I thought. We had the formatting of the line incorrect.

We were using:
$ make -f Makefile.teensy [KEYMAP=aekii]

When it should have been formatted as:
$ make -f Makefile.teensy KEYMAP=aekii

We had the brackets in the line. That's why the custom keymap wasn't being picked up/used.

Thank you.

Sent from my SM-G900V using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 21 June 2017, 06:42:08
oh, ok... unless you are kidding me...

It means that contents within [ ] are optional. You can refer "man man" or this.
https://technet.microsoft.com/en-us/library/cc771080(v=ws.11).aspx

I don't remember when and how I learned this and I assume command line users will find this rule before long. But I may have to explain it not to waste both my time and future users's.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 21 June 2017, 07:19:03
no, no kidding. i can get around terminal & most of this programming stuff, but i'm not a programmer or extremely familiar with all coding variables/formatting, etc.

being green/new & this being a custom firmware, i thought that was how it was supposed to be formatted [with the brackets]

total user error & not knowing the brackets were the indication of the optional variable, and should be removed if you wanted to use that option/variable.

thank you for clarification.
.......learn something new everyday.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Sun, 25 June 2017, 03:30:24
I tried to flash the .hex created with both of these, and It still ignores my layout, uses US instead.

$ make -f Makefile.rev1 keymap=aekii
$ make -f Makefile.teensy KEYMAP=aekii

So the problem must be somewhere else:
here's the output when I make the layout:
https://gist.github.com/anonymous/a0c9a64391f6397804b24f45baadaa4a
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 25 June 2017, 06:00:41
In most cases command line tools are case-sensitive, 'keymap' and 'KEYMAP' is not equivalent.
Use 'KEYMAP'.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Sun, 25 June 2017, 08:28:27
In most cases command line tools are case-sensitive, 'keymap' and 'KEYMAP' is not equivalent.
Use 'KEYMAP'.

 Tried, still nothing... I think my aekii .c file is corrupt....
Title: Re: ADB to USB keyboard converter
Post by: sanitypotion on Wed, 05 July 2017, 22:52:35
Hi, and thank you hasu for your great work. I was wondering if you might be able to help with my M0110-USB setup with Teensy 2.0. With a couple of modifications to the makefile (which seems to be configured for Teensy 3.x by default now?) I was able to get the code onto my Teensy 2.0 just fine. I also soldered pins to either side of the Teensy so I could do the whole thing in a breadboard for now. I've wired the breadboard so that VCC-CLK-DATA-GND are all in a nice line in one corner.

I have a 4P4C connector which I can plug into the breadboard and use the original M0110A's cord, as well as soldered some wires to points on the M0110A's main board that I have found near that connector that correspond to VCC-CLK-DATA-GND. I've used the continuity tester on my multimeter to figure out exactly which wires soldered to the board go with which ones on the 4P4C connector, and determined that there's no shorts and they are in fact connected to the same things.

When I take the wires I've soldered to the M0110A's main board and connect them to the Teensy via the breadboard, everything works just fine. (I press keys on the keyboard and letters show up on the computer screen.) Excellent.

However, when I connect the M0110A to the Teensy via the 4P4C jack plugged into the breadboard, again making sure that all wires are going to the correct places, it does not work (i.e. pressing keys does absolutely nothing). I have tried using 1K and 10K pullup resistors on CLK and DATA as well as on only CLK or only DATA. No luck--it still does not work. The second I remove the 4P4C connector and reconnect the M0110A main board wires, it starts working again.

So I have tested the cable and made sure that the connections are equivalent, and tried weak, strong, and no pullup resistors in different combinations. Yet the main board wires always work, and the 4P4C connector always doesn't work. Am I missing anything? Is it possible that I somehow need even stronger pullups than 1K, or weaker than 10K?

Thank you for any advice you may be able to give.
-sanitypotion
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 05 July 2017, 23:00:39
welcome to geekhack, sanitypotion.
This is unfortunately wrong thread :( M0110A doesn't speak ADB.

This is thread you need. Read first post.
https://geekhack.org/index.php?topic=24965.0
Title: Re: ADB to USB keyboard converter
Post by: dothedog on Fri, 07 July 2017, 00:45:52
Hi Hasu,

I'm getting an error when making my converter. Here is an imgur album of my error and my wiring. I am using a fake chinese teensy but it should work. I believe my adb keyboards work, but I cannot verify since I can't actually use them :p

http://imgur.com/a/cWTgA

(yes, it is plugged in when i test it). I am pretty sure about the wiring (bare is data, white is 5v, red is gnd). I have double-checked it with a continuity test on the pins on the other end.

Here is my code: https://github.com/kgwong/tmk_keyboard/tree/k_adb_usb. I have one commit. I changed some stuff because otherwise my teensy wouldn't light and hid_listen does nothing.

I am running  teensy_loader_cli.exe -mmcu=atmega32u4 -w adb_usb.hex to load to my teensy.

I'm a capable programmer but I don't know much about hardware in general. I own a multimeter and other tools so if you can tell me what to check next that would be really helpful. Thanks  :)
Title: Re: ADB to USB keyboard converter
Post by: dothedog on Sat, 08 July 2017, 01:59:26
So it turns out I had the cable wiring flipped: white is ground red is data, bare is 5.
I also added a pullup resistor.

On my aekii:
Before init:
After init:
debug enabled.
Keyboard start.

ALL lock lights go on but no key presses register. The light on the teensy turns off when plugged in (i don't know what this means, I think it's a good sign?). When the power button on the aek is down, the lock lights are turned off. I received this board untested so I don't know if it should work or not.

on my m0116:
Before init:
Scan: addr:1, reg3:FFE2
Scan: addr:2, reg3:FFE2
Scan: addr:3, reg3:FFE2
Scan: addr:4, reg3:FFE2
Scan: addr:5, reg3:FFE2
Scan: addr:6, reg3:FFE2
Scan: addr:7, reg3:FFE2
Scan: addr:8, reg3:FFE2
Scan: addr:9, reg3:FFE2
Scan: addr:10, reg3:FFE2
Scan: addr:11, reg3:FFE2
Scan: addr:12, reg3:FFE2
Scan: addr:13, reg3:FFE2
Scan: addr:14, reg3:FFE2
Scan: addr:15, reg3:FFE2
After init:
Scan: addr:1, reg3:FFE2
Scan: addr:2, reg3:FFE2
Scan: addr:3, reg3:FFE2
Scan: addr:4, reg3:FFE2
Scan: addr:5, reg3:FFE2
Scan: addr:6, reg3:FFE2
Scan: addr:7, reg3:FFE2
Scan: addr:8, reg3:FFE2
Scan: addr:9, reg3:FFE2
Scan: addr:10, reg3:FFE2
Scan: addr:11, reg3:FFE2
Scan: addr:12, reg3:FFE2
Scan: addr:13, reg3:FFE2
Scan: addr:14, reg3:FFE2
Scan: addr:15, reg3:FFE2
debug enabled.
Keyboard start.
adb_host_kbd_recv: ERROR(-30)

No keypresses register. I also received this keyboard untested.

(http://i.imgur.com/F9OJM1t.jpg)

Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 09 July 2017, 01:48:05
dothedog,
If you are sure about your wiring, keyboard or teensy may be out of order.  You can get another keyboard or teensy to replace and test again.

I can't find any apparent problem from your pics and codes but why do you use uninsulated sheild wire for VCC? It doens't seem to be normal, you may need decent Mini-DIN4 cable.
Title: Re: ADB to USB keyboard converter
Post by: dothedog on Sun, 09 July 2017, 01:59:13
Ahh I just grabbed a cheap SVIDEO cable from amazon. I have one original ADB cable but I don't want to butcher it. I also can't find female 4-pin din connectors to purchase as an alternative to butchering cables.

I opened the aekii today to clean it and there was no signs of damage anywhere. I'd have to find an aek that's known to work and maybe that would help me narrow it down :(. Thanks for your time looking at it, I will keep trying to figure it out.
Title: Re: ADB to USB keyboard converter
Post by: dothedog on Fri, 14 July 2017, 01:18:27
I tested the cable again. Turns out I got it wrong twice. I switched the red and bare wires and now it works :). Thanks so much! Very happy!
Title: Re: ADB to USB keyboard converter
Post by: tristinDLC on Fri, 14 July 2017, 05:37:27
Just picked up an Apple Adjustable Keyboard and would love to get it all hooked up. Reading the OP, I just want to make sure I am 100% sure I'm understanding its capabilities. Under your Updates, you list as of a year ago that the Adjustable media keys are now supported (leading me to believe the converter works with the rest of the board already), but then under Limitations, you mention that the Adjustable keypad may not work... I just want to make sure that the Apple Adjustable Keyboard is fully supported and your Limitations note was about the secondary number pad. Is that correct?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 14 July 2017, 05:54:44
I don't ever have the numpad and don't know whether it work with the converter or not at all.

just try it and report.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 14 July 2017, 06:03:14
the mediakeys on adjustable keyboard are four buttons located on right side of main part. I don't think numpad part has  media keys.
Title: Re: ADB to USB keyboard converter
Post by: tristinDLC on Fri, 14 July 2017, 07:05:21
I don't ever have the numpad and don't know whether it work with the converter or not at all.

just try it and report.


the mediakeys on adjustable keyboard are four buttons located on right side of main part. I don't think numpad part has  media keys.


Correct, only the main keyboard has media keys. I just wanted to make sure that the converter at least worked on the main keyboard before I considered placing an order. I have an Apple Adjustable Keyboard already, but not its matching numpad yet, but when it arrives I would gladly report back on if the converter is successful or not.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Sun, 23 July 2017, 16:41:20
SUCCESS! I Will post the full steps with all commands for linux needed + all configs and files.
I feel like hasu will have to patch somethings.

For now, just few things i need to setup in my keymap file:
What is the $NAME of the key "#" and when shift it gives "~" ????  :eek:
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Sun, 23 July 2017, 17:11:34
What is the $NAME of the key "#" and when shift it gives "~" ????

I think that's:

KC_NONUS_HASH   or abbreviated   KC_NUHS 
Title: Re: ADB to USB keyboard converter
Post by: superbia on Sun, 23 July 2017, 17:32:19
What is the $NAME of the key "#" and when shift it gives "~" ????

I think that's:

KC_NONUS_HASH   or abbreviated   KC_NUHS

They both give me \ and | (with shift), so it's not correct.

EDIT: I don't really care about this key, since it's only a minor issue. But if anyone knows feel free to PM me.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Mon, 24 July 2017, 06:47:03
Steps for flashing ALL 32u4 boards (verified 24.07.2017)
(http://i.imgur.com/kZp3M84.jpg)

COMMANDS:
More
$ make -f Makefile.teensy clean
$ make -f Makefile.teensy KEYMAP=aekii
$ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_teensy.hex:i


NOTES:
More
1) If you need a custom layout, copy an edit a preexisting one (mine's called aekii).
2) Before executing avrdude make sure to press the reset on the MCU 3-4 times really fast to get it into bootloader mode.
3) As for dependencies, adding your user to group that accesses serial ports, rebooting after, installing git, avrdude, and I think arduino cover's pretty much everything else.
4) The converter you can either make from ebay (from $3 nonbranded to teensy branded) or purchase from hasu directly (recommended hassle free)


Complete video of the entire procedure (3 minutes long):
https://asciinema.org/a/MeAYcgFyUm1uJ8P8xtHPmorkH
Title: Re: ADB to USB keyboard converter
Post by: tristinDLC on Thu, 27 July 2017, 04:25:16
For now, just few things i need to setup in my keymap file:
What is the $NAME of the key "#" and when shift it gives "~" ????  :eek:

Sounds like you might be using a US layout in your keymap which would have the 'Esc' register as '~' when used with 'Shift'. Can you pastebin your keymap.c?

From your picture, you have an odd board. In the US, AEKIIs had '#' as 'Shift+3' (with # being above the 3 on the cap), but in the UK the '#' was replaced by '£' (and £ being above the 3 on the cap). To get to either the '£' or the '#' hidden on each board, you would have to type 'Option+3'. Your board looks different than most so I'm not totally sure which of your keys has '#' on a sub-layer though (I do see you're in Croatia, so you have some ANSI variant I'm sure). A full shot of your board and your keymap.c should help us figure out how to get each of your keys in the right spot. If you are using the US layout in your keymap, then to get '#' you will want 'LSFT+3', but if you are using some foreign variation, then you may have more luck with 'LALT+3'.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Fri, 28 July 2017, 14:39:37
For now, just few things i need to setup in my keymap file:
What is the $NAME of the key "#" and when shift it gives "~" ????  :eek:

Sounds like you might be using a US layout in your keymap which would have the 'Esc' register as '~' when used with 'Shift'. Can you pastebin your keymap.c?

From your picture, you have an odd board. In the US, AEKIIs had '#' as 'Shift+3' (with # being above the 3 on the cap), but in the UK the '#' was replaced by '£' (and £ being above the 3 on the cap). To get to either the '£' or the '#' hidden on each board, you would have to type 'Option+3'. Your board looks different than most so I'm not totally sure which of your keys has '#' on a sub-layer though (I do see you're in Croatia, so you have some ANSI variant I'm sure). A full shot of your board and your keymap.c should help us figure out how to get each of your keys in the right spot. If you are using the US layout in your keymap, then to get '#' you will want 'LSFT+3', but if you are using some foreign variation, then you may have more luck with 'LALT+3'.

I found an alternate way to bypass the problem. Even now I have some anomalies when my pc gets auto-shutdown due to low battery, some keys swap places after it resumes from standby/hibernate. But I'm pretty much happy with the results so far. Everyone has slightly different version of keyboard so there should be minor things everyone should be able to fix (like swaping some keys). I'll show you my final aekii.c file that I'm happy with.

More
#include "keymap_common.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_EXT_ISO(
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   NO,
    Z,   1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
    TAB, Q,   W,   F,   P,   B,   J,   L,   U,   Y,   SCLN,   LBRC,RBRC,ENT,      DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    BSPC,A,   R,   S,   T,   G,   K,   N,   E,   I,   O,QUOT,NUHS,                             P4,  P5,  P6,  PPLS,
    LSFT,GRV, X,   C,   D,   V,   NO,   M,   H,   COMM,DOT, SLSH,     RSFT,          UP,           P1,  P2,  P3,
    LCTL,LGUI,LALT,          SPC,                               RALT,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),
};

const action_t PROGMEM fn_actions[] = {
};

Title: Re: ADB to USB keyboard converter
Post by: See Spot Solder on Mon, 14 August 2017, 05:27:10
Hi All,

I'm following this handy little guide to convert the Apple Extended Keyboard II to USB:
http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/ (http://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/)

I followed all of the instructions to the letter but I have a problem. The Teensy 2 powers on when plugged as does the Keyboard Num Lock, Caps Lock and Scroll Lock LEDs. The Teensy' LED is on constantly but flashes every 10 seconds. When it flashes the mouse pointer on the screen moves about an inch to the right.

I'm still a bit new to micro controllers and Hex Code so I can't debug the issue myself, to my eyes it seems all good. I've included the code used and my wiring.

Any advice is much appreciated!

Thanks!


I'm having this same issue. Has anyone found a fix for it or know what to do? I tried the modified makefile for teensys with the same result. Is the only possibility that my keyboard is dead?
Title: Mouse sensitive
Post by: Mononobe on Wed, 23 August 2017, 10:19:49
I'm using this converter with ADB-SQARE mouse.
Is the mouse cursor not moving smoothly, how can I adjust the sensitivity of the mouse cursor?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 23 August 2017, 10:46:25
are you sure about your converter hardware?
I remember my square mouse kind of worked well for me.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 23 August 2017, 11:57:26
I'm using this converter with ADB-SQARE mouse.
Is the mouse cursor not moving smoothly, how can I adjust the sensitivity of the mouse cursor?

If the issue comes from firmware you will be able to tune parameters here.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/matrix.c#L125-L173

Otherwise you may need to improve ADB protocol handling, implementing SRQ may help receiving mouse data more often. Check protocol documents if you are interested.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/adb.c#L266-L272
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 23 August 2017, 19:58:16
I'm using this converter with ADB-SQARE mouse.
Is the mouse cursor not moving smoothly, how can I adjust the sensitivity of the mouse cursor?
Make sure the roller wheels & ball are clean and that there is not any dirt/cob webs on the other end of the roller/wheels (the fins, where they pass through the optical sensor). These old ball mice are very slow even compared to dirt cheap optical mouse (300-600dpi?)
Title: Re: ADB to USB keyboard converter
Post by: Mononobe on Wed, 23 August 2017, 20:48:09
Thanx for your advice.
Will try it in weekend, thanx a lot.
Title: Re: ADB to USB keyboard converter
Post by: applehugger on Wed, 06 September 2017, 18:24:37
Steps for flashing ALL 32u4 boards (verified 24.07.2017)

COMMANDS:
More
$ make -f Makefile.teensy clean
$ make -f Makefile.teensy KEYMAP=aekii
$ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_teensy.hex:i


NOTES:
More
1) If you need a custom layout, copy an edit a preexisting one (mine's called aekii).
2) Before executing avrdude make sure to press the reset on the MCU 3-4 times really fast to get it into bootloader mode.
3) As for dependencies, adding your user to group that accesses serial ports, rebooting after, installing git, avrdude, and I think arduino cover's pretty much everything else.
4) The converter you can either make from ebay (from $3 nonbranded to teensy branded) or purchase from hasu directly (recommended hassle free)


Complete video of the entire procedure (3 minutes long):
https://asciinema.org/a/MeAYcgFyUm1uJ8P8xtHPmorkH

I'm desperately hoping that someone can enlighten me. I've tried and tried but I cannot build firmware for my AEK II. I keep getting the following error:
Code: [Select]
sh: 1: dfu-programmer: not found
sh: 1: dfu-programmer: not found

I get an empty folder called obj_adb_usb_teensy, but no .hex file to load onto my Teensy.

Honestly, I really don't understand why the firmware just isn't provided with this converter like it is with Soarer's converter. I've successfully used Soarer's .hex files on two keyboards and I've remapped a number of keys on my M122 terminal keyboard without issue. However, trying to convert this AEK II keyboard has taken up hours of my time that I wouldn't have wasted if I didn't have to build the firmware manually. As I'm sure anyone can tell, I'm definitely not a programmer; however, I am not new to electronics projects.

FYI, I'm running the make command within a Virtual Machine running Ubuntu Gnome. I appreciate any help anyone can offer.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 06 September 2017, 19:19:49
I'm desperately hoping that someone can enlighten me. I've tried and tried but I cannot build firmware for my AEK II. I keep getting the following error:
Code: [Select]
sh: 1: dfu-programmer: not found
sh: 1: dfu-programmer: not found
I don't think this is really your problem, you can ignore the messages and it means you don't have dfu-programmer. Install it.

Fixed this anyway, it doesn't displays the message now even if you don't have the command.
https://github.com/tmk/tmk_keyboard/commit/9d66875636614172f7323c5986bfc3cf93b15c13

Quote
I get an empty folder called obj_adb_usb_teensy, but no .hex file to load onto my Teensy.

Honestly, I really don't understand why the firmware just isn't provided with this converter like it is with Soarer's converter. I've successfully used Soarer's .hex files on two keyboards and I've remapped a number of keys on my M122 terminal keyboard without issue. However, trying to convert this AEK II keyboard has taken up hours of my time that I wouldn't have wasted if I didn't have to build the firmware manually. As I'm sure anyone can tell, I'm definitely not a programmer; however, I am not new to electronics projects.

FYI, I'm running the make command within a Virtual Machine running Ubuntu Gnome. I appreciate any help anyone can offer.

You can download binary from keymap editor and you can find the link in first post. I regret this didn't save  your and my time.

If you still need to build from source code you better post all output from make.
Title: Re: ADB to USB keyboard converter
Post by: applehugger on Thu, 07 September 2017, 19:47:04
I'm desperately hoping that someone can enlighten me. I've tried and tried but I cannot build firmware for my AEK II. I keep getting the following error:
Code: [Select]
sh: 1: dfu-programmer: not found
sh: 1: dfu-programmer: not found
I don't think this is really your problem, you can ignore the messages and it means you don't have dfu-programmer. Install it.

Fixed this anyway, it doesn't displays the message now even if you don't have the command.
https://github.com/tmk/tmk_keyboard/commit/9d66875636614172f7323c5986bfc3cf93b15c13

Quote
I get an empty folder called obj_adb_usb_teensy, but no .hex file to load onto my Teensy.

Honestly, I really don't understand why the firmware just isn't provided with this converter like it is with Soarer's converter. I've successfully used Soarer's .hex files on two keyboards and I've remapped a number of keys on my M122 terminal keyboard without issue. However, trying to convert this AEK II keyboard has taken up hours of my time that I wouldn't have wasted if I didn't have to build the firmware manually. As I'm sure anyone can tell, I'm definitely not a programmer; however, I am not new to electronics projects.

FYI, I'm running the make command within a Virtual Machine running Ubuntu Gnome. I appreciate any help anyone can offer.

You can download binary from keymap editor and you can find the link in first post. I regret this didn't save  your and my time.

If you still need to build from source code you better post all output from make.

Oh. Well now I feel rather foolish for not noticing that the firmware is available for download on the keymap editor. Thank you very much for your assistance though.
Another member kindly provided me with firmware as well; nothing is working. After some discussion with that gentleman,  we suspect that I need a pullup resistor, which I have on order. Nevertheless, it is extremely nice to have working formware to test with this keyboard. Thanks again for your help and thank you for this great little converter.
Title: Re: ADB to USB keyboard converter
Post by: GHrobson on Sun, 17 September 2017, 14:01:12
Hello Everyone.

I'm hoping one of you can help me. I'm attempting to build an ADB-USB convertor using Teensy 2.0 for a Apple Extended Keyboard II.

Last week after a lot of struggling to build an Teensy ISO firmware hex, I thought I had managed to do it - i managed to load it onto my teensy, but my other parts to actually connect it to my keyboard hadn't arrived yet so I couldn't test it. One odd thing I noticed was whenever the teensy was attached to my Mac running the firmware I built, my cursor would occasionally jump slightly to the left. I assumed that might just be because I hadn't connected my Teensy to a keyboard yet and so I just waited until the rest of my parts arrived.

Today I soldered up my adapter (with a 1k pull up resistor) and connected it to my AEK II - Nothing works at all, I can't type anything whatsoever. And also the weird cursor jumping to the left thing still happens. I used my electronic tester to make sure I wasn't shorting anything and everything seems to be fine there.

Next to try and rule things out I instead downloaded the prebuilt firmware from the TMK Keymap editor - but there isn't a Teensy option and the rev 1 and rev 2 hex files didn't seem to work either since I guess they aren't for the Teensy. Next I uploaded my built hex file to TMK Keymap editor and discovered that all my keys just said 'TRNS' which I assume to mean something went wrong when I built my own firmware. I have tried Googling to find a prebuilt version of the teensy 2.0 version of the firmware but I can't find anything.

So basically, would someone be able to supply me with an ISO Teensy firmware that is known to work so I can see if it works? I was very excited to get this going but I don't seem to be having much luck!

I apologise for how long this post is but I didn't want to leave anything out, just in case there was something obvious I missed - but based on how my firmware comes up blank on TMK Keymap editor - I assume my build was the issue!

Many thanks in advance,

Graham
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 19 September 2017, 15:25:16
Graham,
Mouse cursor problem indicates your pull-up resistor is wrong, check first post again.
Rev1 firmware should works on Teensy and support ISO keyboard, you don't have to compile yourself.
Title: Re: ADB to USB keyboard converter
Post by: rich1051414 on Wed, 20 September 2017, 00:14:38
For some reason, my pins were inverted(mirror reflection) of your guide. Is that because I cut the wrong end? I don't think so, maybe I am just looking at it from the wrong angle xD I hate dyslexia sometimes. I am using an original AEK keyboard.
On my cable, the red wire was 5v, Orange was ground, and black was data. Brown was ignored. Orange being ground is weird enough to make me question existence...
Title: Re: ADB to USB keyboard converter
Post by: GHrobson on Wed, 20 September 2017, 04:58:08
Graham,
Mouse cursor problem indicates your pull-up resistor is wrong, check first post again.
Rev1 firmware should works on Teensy and support ISO keyboard, you don't have to compile yourself.

Thanks for your assistance, I have it working now - I tried soldering the wire and resistor to the other VCC port on the Teensy and it started working right away - I can only assume I must have damaged the trace to the initial VCC port when I soldered the wire and resistor to it the first time round.

My AEK II now works perfectly.
Thank you Hasu and the nice fella who private messaged me and looked over my wiring and soldering for me!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 20 September 2017, 05:22:06
For some reason, my pins were inverted(mirror reflection) of your guide. Is that because I cut the wrong end? I don't think so, maybe I am just looking at it from the wrong angle xD I hate dyslexia sometimes. I am using an original AEK keyboard.
On my cable, the red wire was 5v, Orange was ground, and black was data. Brown was ignored. Orange being ground is weird enough to make me question existence...
which guide are you referring? first post?
I'll fix confusing part of the guide for future diyers.

you cannot depend on wire colors anytime, they are likely to be different cable by cable. use multimeter always.
Title: Re: ADB to USB keyboard converter
Post by: rich1051414 on Wed, 11 October 2017, 12:11:10
For some reason, my pins were inverted(mirror reflection) of your guide. Is that because I cut the wrong end? I don't think so, maybe I am just looking at it from the wrong angle xD I hate dyslexia sometimes. I am using an original AEK keyboard.
On my cable, the red wire was 5v, Orange was ground, and black was data. Brown was ignored. Orange being ground is weird enough to make me question existence...
which guide are you referring? first post?
I'll fix confusing part of the guide for future diyers.

you cannot depend on wire colors anytime, they are likely to be different cable by cable. use multimeter always.
It was My mistake, I was reading the pin out diagram as if it was a male connector, and not a female.
Title: Re: ADB to USB keyboard converter
Post by: KyleGP on Sat, 28 October 2017, 02:09:57
Hi all,

I'm new here.

Wired my Apple design keyboard upto a teensy 2.0 today.

Built and flashed the firmware with no issue.

When I plug the keyboard in, all three lights on the keyboard illuminate bright and normal for a second then turn off. The keyboard does not respond at all when I press keys. When I push the power key on the keyboard, all three lights illuminate when holding that key.

Any ideas what else I further need to do here? I've tried rebuilding the firmware, trying the unimap firmware etc.

I haven't used a pull up resistor with the teensy as I dont have a 1K resistor atm. Would this likely be the problem?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 28 October 2017, 16:07:42
First, you must have pull-up resistor.
Any of 1k-10k works. Without this it is difficult to debug the problem.

Title: Re: ADB to USB keyboard converter
Post by: rich1051414 on Sun, 29 October 2017, 05:59:14
First, you must have pull-up resistor.
Any of 1k-10k works. Without this it is difficult to debug the problem.
Yep, mine wouldn't work AT ALL without a pull up resistor. I assumed I wouldn't need it because I was not going to use a mouse, but the keyboard would not function, period, until I added the pull up resistor.
Title: Re: ADB to USB keyboard converter
Post by: Mononobe on Fri, 10 November 2017, 14:48:32
Even if I hit the Command key on the right it will be recognized as "command key on the left"
How can I distinguish between right and left?
Title: Re: ADB to USB keyboard converter
Post by: _rubik on Mon, 13 November 2017, 19:30:34
So I have followed this guide.. and have run into a bit of a noob issue. I have everything wired correctly (I think), with the pullup resistor.  My computer recognizes the usb device. But when I try to make and flash using dfu-programmer, I get stuck at 'waiting...'. I'm using a pro micro atmega32u4, so I double tap a reset lead to ground and the red light flashes.... Still stuck at waiting....

Any ideas?

Edit: So far I have tried:

make -f Makefile clean
make -f Makefile KEYMAP=plain
make -f Makefile KEYMAP=plain dfu

waiting.... (no matter how many times I reset the board)

--- and my alternate attempt ---

$ avrdude -p atmega32u4 -c avr109 -P /dev/tty.usbmodem81 -U flash:w:adb_usb_teensy.hex:i  (Note: my Pro Micro flashes)

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type =
    Software Version = .; Hardware Version = .
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude: ser_close(): can't reset attributes for device: Device not configured

avrdude done.  Thank you.

--- and ---

$ dfu-programmer atmega32u4 flash adb_usb_teensy.hex

dfu-programmer: no device present.
Title: Re: ADB to USB keyboard converter
Post by: Floofs on Thu, 30 November 2017, 19:14:32
Hello all, thanks for all the hard work you have done! I'm trying to convert a M0116 to usb using teensy 2.0. I wired up the teensy to the board and I'm getting nothing. The firmware was downloaded from the keymap website and I used the teensy GUI to load the hex file. I'm very new to this kind of thing and am hoping it is something simple. Someone please help me get it working. Thanks in advance(https://uploads.tapatalk-cdn.com/20171201/8597073e27b73f7c62d7b09874435124.jpg)(https://uploads.tapatalk-cdn.com/20171201/6161af290dfcd5667c75001918fefb70.jpg)(https://uploads.tapatalk-cdn.com/20171201/44df5f188a512240e2e07b435c15fa41.jpg)

Sent from my SAMSUNG-SM-G935A using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: twin_rotor on Sat, 02 December 2017, 07:28:28
Hello all, thanks for all the hard work you have done! I'm trying to convert a M0116 to usb using teensy 2.0. I wired up the teensy to the board and I'm getting nothing. The firmware was downloaded from the keymap website and I used the teensy GUI to load the hex file. I'm very new to this kind of thing and am hoping it is something simple. Someone please help me get it working. Thanks in advance
Show Image
(https://uploads.tapatalk-cdn.com/20171201/8597073e27b73f7c62d7b09874435124.jpg)
Show Image
(https://uploads.tapatalk-cdn.com/20171201/6161af290dfcd5667c75001918fefb70.jpg)
Show Image
(https://uploads.tapatalk-cdn.com/20171201/44df5f188a512240e2e07b435c15fa41.jpg)


Sent from my SAMSUNG-SM-G935A using Tapatalk

I only see three wires? Either your data or clock is missing,  as you have ground and VCC wired
Title: Re: ADB to USB keyboard converter
Post by: Floofs on Sat, 02 December 2017, 08:34:37
Hello all, thanks for all the hard work you have done! I'm trying to convert a M0116 to usb using teensy 2.0. I wired up the teensy to the board and I'm getting nothing. The firmware was downloaded from the keymap website and I used the teensy GUI to load the hex file. I'm very new to this kind of thing and am hoping it is something simple. Someone please help me get it working. Thanks in advance
Show Image
(https://uploads.tapatalk-cdn.com/20171201/8597073e27b73f7c62d7b09874435124.jpg)
Show Image
(https://uploads.tapatalk-cdn.com/20171201/6161af290dfcd5667c75001918fefb70.jpg)
Show Image
(https://uploads.tapatalk-cdn.com/20171201/44df5f188a512240e2e07b435c15fa41.jpg)


Sent from my SAMSUNG-SM-G935A using Tapatalk

I only see three wires? Either your data or clock is missing,  as you have ground and VCC wired
Ok I'll try that. It was my understanding that the adb converter didn't need a 4th because it was only for the power button

Sent from my SAMSUNG-SM-G935A using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: twin_rotor on Sat, 02 December 2017, 08:41:07
You might be correct. I missed that it was an ADB; I've only put one together for an AT/XT keyboard and haven't looked at the ADB configuration.

EDIT: I am an idiot. Should have paid more attention.  I made the post before I was fully awake and missed which thread this was *smacks forehead*

Title: Re: ADB to USB keyboard converter
Post by: Floofs on Sun, 03 December 2017, 21:16:56
So I got it working by downloading the hex file from https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/binary

For some reason the file downloaded from the keymap editor wasn't working for me. So glad it's working now though! I'm typing this on it! Woooo!! Seriously, big thanks to all the work that hasu and many others have put in. You guys are amazing.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 18 January 2018, 23:51:09
[Firmware update]
Hi folks,
I got a report from some user about lag on typing the other day. Today I confirmed the lag problem and fixed it. Source code in github repo and firmware binary in Keyboard Editor was updated.

You can download new firmware from Keyboard Editor.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb


This problem was related to  ADB mouse support and have been missed for long. Filed it and added some descriptions here. https://github.com/tmk/tmk_keyboard/issues/518

With the new firmware it reads key evernts from keyboard around twice faster than before. That being said, ADB protocol and keyboard controller is not that fast comparing with modern keyboards.
Title: Re: ADB to USB keyboard converter
Post by: myst02 on Tue, 06 March 2018, 14:11:46
Hey everyone!

I'm trying to convert an AEK II to USB using a Teensy 2.0. I've downloaded the converter firmware from GitHub, compiled it and flashed it to the Teensy.

But somehow it's not working, the lights on the keyboard are off and there's no response to pressing keys. I've checked the hid_listen debug log, it shows info up to "Keyboard start." when the keyboard is plugged in, but after that, there's no debug info even when a key is pressed.

I've re-checked my wiring multiple times and it seems to be okay. I'm using the port F0 on the Teensy and I have changed it to F0 in config.h. I've attached some pictures of my wiring.

Thanks for this great project, I would be really happy if someone could help me with this :)
Title: Re: ADB to USB keyboard converter
Post by: senso on Tue, 06 March 2018, 18:29:55
You are missing the ground wire.
Title: Re: ADB to USB keyboard converter
Post by: myst02 on Tue, 06 March 2018, 23:30:51
You are missing the ground wire.
The ground wire should be connected properly (green wire in the picture).

Are the wires connected to the right solder joints on the ADB port? I used this guide, but additionally soldered a 1k resistor. https://ifixit.org/blog/4468/hack-it-better-apple-extended-keyboard-ii/

Sent from my ONEPLUS A3003 using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: senso on Wed, 07 March 2018, 06:44:28
My bad, didn't notice..

What is the pull up value?

Did you also change the DDR, PORT and PIN to DDRF, PORTF and PINF?
Title: Re: ADB to USB keyboard converter
Post by: myst02 on Wed, 07 March 2018, 07:10:02
My bad, didn't notice..

What is the pull up value?

Did you also change the DDR, PORT and PIN to DDRF, PORTF and PINF?
I'm using a 1k 1/8W resistor for pull-up. I've also changed the ports in config.h.

At first, I forgot to change the ports, which caused an error in debug mode and also moved my mouse left all the time.

After I changed it, there are no errors anymore, also the mouse problem has disappeared, so I'm guessing there must be some sort of connection to the keyboard. I really don't know why it won't work :(

Sent from my ONEPLUS A3003 using Tapatalk

Title: Re: ADB to USB keyboard converter
Post by: sniff on Wed, 07 March 2018, 23:57:19
First post so I apologize if I am breaking protocol or this is the wrong thread to post to :( A second apology is for the horrifically confusing way I'm about to describe a behavior I've observed :(

I am typing this out on an Apple AEK (M0115) and have a Teensy 2.0 wired up with the adb-to-usb firmware loaded (slightly modified keymap for some media controls). This has been working great for the most part, but I've noticed my keyboard dropping certain keys if I type them too quickly. I can reproduce the behavior by pressing particular key groups at the same time. I've observed the exact same behavior on an M3501 I modded with the exact same firmware and keymap.

An example is the O and P key. If I press them along with any other key in the same row (at least, the alpha keys) at the same time I get a subset of the keys (or no keys) sent to the console. Pressing I, O, and P together may register from 0 to 2 keys pressed, but never all three. I first noticed this because I type the word "report" a lot at my job and I would sometimes end up missing 3 letters in the word. The "same row" observation may be a red herring--pressing O, P and K has a similar effect.

I can do the same thing with the L and K keys. Pressing them along with another key in the same row at the same time yields anywhere from 0 to 2 keys being registered.

Same with the M and < keys.  Pressing M, <, and > together may yield 0-2 keys.

Other key groupings seem fine. For example, though O and P have issues, I can move over to Q, W, and E in the same row and press them at the same time without issue.

Does this sound familiar to anyone? I'm happy to provide any more information/images/code that could help identify the cause!

I've been building off of this commit: https://github.com/tmk/tmk_keyboard/commit/09d380d31366d3f965b376031964bfd76526f018

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 08 March 2018, 00:27:01
sniff,
You will want to know ghost key problem on keyboard matrix.
https://www.dribin.org/dave/keyboard/one_html/

This page has key matrix of Apple Extended Keyboard II and you can know which key combination have the problem.
http://ttic.uchicago.edu/~cotter/projects/aek2/


EDIT: This problem is related to the keyboard itself, not converter. You can't solve it with converter.
Title: Re: ADB to USB keyboard converter
Post by: pixelpusher on Thu, 08 March 2018, 12:00:02
picked up another ADB board this week.  It's a NIB ortek keyboard with trackball:

https://www.amazon.com/gp/product/B00JE3UZS6/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1


The good deal here is that it actually comes with Pine white switches.  They feel very nice, indeed.  I didn't figure the trackball would work, and it doesn't.  The buttons click on it, however.

The board is decent.  Build quality is fairly budget.  I've give it a 3.5/10.

Do you think it is possible that someone could implement a way to get this trackball working over usb?  I'm torn because I'm thinking about just harvesting the switches out of it, but if the trackball worked, I would keep them in the board.
Title: Re: ADB to USB keyboard converter
Post by: sniff on Thu, 08 March 2018, 13:12:09
sniff,
You will want to know ghost key problem on keyboard matrix.
https://www.dribin.org/dave/keyboard/one_html/

This page has key matrix of Apple Extended Keyboard II and you can know which key combination have the problem.
http://ttic.uchicago.edu/~cotter/projects/aek2/


EDIT: This problem is related to the keyboard itself, not converter. You can't solve it with converter.

Thanks, those were great resources!
Title: Re: ADB to USB keyboard converter
Post by: myst02 on Sat, 10 March 2018, 04:14:43
Since I've posted the last time, I soldered the 5V wire to D0 instead of F0. I also used a 1/4W resistor this time instead of an 1/8W one.
It's still not working. At first I was thinking the keyboard is faulty, but I had the opportunity to test it on an old PowerBook yesterday and it worked flawlessly, so it can't be that.

Still the same, no output in console, no debug info, no mouse jumping, nothing. Tried flashing Teensy and Unimap firmware, doesn't make a difference.
Can anybody help me with this? I don't know what to try anymore...
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 10 March 2018, 18:03:37
download firmware here and flash it. If it doesn't work with this culpirt will be your wiring. Try every wire comination on ADB connector with trial and error.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1
Title: Re: ADB to USB keyboard converter
Post by: ILA on Tue, 13 March 2018, 20:28:59
I am having trouble getting this to work for me. I am trying to use it with an arduino pro micro clone. As far as I can tell from this schematic (https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Pro_Micro_v13b.pdf) I need the pin 3 which should be connected to the needed PD0.

In the terminal I ran the following commands:
Code: [Select]
make -f Makefile.rev1 clean
make -f Makefile KEYMAP=iso
avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_rev1.hex:i

I have attached the pictures of my wiring below. What I'm experiencing is the well known mouse moving a little to the left every second as well as all three leds light up. Of course, no key input.

So far I have tried the 1K, 3K3 and 10K resistors and none seem to make any difference.

Does anyone see any obvious mistakes?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 13 March 2018, 21:04:49
I am having trouble getting this to work for me. I am trying to use it with an arduino pro micro clone. As far as I can tell from this schematic (https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Pro_Micro_v13b.pdf) I need the pin 3 which should be connected to the needed PD0.

In the terminal I ran the following commands:
Code: [Select]
make -f Makefile.rev1 clean
make -f Makefile KEYMAP=iso
avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_rev1.hex:i

I have attached the pictures of my wiring below. What I'm experiencing is the well known mouse moving a little to the left every second as well as all three leds light up. Of course, no key input.

So far I have tried the 1K, 3K3 and 10K resistors and none seem to make any difference.

Does anyone see any obvious mistakes?

You need 5V pro micro are your one is 3.3V? Probably you can mod it to 5V.

[edit] Probably you can convert 3.3V Pro Micro into 5V by shorting solder jumper J1.
Title: Re: ADB to USB keyboard converter
Post by: ILA on Tue, 13 March 2018, 21:37:50
I am having trouble getting this to work for me. I am trying to use it with an arduino pro micro clone. As far as I can tell from this schematic (https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Pro_Micro_v13b.pdf) I need the pin 3 which should be connected to the needed PD0.

In the terminal I ran the following commands:
Code: [Select]
make -f Makefile.rev1 clean
make -f Makefile KEYMAP=iso
avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_rev1.hex:i

I have attached the pictures of my wiring below. What I'm experiencing is the well known mouse moving a little to the left every second as well as all three leds light up. Of course, no key input.

So far I have tried the 1K, 3K3 and 10K resistors and none seem to make any difference.

Does anyone see any obvious mistakes?

You need 5V pro micro are your one is 3.3V? Probably you can mod it to 5V.

[edit] Probably you can convert 3.3V Pro Micro into 5V by shorting solder jumper J1.

Must say that you've got me thinking there for a while so I decided to measure it. Measured Vcc to Gnd and you can see it's (almost) 5V.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 13 March 2018, 21:59:05
If VCC(not RAW) is 5V and crystal is 16MHz your Pro Micro is good. Then your wiring or keyboard is culprit now.
Title: Re: ADB to USB keyboard converter
Post by: ILA on Wed, 14 March 2018, 06:02:23
If VCC(not RAW) is 5V and crystal is 16MHz your Pro Micro is good. Then your wiring or keyboard is culprit now.

Indeed, it's from Vcc and the crystal is 16MHz. The wiring is shown on the pictures above. It should be OK, but a second opinion is always great to have. As for the keyboard, sadly, I don't have a way to test it as I don't have a Mac nor an oscilloscope... Anything else I could do?

The keyboard is AEKII with an ISO layout btw.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 14 March 2018, 07:25:32
If VCC(not RAW) is 5V and crystal is 16MHz your Pro Micro is good. Then your wiring or keyboard is culprit now.

Indeed, it's from Vcc and the crystal is 16MHz. The wiring is shown on the pictures above. It should be OK, but a second opinion is always great to have. As for the keyboard, sadly, I don't have a way to test it as I don't have a Mac nor an oscilloscope... Anything else I could do?

The keyboard is AEKII with an ISO layout btw.

Try to short the soder jumper even if you got 5V Pro Micro. It seems that some people had problem with old keyboard and solved with shorting.
https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448-240.html#p358362

With some internet searchs someone says 5V Pro Micro has 5V regulator for some reason. I guess the reglator may not be good enough for old power-hog keyboard and shorting the solder jumper can solve it perhaps.

Title: Re: ADB to USB keyboard converter
Post by: ILA on Wed, 14 March 2018, 08:49:13
Try to short the soder jumper even if you got 5V Pro Micro. It seems that some people had problem with old keyboard and solved with shorting.
https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448-240.html#p358362

With some internet searchs someone says 5V Pro Micro has 5V regulator for some reason. I guess the reglator may not be good enough for old power-hog keyboard and shorting the solder jumper can solve it perhaps.

Just soldered J1 and still nothing. I've even soldered a 10K resistor between Vcc and pin 3 just to be sure that the contact is good. I've measured 5.21V between Vcc and Gnd when connected to the keyboard so this shouldn't be the issue anymore. Any other ideas?

Tried it with a 3K3 resistor as well as attaching it to the rear USB, and still the same.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Thu, 15 March 2018, 03:01:48
Try to short the soder jumper even if you got 5V Pro Micro. It seems that some people had problem with old keyboard and solved with shorting.
https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448-240.html#p358362

With some internet searchs someone says 5V Pro Micro has 5V regulator for some reason. I guess the reglator may not be good enough for old power-hog keyboard and shorting the solder jumper can solve it perhaps.

Just soldered J1 and still nothing. I've even soldered a 10K resistor between Vcc and pin 3 just to be sure that the contact is good. I've measured 5.21V between Vcc and Gnd when connected to the keyboard so this shouldn't be the issue anymore. Any other ideas?

Tried it with a 3K3 resistor as well as attaching it to the rear USB, and still the same.

Personally, seeing your LED's light up, I take it your power works (you've got 5v), and the signal is what is not working.
I'd replace the signal wire with a new wire (wires are known to be cheap and nasty), use 1k resistor.
And based on the Wiring diagram, I'd try to swap o2 and 1o and see if that makes a difference.
If it's still dead, then you didn't flash it correctly, or your pins and ports are fried.

Systematic approach to find the problem:

I. Microcontroller
More
  • Disconnect everything from your microcontroller (you only need reset button
  • Use arduino IDE to upload a blinky example to your microcontroller (increase blink time to 5 seconds, and blink the ports and pins you plan to use with your keyboard)
  • Use voltmeter to verify your pin's change from 0 to 5 volts, and vice versa


II. Firmware
More
  • Disconnect everything from your microcontroller (you only need reset button)
  • Watch and follow the asciinema video I posted few posts ago, and check if your output matches mines
  • Use voltmeter to verify the blinky firmware was overwritten


III. Wiring
More
  • Remove everything from your breadboard (you need reset button)
  • Verify all of your breadboard wires work (even when twisted around connectors)
  • Double-check all of your ports and pins on the microcontroller
  • Start connecting according to the schematic found here https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb
  • You could try swaping o2 and 1o (always disconnect keyboard before hot-swapping wires)


tl;dr
Title: Re: ADB to USB keyboard converter
Post by: ILA on Fri, 16 March 2018, 04:24:47
Ok, so I've tried the process all over again. I see that I've made a mistake in my original post. The second command I use is obviously "make -f Makefile.rev1 KEYMAP=iso", instead of just Makefile.

Anyway, since I have two Pro Micros at hand, one is with the J1 jumped, and the other is not. The 5 second blink sketch works as it should, but the thing I've noticed between the two boards is that the "unjumped" one outputs only 4.6V on pin 3 where the jumped one outputs a nice 4.97V so there is a definite need for the jumper.
Now, ever since day one, I've noticed that both boards behave a bit strange meaning that the blink sketch had some interference. Now I know that it's probably because it uses pin 17 for the integrated led and i just figured that the PC pings the board from time to time and that's why it blinked randomly. The second thing I've noticed is that it's registered as a Leonardo instead of a pro micro. Now that shouldn't be too surprising since the pro micro runs just a modified Leonardo bootloader, but I figured that I would reflash the bootloader just in case. I've used the Arduino as ISP method and selected the board to be the Sparcfun pro micro, 5V@16MHz and flashed it. After that, it just seems that the ROM is corrupt or not partitioned right. I can upload a small sketch like a blink sketch and right after the bootloader flash (first upload after the flash), but when I tried to upload tmk (second upload), it froze on 12% the first time. After a bootloader reflash, tmk upload froze on 10%. Third time arround on 5%, but it's not degrading, it just hangs at random... I've even tried to upload tmk on first upload, but I get the same results. Note that that is on a pro micro with jumped J1 so maybe something is going on there and I will try to flash it without J1.

The problem is that my vacation is now over, so I won't have time to work on this until April... So as much as this looked like a long report to you, it'll serve as a backlog for me to know what I've done when I get back to this.

In the meantime, I'm thinking of ordering a new pro micro from a different vendor and see if that would make any difference.

I'll get back to you as soon as I've made any progress.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Fri, 16 March 2018, 05:15:43
Ok, so I've tried the process all over again. I see that I've made a mistake in my original post. The second command I use is obviously "make -f Makefile.rev1 KEYMAP=iso", instead of just Makefile.

Anyway, since I have two Pro Micros at hand, one is with the J1 jumped, and the other is not. The 5 second blink sketch works as it should, but the thing I've noticed between the two boards is that the "unjumped" one outputs only 4.6V on pin 3 where the jumped one outputs a nice 4.97V so there is a definite need for the jumper.
Now, ever since day one, I've noticed that both boards behave a bit strange meaning that the blink sketch had some interference. Now I know that it's probably because it uses pin 17 for the integrated led and i just figured that the PC pings the board from time to time and that's why it blinked randomly. The second thing I've noticed is that it's registered as a Leonardo instead of a pro micro. Now that shouldn't be too surprising since the pro micro runs just a modified Leonardo bootloader, but I figured that I would reflash the bootloader just in case. I've used the Arduino as ISP method and selected the board to be the Sparcfun pro micro, 5V@16MHz and flashed it. After that, it just seems that the ROM is corrupt or not partitioned right. I can upload a small sketch like a blink sketch and right after the bootloader flash (first upload after the flash), but when I tried to upload tmk (second upload), it froze on 12% the first time. After a bootloader reflash, tmk upload froze on 10%. Third time arround on 5%, but it's not degrading, it just hangs at random... I've even tried to upload tmk on first upload, but I get the same results. Note that that is on a pro micro with jumped J1 so maybe something is going on there and I will try to flash it without J1.

The problem is that my vacation is now over, so I won't have time to work on this until April... So as much as this looked like a long report to you, it'll serve as a backlog for me to know what I've done when I get back to this.

In the meantime, I'm thinking of ordering a new pro micro from a different vendor and see if that would make any difference.

I'll get back to you as soon as I've made any progress.

tl;dr This only confirms there is yet any errors to be found related with actual firmware, actual 32u4 arhitecture, wiring and your AEKII.
I wrote it many times that it's just not worth it making it yourself because in the end the time costs more than the real thing.
Title: Re: ADB to USB keyboard converter
Post by: Blaise170 on Fri, 16 March 2018, 08:41:43
It depends a lot on the hardware. If you can find a good vendor with good Arduinos, then it is relatively quick to make it yourself. I flashed a Leonardo a few years ago and it worked the first time I plugged it in. Only took about 30 minutes of my time.
Title: Re: ADB to USB keyboard converter
Post by: Mattelec on Mon, 19 March 2018, 04:39:41
Im just a new one in the AEK neighborhood  ;D

Related to the ISO layout, is it possible to modify the keys? I've the layout almost done but as I use the Spanish layout, a few keys are different. I used the TMK Keymap editor, but I'm missing few as Ρ or the symbols "><".

I guess I should use a hex editor so it will be easier but I've never used one. I have a Pro Mini ready for the task

Any advive
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 19 March 2018, 06:14:19
Im just a new one in the AEK neighborhood  ;D

Related to the ISO layout, is it possible to modify the keys? I've the layout almost done but as I use the Spanish layout, a few keys are different. I used the TMK Keymap editor, but I'm missing few as Ρ or the symbols "><".

I guess I should use a hex editor so it will be easier but I've never used one. I have a Pro Mini ready for the task

Any advive

Computer world is absolutely US-centric and you have to think in US-QWERTY way, for example you have to use ';'(KC_SCLN) for  Ρ in Spanish keyboard.

As for ISO specific keys, refer to UK layout, UK is big brother of other Europe contries as you expect. Use 'ISO \'(KC_NUBS) and 'ISO #'(KC_NUHS) namely.

This is woe of minorities, such as us from rest of the world :)
Title: Re: ADB to USB keyboard converter
Post by: Mattelec on Mon, 19 March 2018, 16:07:57
Im just a new one in the AEK neighborhood  ;D

Related to the ISO layout, is it possible to modify the keys? I've the layout almost done but as I use the Spanish layout, a few keys are different. I used the TMK Keymap editor, but I'm missing few as Ρ or the symbols "><".

I guess I should use a hex editor so it will be easier but I've never used one. I have a Pro Mini ready for the task

Any advive

Computer world is absolutely US-centric and you have to think in US-QWERTY way, for example you have to use ';'(KC_SCLN) for  Ρ in Spanish keyboard.

As for ISO specific keys, refer to UK layout, UK is big brother of other Europe contries as you expect. Use 'ISO \'(KC_NUBS) and 'ISO #'(KC_NUHS) namely.

This is woe of minorities, such as us from rest of the world :)

The way it works, could it be that the converter knows the layout of the keyboard and it transfers the pulsations to the PC?
If not, if I program the keys, for example the Ρ as ";" , will the PC show in the screen Ρ or ";" ?

I'm quite a noobie in this topic  :-[
Title: Re: ADB to USB keyboard converter
Post by: ILA on Tue, 20 March 2018, 05:03:09
The way it works, could it be that the converter knows the layout of the keyboard and it transfers the pulsations to the PC?
If not, if I program the keys, for example the Ρ as ";" , will the PC show in the screen Ρ or ";" ?

I'm quite a noobie in this topic  :-[

The keyboard always sends a ";" code and it is up to the OS to interpret that code the way it wants. So in short, just chose the ISO layout and set your input language on the OS to be ES and you'll get your special characters, the keyboard doesn't and shouldn't know the localization of your OS.
Title: Re: ADB to USB keyboard converter
Post by: rich1051414 on Tue, 20 March 2018, 07:42:32
The way it works, could it be that the converter knows the layout of the keyboard and it transfers the pulsations to the PC?
If not, if I program the keys, for example the Ρ as ";" , will the PC show in the screen Ρ or ";" ?

I'm quite a noobie in this topic  :-[

The keyboard always sends a ";" code and it is up to the OS to interpret that code the way it wants. So in short, just chose the ISO layout and set your input language on the OS to be ES and you'll get your special characters, the keyboard doesn't and shouldn't know the localization of your OS.
Ah yes, the complete confusion when you change the region of someone's keyboard. It is hilarious when you do it to someone else.
I believe keyboards(if USB) can report itself as being of a specific region and layout. Macintosh actually doesn't like it when the keyboard doesn't report it's language region and layout.
Title: Re: ADB to USB keyboard converter
Post by: iand on Wed, 04 April 2018, 10:07:45
Thanks @Hasu for all your brilliant work on the ADB converter ;D.
I upgraded my Teensy 2.0/AEKII usb>adb firmware from 2015 version to the 2018 version and noticed a problem with the Non-US backslash character (NUBS) that wasn't present in the 2015 version.  After I successfully uploaded the 2018 ISO firmware using the Teensy App the NUBS character works as expected using my Mac OS X British keyboard layout.  When I disconnect the power the USB and reconnect the NUBS key is subbed with the GRV (§) key which on my UK keyboard is the key to the left of the 1 key.  I can disconnect and reconnect USB but the problem remains.  If I re-upload the firmware the NUBS returns but only until power is reset.I have checked that I am using the most updated git version and I've used the default ISO keymap file unchanged. Any ideas what this problem might be?

Code: [Select]
make -f Makefile.teensy keymap=iso
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 04 April 2018, 11:57:35
@iand
The firmware includes auto-detect ISO support and it may cause. When you use ISO keyboard you have to plug it into the converter *before* pluging USB.

Can you show me debug mesages on 'hid_listen' when the converter starts up. it would be helpful.
Title: Re: ADB to USB keyboard converter
Post by: superbia on Thu, 05 April 2018, 02:26:17
Thanks @Hasu for all your brilliant work on the ADB converter ;D.
I upgraded my Teensy 2.0/AEKII usb>adb firmware from 2015 version to the 2018 version and noticed a problem with the Non-US backslash character (NUBS) that wasn't present in the 2015 version.  After I successfully uploaded the 2018 ISO firmware using the Teensy App the NUBS character works as expected using my Mac OS X British keyboard layout.  When I disconnect the power the USB and reconnect the NUBS key is subbed with the GRV (§) key which on my UK keyboard is the key to the left of the 1 key.  I can disconnect and reconnect USB but the problem remains.  If I re-upload the firmware the NUBS returns but only until power is reset.I have checked that I am using the most updated git version and I've used the default ISO keymap file unchanged. Any ideas what this problem might be?

Code: [Select]
make -f Makefile.teensy keymap=iso

I've had the same thing happen to me, my solution was to plug/unplug and suspend/resume (I don't know the exact order) for my operating system to swap them again. Once they are 'correct' they usually stay 'correct' until I disconnect it.
Title: Re: ADB to USB keyboard converter
Post by: iand on Thu, 05 April 2018, 05:25:44
@hasu. The pre-compiled MacOS does not produce any output from the terminal nor compile from source on MacOS High Sierra so I had to run the debug on a Windows 10 PC. I connected the device with 2018 firmware then ran the version command followed by the debug keyboard command and pressed the NUSB and the GRV keys which produced the 4 bottom lines of output. Hope this is the debug output you were looking for but let me know if there are other debug steps you would like me to produce.

hid_listen.exe
Waiting for device:
Listening:
USB configured.
Before init:
Scan: addr:2, reg3:6505
After init:
Scan: addr:2, reg3:6603
debug enabled.
Keyboard start.

        - Version -
DESC: convert ADB keyboard to USB
VID: 0xFEED(t.m.k.) PID: 0x0ADB(ADB keyboard converter) VER: 0x0101
BUILD: unknown (11:06:49 Apr  4 2018)
OPTIONS: LUFA MOUSEKEY EXTRAKEY CONSOLE COMMAND 4096
GCC: 4.8.1 AVR-LIBC: 1.8.0svn AVR_ARCH: avr5

keyboard: on
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 64 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 35 00 00 00 00 00
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 05 April 2018, 21:14:44
@hasu. The pre-compiled MacOS does not produce any output from the terminal nor compile from source on MacOS High Sierra so I had to run the debug on a Windows 10 PC. I connected the device with 2018 firmware then ran the version command followed by the debug keyboard command and pressed the NUSB and the GRV keys which produced the 4 bottom lines of output. Hope this is the debug output you were looking for but let me know if there are other debug steps you would like me to produce.

hid_listen.exe
Waiting for device:
Listening:
USB configured.
Before init:
Scan: addr:2, reg3:6505
After init:
Scan: addr:2, reg3:6603
debug enabled.
Keyboard start.

        - Version -
DESC: convert ADB keyboard to USB
VID: 0xFEED(t.m.k.) PID: 0x0ADB(ADB keyboard converter) VER: 0x0101
BUILD: unknown (11:06:49 Apr  4 2018)
OPTIONS: LUFA MOUSEKEY EXTRAKEY CONSOLE COMMAND 4096
GCC: 4.8.1 AVR-LIBC: 1.8.0svn AVR_ARCH: avr5

keyboard: on
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 64 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 35 00 00 00 00 00


Thanks. It seems to work well, right?
Then, could you rephrase your problem here?


As for MacOS you may need 'sudo' to get output on terminal. But let's ignore it, it is not problem here.
Title: Re: ADB to USB keyboard converter
Post by: iand on Sun, 08 April 2018, 06:02:06
Hello @hasu, I've done some more testing and will attempt to articulate the problem better here.
Thanks for the hid_listen trick about sudo - that helped.
I wanted to rule out MacOS and Windows 10 system behaviour/configuration from being the source of the problem.  On Windows I installed the http://www.logikdev.com/2010/02/18/apple-uk-keyboard-layout-for-windows/ (http://www.logikdev.com/2010/02/18/apple-uk-keyboard-layout-for-windows/)Apple UK keyboard layout for Windows from  and plugged in a new Apple USB keyboard then tested each UK specific key to ensure it was expected.
With more tests using the AEKII and USB>ADB adaptor I was able to replicate the same problematic behaviour on Windows 10 and MacOS using 2018 firmware.
NUSB key is the key to the right of shift key on UK ISO AEKII
GRV key is the key to the left of 1 character below escape on UK ISO AEKII


2015 Firmware (Windows and MacOS):
All UK specific AEKII keys work as expected except..
NUSB key outputs ` character when \ is expected

hid_listen debug output for pressing  NUSB, GRV keys
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 64 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 35 00 00 00 00 00

2018 Firmware (Windows and MacOS) after USB power reconnection:
NUSB key outputs § expected = \
NUSB + shift keys outputs ± expected = ~
GRV key outputs ` expected = §
GRV + shift keys outputs ~ expected = ±

hid_listen debug output for pressing  NUSB, GRV keys
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 64 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00
keyboard: 00 00 35 00 00 00 00 00

In conclusion the problem is
1) Both MacOS and Windows character output for NUSB,GRV are reversed when using the 2018 ISO firmware even the AEKII keyboard debug shows the same keys being pressed.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 08 April 2018, 06:51:50
The converter should work as a Windows UK USB keyboard, it looks like this.
https://en.wikipedia.org/wiki/British_and_American_keyboards#Windows_keyboards

From those debug output It seems to me work as expected. NUBS sends 0x64 and GRAV sends 0x35 collectly. Windows should print \ for NUBS and ` for GRV.

Mac uses non-standard layout for UK keyboard and it may make this problem complicated.
https://en.wikipedia.org/wiki/British_and_American_keyboards#Apple_Macintosh_keyboards

Use firmware downloaded from Keymap Editor and test this on Windows native box(not Mac and virtual machine) without the "Apple UK keyboard layout" .
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1





Title: Re: ADB to USB keyboard converter
Post by: iand on Sun, 08 April 2018, 11:07:52
Hello @hasu. Thanks for clarifying the key codes. Sticking purely to the key codes I hope this demonstrates the problem- sorry if I've confused matters in previous posts.

2015 firmware NUBS NO ISO autodetect + GRAV keys pressed
keyboard_report: 00 00 35 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00
keyboard_report: 00 00 64 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

adb_usb_rev1 NO ISO autodetect NUBS + GRAV keys pressed
keyboard_report: 00 00 35 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00
keyboard_report: 00 00 64 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

adb_usb_rev1 firmware ISO auto-detected NUBS + GRAV keys pressed
keyboard_report: 00 00 64 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00
keyboard_report: 00 00 35 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

[attachimg=1]
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 08 April 2018, 18:17:14
Hello @hasu. Thanks for clarifying the key codes. Sticking purely to the key codes I hope this demonstrates the problem- sorry if I've confused matters in previous posts.

2015 firmware NUBS + GRAV keys pressed
keyboard_report: 00 00 35 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00
keyboard_report: 00 00 64 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

2018 Firmware after teensy upload NUBS + GRAV keys pressed
keyboard_report: 00 00 35 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00
keyboard_report: 00 00 64 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

adb_usb_rev1 firmware after power cycle NUBS + GRAV keys pressed
keyboard_report: 00 00 64 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00
keyboard_report: 00 00 35 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

(Attachment Link)

Then, it seems that 2015 and 2018 don't work as expected. adb_usb_rev1 works correctly.
Are you using your own keymap file for the 2015 and 2018 firmware? If so post it here.


why are you saying  "after power cycle"? It has something wrong "before power cycle"?
Title: Re: ADB to USB keyboard converter
Post by: iand on Mon, 09 April 2018, 03:59:24
@hasu I have corrected my post above.  When I initially flash the firmware and reboot the teensy there is no automatic ISO detection. I can see a button in the MacOS keyboard settings to allow me to launch the keyboard setup assistant and manually specify the keyboard as ISO and they keys work as expected. Just to be sure I deleted the /Library/Preferences/com.apple.keyboardtype.plist and rebooted and manually specify ISO keyboard when prompted by macOS. The problems happen when I disconnect the adaptor from the USB port and back again. The automatic ISO detection kicks in and the key output between NUBS and GRAV are swapped. The button to manually setup the keyboard also ISO dissapears.  Problems seems to be documented in this thread which I have just seen.
https://github.com/tmk/tmk_keyboard/issues/35#issuecomment-41874635
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 09 April 2018, 19:00:34
@iand, I'm completely confused now and I can't know what you are doing :(
I don't have Macn and ISO keyboard to test it unfortunately.  We may have to wait for someone with ISO ADB keyboard and knowledge about ADB, Mac and TMK to come in.

I'm still happty to hear about concreate offer to improve ISO keyboard support. Let me know if anyone have any idea on this problem.
Title: Re: ADB to USB keyboard converter
Post by: iand on Fri, 13 April 2018, 04:12:32
Hi @hasu.  I managed to change keymap_common.h and make the firmware .hex work with my M3501 British Keyboard. As you linked to wikipedia earlier, Apple British keyboards are not ISO standard. I made a simple change to swap K32 and K0A keys reversing your commit made in 2016.  Now the keys work everytime even when I disconnect the USB cable. Perhaps we need a ISO/UK section. I had a look at the keyboard-autodetection code and there's no accounting for UK keyboards.

/* M3501 Apple Extended Keyboard II UK ISO
 * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
 * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |Pwr|
 * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  §|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  =|  /|  *|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Retur| |Del|End|PgD| |  7|  8|  9|  -|
 * |------------------------------------------------------`    | `-----------' |---------------|
 * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  \|    |               |  4|  5|  6|  +|
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shif|  `|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
 * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
 * |Ctrl |Opt |Cmd |         Space           |     |Opt |Ctrl  | |Lef|Dow|Rig| |      0|  .|   |
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP_EXT_ISO( \
    K35,  K7A,K78,K63,K76, K60,K61,K62,K64, K65,K6D,K67,K6F, K69,K6B,K71,              K7F, \
    K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74,  K47,K51,K4B,K43, \
    K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K24, K75,K77,K79,  K59,K5B,K5C,K4E, \
    K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K2A,                   K56,K57,K58,K45, \
    K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,    K7B,     K3E,      K53,K54,K55,     \
    K36,K3A,K37,        K31,                        K7C,K7D, K3B,K3D,K3C,  K52,    K41,K4C  \
) { \
    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
    { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \
    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
    { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \
    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
    { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \
    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_PENT,  KC_##K35, KC_##K36, KC_##K37 }, \
    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO    }, \
    { KC_F17,   KC_##K41, KC_NO,    KC_##K43, KC_F18,   KC_##K45, KC_NO,    KC_##K47 }, \
    { KC_NO,    KC_NO,    KC_NO,    KC_##K4B, KC_##K4C, KC_NO,    KC_##K4E, KC_F18   }, \
    { KC_F19,   KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
    { KC_##K58, KC_##K59, KC_F20,   KC_##K5B, KC_##K5C, KC_INT3,  KC_INT1,  KC_PCMM  }, \
    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_LANG2, KC_##K67 }, \
    { KC_LANG1, KC_##K69, KC_F16,   KC_##K6B, KC_NO,    KC_##K6D, KC_APP,   KC_##K6F }, \
    { KC_NO,    KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
    { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_NO,    KC_##K7F }  \
}
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 13 April 2018, 06:36:19
@iand, code you pasted is equivalent to the latest code on github repo except for changes in comment. The 'change in comment' doesn't affect how firmware works at all. If the code you pasted works for you the latest firmware will work without any fix.

can you show your keymap file if you modified it?
Title: Re: ADB to USB keyboard converter
Post by: Worthless_Owl on Fri, 13 April 2018, 16:49:58
Problem solved, the firmware i get from the web doesn't work. I "make" the files from hasu's github and it worked like a charm. Thanks a lot Hasu! Typing this on my AEKII right now!

Scratch that. The converter work fine with the "adb_usb_rev1_unimap.hex" found in the binary file. Doesn't work with "adb_usb_rev2_unimap.hex", nor the make'd file. After flashing with qmk toolbox it disconnects immediately, while using unimap rev1 shows the blue debugging messages. Any help?
Title: Re: ADB to USB keyboard converter
Post by: snufflecat on Thu, 19 April 2018, 07:08:11
Hi there. First of all thanks for making this. I'm trying to make my own adapter for my AEKII but have a hard time understanding a few things, please excuse my banal questions:

- Is it possible to use the Arduino IDE to compile the necessary hex-files that you flash the Teensy with?
- What files do I have to modify if I want to add Norwegian characters like "ζ", "ψ" and "ε"? I've tried looking into the "keymap_iso.c", but it's mostly giving me a headache…  :confused:
- Do I need to add an extra layer that's activated via the shift-key in order to get capital letters etc.?

I'm pretty sure most of what I'm asking is answered in the different wikis and guides, but they're so incredibly large that I have a hard time finding out exactly where to look.

Thank you!
Title: Re: ADB to USB keyboard converter
Post by: rich1051414 on Thu, 19 April 2018, 18:18:55
- Is it possible to use the Arduino IDE to compile the necessary hex-files that you flash the Teensy with?

No.

What files do I have to modify if I want to add Norwegian characters like "ζ", "ψ" and "ε"? I've tried looking into the "keymap_iso.c", but it's mostly giving me a headache…

There is an online tool you can use to make custom keymap hex files.
For TMK converter(ATMega32u2) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb)
For old TMK converter rev.1(ATMega32u4) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1)

- Do I need to add an extra layer that's activated via the shift-key in order to get capital letters etc.?
No.


Title: Re: ADB to USB keyboard converter
Post by: snufflecat on Fri, 20 April 2018, 01:37:10
- Is it possible to use the Arduino IDE to compile the necessary hex-files that you flash the Teensy with?

No.

What files do I have to modify if I want to add Norwegian characters like "ζ", "ψ" and "ε"? I've tried looking into the "keymap_iso.c", but it's mostly giving me a headache…

There is an online tool you can use to make custom keymap hex files.
For TMK converter(ATMega32u2) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb)
For old TMK converter rev.1(ATMega32u4) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1)

- Do I need to add an extra layer that's activated via the shift-key in order to get capital letters etc.?
No.

Thanks. I've tried using the online generator before but there's no way to actually add custom characters?
Title: Re: ADB to USB keyboard converter
Post by: rich1051414 on Fri, 20 April 2018, 19:30:02
- Is it possible to use the Arduino IDE to compile the necessary hex-files that you flash the Teensy with?

No.

What files do I have to modify if I want to add Norwegian characters like "ζ", "ψ" and "ε"? I've tried looking into the "keymap_iso.c", but it's mostly giving me a headache…

There is an online tool you can use to make custom keymap hex files.
For TMK converter(ATMega32u2) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb)
For old TMK converter rev.1(ATMega32u4) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1)

- Do I need to add an extra layer that's activated via the shift-key in order to get capital letters etc.?
No.

Thanks. I've tried using the online generator before but there's no way to actually add custom characters?

The action map under the 'Code Edit' tab lists all of the characters by their official labels, and the character seen by the OS depends on the keyboard language. The keyboard only sends a code, it is up to the OS to decide what letter that represents, and depends on the keyboard language settings.

You can set a macro to punch in the alt-code though, but I have no experience with setting up macros with this firmware, but it looks like that functionality is there.

In case you don't know, most OS's have the ability to manually punch in an Alt code which bypasses the keyboards language settings. Usually this is done by holding left alt and punching in the alt code number on the numpad, then the keystroke is sent when you release alt. It MUST be numpad digits, the top row numbers do not work for this. Also, this only works if the numpad is the same physical hardware as the alt key being held. Very unfortunate for external numpad users. Obviously this has the limitation of symbols or characters entered this way being one shot, and will not function as a typical key with physical state change information. Like, key repeating when holding down the key couldn't work.

If on windows, the tool 'charmap' will list the physical alt-code for all symbols in each font you have installed on your system. The format is 'U+XXXX', the 4 digits are in hex, so you need to convert that to decimal first.



I hope you don't want this function to do childish stuff like this:̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̅̅̅̅̅̅̅̅M
Title: Re: ADB to USB keyboard converter
Post by: snufflecat on Wed, 25 April 2018, 09:55:22
Hi again @Hasu,

Just wanted to say a huge thank you! I finally managed to get my controller working, and you would not believe how satisfying it is to finally make my own adapter. It's been a rough journey, but I've learned so much from it.

Do you take donations? Because I really feel that I should pay some sort of respect to you for making all of this possible for laypeople like myself.
Let me know :)
Title: Re: ADB to USB keyboard converter
Post by: jracabado on Mon, 21 May 2018, 08:31:32
Hi,

UPDATE: response is in the post above, I looked at the wrong diagram.

I've made my attempt at building my own adapter for an Apple Extended Keyboard II. I purchased a Pro Micro Leonardo ATmega32U4 5V/16MHz and did the wirings according to the instructions but it's not functioning well. I've just tested in OS X.

I used a 10k resistor, here is how the wiring looks:

[attachimg=1]


I did compile the firmware with ADB_DATA_BIT as 15. I had to learn how to reset the Pro Micro so I could upload the firmware but in the end I figured it out.

Once I did that when I plug in the adapter via USB it is detected as an ADB Keyboard Converter in OSX. The Assistant Keyboard wizards also pops to help me identify the keyboard.

The adapter shows a green light:

[attachimg=2]

After plugging the AEK II to the ADB cable the adapter stays green but when listing the USB devices it no longer shows the adapter identied as "ADB keyboard converter" but rather "Arduino Micro".

Nothing happens besides the mouse moving left a fixed amount of pixels periodically. The keyboard lights show no signs of life and no key registers.

Not sure where to go from here. I've double checked the wiring with a multimeter. Can it be the 10k resistor? Also there is a reference to the J1 jumper on the first post but I couldn't find any more information. Do you guys have any ideas how to troubleshoot this?

Some other peculiar behaviour to note is that when I plugin the ADB cable on the right keyboard socket the lights on the adapter go off as seen here:

[attachimg=3]

Also when disconnecting the keyboard on the left socket the adapter lights go red:

[attachimg=4]






 
Title: Re: ADB to USB keyboard converter
Post by: snufflecat on Tue, 22 May 2018, 03:02:57
Hi,

I've made my attempt at building my own adapter for an Apple Extended Keyboard II. I purchased a Pro Micro Leonardo ATmega32U4 5V/16MHz and did the wirings according to the instructions but it's not functioning well. I've just tested in OS X.

I had kind of the same problems as you with the mouse jumping around on the screen and nothing happening, and what I finally learned was that I had wired the wrong cables to the controller.
It dawned on me that the pinout that's shown on most tutorials is for the female plug, not the male cable, which is "flipped", see the attached image for reference. The x marks what cables shouldn't be connected.

In my case this lead me to connect the brown, orange and black cable, while the red wasn't connected at all. If your cable is like mine then that might be the solution.

[attachimg=1]
Title: Re: ADB to USB keyboard converter
Post by: jracabado on Tue, 22 May 2018, 04:08:05
That's exactly the problem. Thanks for the help, we will have to rewire it.

Hopefully everything else is working.
Title: Re: ADB to USB keyboard converter
Post by: snufflecat on Thu, 24 May 2018, 06:59:45
That's exactly the problem. Thanks for the help, we will have to rewire it.

Hopefully everything else is working.
Keep us posted on how it works out. :)
Title: Re: ADB to USB keyboard converter
Post by: ReDsNoTDeAd on Wed, 06 June 2018, 11:35:09
Hasu, I am wanting to update my ADB-USB converter to rev2 firmware, but cannot figure out how.

Can you write some short instructions? I can get hex file and I have ATMEL FLIP software, but after this I am lost.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 06 June 2018, 18:10:43
Hasu, I am wanting to update my ADB-USB converter to rev2 firmware, but cannot figure out how.

Can you write some short instructions? I can get hex file and I have ATMEL FLIP software, but after this I am lost.

See this wiki entry and you should select 'ATmega32U2' as chip in FLIP assuming you are using TMK converter.
https://github.com/tmk/tmk_keyboard/wiki#atmel-flip-for-windows
Title: Re: ADB to USB keyboard converter
Post by: jracabado on Tue, 12 June 2018, 07:28:55
That's exactly the problem. Thanks for the help, we will have to rewire it.

Hopefully everything else is working.
Keep us posted on how it works out. :)

So I corrected the wiring, double checked with multi-meter and everything seems connected in the right place but it still doesn't work.

I get the same mouse left and slightly up behaviour. The improvement is that now when I connect the keyboard it keeps showing as "ADB keyboard converter" in the USB devices and the Arduino doesn't change to the red lights. Besides that when I connect the cable to the right socket it quickly flashes the keyboard lights, nothing happens when connecting to the keyboard left ADB socket.

That's as far as I managed to get and I'm not sure what else can I change/test.

I did verify the voltage in the VCC line and it's around 4.6V, is that enough? My Macbook only feeds 4.7V through the USB cable.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 12 June 2018, 20:06:09
That's exactly the problem. Thanks for the help, we will have to rewire it.

Hopefully everything else is working.
Keep us posted on how it works out. :)

So I corrected the wiring, double checked with multi-meter and everything seems connected in the right place but it still doesn't work.

I get the same mouse left and slightly up behaviour. The improvement is that now when I connect the keyboard it keeps showing as "ADB keyboard converter" in the USB devices and the Arduino doesn't change to the red lights. Besides that when I connect the cable to the right socket it quickly flashes the keyboard lights, nothing happens when connecting to the keyboard left ADB socket.

That's as far as I managed to get and I'm not sure what else can I change/test.

I did verify the voltage in the VCC line and it's around 4.6V, is that enough? My Macbook only feeds 4.7V through the USB cable.


The mouse behaviour means that you have something wrong on data line. Connect data line on PD0 pin which is Pin3 on Pro Micro, and then flash default firmware for ATMega32u4.
I think converter works at 4.6-4.7V but it doesn't look like good enough as power supply, cheap cable or bad USB port perhaps? you may want to try other computers like desktop pc.
Title: Re: ADB to USB keyboard converter
Post by: katotaka on Tue, 26 June 2018, 05:35:26
Apologies, didn't really went through whole thread (and Git page) yet, but:

Could this be a good gateway starter project for a newbie builder?
I would happily just give up and get ready to use converter if that turns out too difficult

Looking to use my second AEK2 at work.
Never had similar experience except making first AEK2 into Alps64 (PCB set from @hasu) but I assume if I want to build one, I could just get a correct Pro Micro, solder S-Video Cable, add 1k~10k ohm resistor, flash .hex via FLIP and it's done...?

Title: Re: ADB to USB keyboard converter
Post by: katotaka on Wed, 27 June 2018, 21:43:10
Apologies, didn't really went through whole thread (and Git page) yet, but:

Could this be a good gateway starter project for a newbie builder?
I would happily just give up and get ready to use converter if that turns out too difficult

Looking to use my second AEK2 at work.
Never had similar experience except making first AEK2 into Alps64 (PCB set from @hasu) but I assume if I want to build one, I could just get a correct Pro Micro, solder S-Video Cable, add 1k~10k ohm resistor, flash .hex via FLIP and it's done...?

I just force fed myself with some single board computer 101 and it just worked! yay!
Title: Re: ADB to USB keyboard converter
Post by: superbia on Thu, 28 June 2018, 07:07:32
Apologies, didn't really went through whole thread (and Git page) yet, but:

Could this be a good gateway starter project for a newbie builder?
I would happily just give up and get ready to use converter if that turns out too difficult

Looking to use my second AEK2 at work.
Never had similar experience except making first AEK2 into Alps64 (PCB set from @hasu) but I assume if I want to build one, I could just get a correct Pro Micro, solder S-Video Cable, add 1k~10k ohm resistor, flash .hex via FLIP and it's done...?

I just force fed myself with some single board computer 101 and it just worked! yay!

Be sure to post some pictures of it  ;)
Title: Re: ADB to USB keyboard converter
Post by: katotaka on Thu, 28 June 2018, 07:41:52
Be sure to post some pictures of it  ;)

Pretty much the same as few replies above (https://geekhack.org/index.php?topic=14290.msg2611178#msg2611178) but with a short S-Video cable.
I'm pretty confident with the soldering iron but the programming was the hard part, end up following this guide (https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html) and flashed the hex (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/) using avrdude in CMD(win10).

I then connected my AEK2 to the Mac at work and found out I forgot to set locking capslock and the symbols on the numpad were in the wrong places, quickly made new hex file and flashed with avrdude again, and BAM! it's working.

Next up I fired up Fusion360 and quickly drafted an enclosure, since this board will be dedicated to the AEK2 so I kept the design simple sealed it with glue.
Forgot to take pictures before leaving work so no actual photos.
[attachimg=1]
Title: Re: ADB to USB keyboard converter
Post by: katotaka on Sat, 30 June 2018, 03:22:46
My second AEK2 this adapter will be dedicated for, this one has bright white switches
[attachimg=1]

Finished Adapter
[attachimg=2]

Adapter in 3D printed case
[attachimg=3]

Intended location on the case (disassembled for cleaning and retr0bright), will probably be attached with some double sided tape, caps are being cleaned in ultrasonic bath
[attachimg=4]
Title: Re: ADB to USB keyboard converter
Post by: superbia on Sat, 30 June 2018, 05:29:20
Very clean, congrats on the success  :)
Title: Re: ADB to USB keyboard converter
Post by: Gouty on Sat, 14 July 2018, 05:10:14
I made an ADB to USB converter using an pro micro (5V version) for my ISO UK AEK II and it works really well.  Thanks to everyone for their contributions to this thread, made the process simple and answered all my questions I had throughout the process of making it.

I downloaded a hex file from the TMK gui https://goo.gl/KW66Rt and flashed it to the pro micro using AVRDUDE under windows 10

First I tried rev.2 but for some reason once the device was flashed it would reboot and be unrecognized, then when disconnecting and reconnecting it nothing would come up at all (as if it was never connected)

Resetting it was fine, so I did just that and then put on a rev.1 hex file.  This time it recognised it immediately as an ADB converter and appeared as HID keyboard and mouse, which was great.

Any idea why the rev.2 would not work but the rev.1 would?  Is it a quirk of the pro micro?
EDIT: I can't read, it says clearly on the opening post that rev.2 is for atmega32u2 boards like Hasu's own converter (this was pointed out to me by Laser over at DT)

Also, the numpad equals (keymapd equal) is weird under windows, it outputs 5 in most instances and nothing in the command prompt.  Anyone know why this might be?  I changed it to regular equals, so it's not really an issue.

P.S. If you find that when you plug in the keyboard your mouse starts moving around 50 pixels to the left every second or so, then you have the PD0 and VCC wires the wrong way (yes I am a dumbass)
Title: Re: ADB to USB keyboard converter
Post by: Felinski on Sat, 14 July 2018, 17:08:28
 I'm a bit confused as to which resistor i should use, I was looking at resistors and I found some cheap 1k Ohm resistors but they had different values of W on them
 Some are 5W 1k ohm resistors, some are 1W, 10W, and so on. What type do I need?
Secondly, is the resistor just supposed to go between 5V (VCC) to DATA (D0) on my teensy? 

Also, how can I identify the cables as to which ones they are? My plan right now is to cut apart an ADB cable and solder the pins on to my teensy rather than messing with the keyboard itself.

My AEK has a detachable ADB cable, am I correct to assume that both ends on my cable are male?

Sorry for all the questions, this is my first venture into microelectronics.
Title: Re: ADB to USB keyboard converter
Post by: Gouty on Sun, 15 July 2018, 05:09:16
I'm a bit confused as to which resistor i should use, I was looking at resistors and I found some cheap 1k Ohm resistors but they had different values of W on them
 Some are 5W 1k ohm resistors, some are 1W, 10W, and so on. What type do I need?

The wattage value is the amount of energy the resistor can dissipate without failing. Because this is a low power application either of those should be fine, just go for the cheaper one.

Secondly, is the resistor just supposed to go between 5V (VCC) to DATA (D0) on my teensy? 

Yes

Also, how can I identify the cables as to which ones they are? My plan right now is to cut apart an ADB cable and solder the pins on to my teensy rather than messing with the keyboard itself.

Get a multimeter, set it to beep or buzz when the ends make contact, strip the end of the cable you want to use, hold a probe to a pin, and then test the wires and write down what connects to what colour. Alternatively, if you don't have a multimeter, do the same with a battery and LED.

My AEK has a detachable ADB cable, am I correct to assume that both ends on my cable are male?
If they both have visible pins rather than plugs (outties rather than innies) then you've got a male my friend (chances are, yes it is male to male as this is what was needed to connect it up to the computer)

If you are doing this under windows I wrote a little guide on my experiences and how to do it here. (https://www.keebtalk.com/t/got-my-apple-extended-keyboard-ii-working/2567)
Title: Re: ADB to USB keyboard converter
Post by: PierceSutton on Sun, 09 September 2018, 11:17:09
Hi, I just finished wiring my keyboard to the converter but I can't get it to work properly. When I plug the keyboard in, the three green lights flash so I believe the keyboard has power, However I can't enter anything through the keyboard to my computer. When I hit the caps lock key the caps lock light does not go on. I have a 10K resistor on my power and data wire and am using Teensy 2.0. I have not changed or edited any of the file in the adb_usb folder. Hex file was built with linux and my keyboard is an original Apple Extended Keyboard. If you would like pics please specify which part you want a pic of.
Title: Re: ADB to USB keyboard converter
Post by: PierceSutton on Sun, 09 September 2018, 17:05:10
NVM, I figured it out, I had plugged my data cable to F0 instead of D0 because I was following an iFixit guide. But I read over the README and sure enough it said to put into D0 and that fixed everything. Thank you for the hardwork you guys put into this. :thumb:
Title: Re: ADB to USB keyboard converter
Post by: supermario802.1 on Tue, 11 September 2018, 22:38:05
I just finished building one ADB to USB keyboard / mouse converter (http://www.tinkerboy.xyz/product/tinkerboy-adb-to-usb-keyboard-mouse-converter/). It works great! Thanks hasu!

[attachimg=1]
Title: Re: ADB to USB keyboard converter
Post by: PierceSutton on Sun, 23 September 2018, 00:06:20
I just finished building one. It works great! Thanks hasu!

(Attachment Link)
Wow, that's amazing. Where did you fit the chip and resistor, the USB or ADB body?
Title: Re: ADB to USB keyboard converter
Post by: supermario802.1 on Sun, 07 October 2018, 03:06:19
I just finished building one. It works great! Thanks hasu!

(Attachment Link)
Wow, that's amazing. Where did you fit the chip and resistor, the USB or ADB body?

I designed a custom pcb to fit inside the usb plastic enclosure.
Title: Re: ADB to USB keyboard converter
Post by: fcoury on Sun, 07 October 2018, 22:03:31
I am sorry if this has been answered on this thread before, I tried looking for an answer but didn't find anything.

Are there any 3D printed cases for Hasu's adapters, namely the USB_USB and the ADB converters?

Thank you!
Title: Re: ADB to USB keyboard converter
Post by: kungfu_jesus on Sun, 18 November 2018, 18:16:45
So in my infinite wisdom and a 2 year time span I've lost one side of the ADB ports for my M0116 and the other is missing the black box but is still connected to the PCB.

Can I run the converter directly to the PCB, replacing the ADB port altogether or am I screwed? Did that black box serve a significant purpose?

See attached image ref. mystery black box.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 18 November 2018, 20:44:51
The black component is ferrite core and not critical one. You can hook up converter directly to main pcb without the ferrite core and ADB port.
Title: Re: ADB to USB keyboard converter
Post by: kungfu_jesus on Mon, 19 November 2018, 19:38:33
Thank you so much for your response. I went ahead and removed that component and soldered in, but it's not seeming to register any key presses.

I verified that the build was correct for Teensy 2.0++ at90usb1286 and device manager shows it is HID Keyboard.

Using HID listen, before I was receiving error 30, after resoldering I am only showing keyboard start. No keypresses log any input. I am curious if I am using an incorrect resistor as it is at 4.7k according to the color codes.

Did I solder everything in correctly?

Magic button seems to be the only one registering and it returns:

Keyboard init.
[C]Before init:
hadler_id: 00, is_iso_layout: no
After init:
debug enabled.

Keyboard start.
adb_host_kbd_recv: ERROR(-30)
Before init:
hadler_id: 00, is_iso_layout: no
After init:
debug enabled.


I feel like I am getting close but no cigar quite yet. Bad build, perhaps? Neither the rev1 or rev2 hexes play friendly with the Teensy 2.0++. I am using the modified makefile.teensy.

Using a multimeter I register the 5V from one side of the board to the other, and some of the pins on the black NEC chip at the top show 5V as well, but when I test a switch for any voltage it stays at 0. Is this a warning sign that I have a bad board? :/
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 20 November 2018, 20:17:39
In most cases if not all -30 error means connections are not totally wrong or iffy. Make sure your wiring is correct.
Title: Re: ADB to USB keyboard converter
Post by: kungfu_jesus on Wed, 21 November 2018, 14:40:00
It's only the power button that gives that and I think it's the only button that generates a response because the traces are connected directly to the Teensy. I've double checked all my wiring and it seems kosher. The multimeter shows the same readouts on the board as it does the Teensy.

Is there any way to test the board itself? Should my switches be seeing voltage?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 21 November 2018, 16:35:13
It's only the power button that gives that and I think it's the only button that generates a response because the traces are connected directly to the Teensy.
what do you mean? You see something in hid_listen when you press power key? How does it connected to, DATA line or VCC line?
Power key was used to wake computer and is always given 5V for coumpter to see direclty its state on 2 pin of connector. That pin is not used by the conveter, though.

Quote
I've double checked all my wiring and it seems kosher. The multimeter shows the same readouts on the board as it does the Teensy.

Is there any way to test the board itself? Should my switches be seeing voltage?

Other switches on matrix is scaned at very fast rate and you can't see with multimeter.
Assuming your wiring is correct the board is probably damaged.
Title: Re: ADB to USB keyboard converter
Post by: numist on Wed, 05 December 2018, 21:06:54
- Apple adjustable keyboard keypad is not confirmed yet. Not sure if it works or not at this time.

I can confirm that the keypad works properly with the adapter:

(http://numist.net/random/IMG_5196.JPG)

REQUEST FOR HELP: Extended mouse protocol support
It is required for more buttons and movement resolution of mouse/trackball.
Do you have multiple button mouse? Implement it!
https://github.com/tmk/tmk_keyboard/issues/274

Funny, I was writing an adapter firmware before I found this thread and already have extended mouse support implemented. Should be able to port it over without too much trouble.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 05 December 2018, 21:31:29
numist,
Great! Thanks for the report. I'm really glad to know it works with the keypad.

And adding exntended mouse support would be appreciated!
Title: Re: ADB to USB keyboard converter
Post by: Lσtetem on Thu, 20 December 2018, 06:16:27
Hi guys!

Im a newbie to microcontrollers its one of my first projects but I encountered a problem I think I cant resolve alone.

So I downloaded the full tmk_master library. Set up the compiler and tried to compile it but it exits with Error 1 after trying to compile keymap.c I think. Final line basically sais that keymap.o cannot be compiled.

So I tried downloading the .hex form the keyboard editor that doesn't work either.

Im using FLIP to upload it uploads and verifies with success.

Im using a Pro Micro about that:

Yes its 16Mhz/5v.
PD0 is pin #3 but sources differ... I can verify that if needed.
Im using the Atmel DFU bootloader the one it comes with is crap. Its programmed with an Arduino UNO and I tricked the IDE to upload it, it seems to be working.
I made sure J1 is shorted I can reverse if needed.
I-used a 4.7K external pull up R.
Im using the libusb driver.

Symptoms with the downloaded .hex.

*Windows doesnt recognise converter as an HID device
*When keyboard plugged in It blinks up all the leds and then nothing happens.

So my probably wrong guess is that the downloaded hex doesnt work because of the same issue as my compiler doesnt compile but it pushes the unlinked file to be able to be downloaded. Im using the rev1 editor and makefile.rev1 but makefile also exits with the same error. Also Im trying to compile with iso layout.

***
About me and stuff:

I love keyboards I have an 89 and a 93 model M both ISO
I have 2 AEK2 both are Hungarians (like i am) and on of them is boxed and Mint no yellowing at all and that feels really noice.
Have a bunch of other keyboards mint foam and foil terminals and yes they really get better when the go wrong.
And I have one really interesting HP terminal board which I want to present to the community in the future.



Title: Re: ADB to USB keyboard converter
Post by: superbia on Thu, 20 December 2018, 10:14:49
Im a newbie to microcontrollers its one of my first projects but I encountered a problem I think I cant resolve alone.

I can only say that I've documented the entire process on linux, so make sure to check it out.  :thumb:
https://geekhack.org/index.php?topic=14290.msg2464076#msg2464076
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Thu, 20 December 2018, 10:24:44
...
So I tried downloading the .hex form the keyboard editor that doesn't work either.
...

Which keymap editor?

At the top do you see:
ADB-USB Converter rev.2

or
ADB-USB Converter rev.1

Your Pro Micro has a ATMega32u4 processor so you'll need to use the editor Rev 1

Carefully read the fine print below "Keymap Editor" in this post (https://geekhack.org/index.php?topic=14290.0).
Title: Re: ADB to USB keyboard converter
Post by: Lσtetem on Thu, 20 December 2018, 10:55:51
Thanks guys for the answers.

I can only say that I've documented the entire process on linux, so make sure to check it out.  :thumb:
https://geekhack.org/index.php?topic=14290.msg2464076#msg2464076

@Superbia I did, did I miss something? Im planning to set up something with Linux but I dont think its an OS related issue, feel free to correct me.

Which keymap editor?

@Tactile I used rev1, if you read the whole post you can see I tried to compile for rev1 too.


Could any of you verify that the firmware downloaded from the editor works? I mean a firmware downloaded today. Or that a fresh download of the tmk_master compiles?

That way I can be sure that the problem is at my end not in the tmk_core.
Title: Re: ADB to USB keyboard converter
Post by: Lσtetem on Thu, 20 December 2018, 11:05:48
Just to follow up, I think my compiler works all right because it starts compiling compiles about 10 or something like that files before it quits at keymap.c -> keymap.o and thats in the tmk core.
Title: Re: ADB to USB keyboard converter
Post by: Lσtetem on Fri, 21 December 2018, 03:51:03
Hi Its a new day!

So I checked the git the last commit was about 2 years ago to keymap.c and keymap.h so there is plentiful evidence that it works. But the last commit mentioned that some compilers would have problem with the old version of the file. So I checked the compiler, and the avr toolchain was installed and the compiler compiled. Hm. Then I checked the compiler error nothing new. So I checked the full output and what I saw at the end so when the compiler starts... WinAVR was installed and that was the compiler. After uninstalling compiling works.

Still an issue remains, that the code doesn't work. My best guess right now is the bootloader or an issue while flashing the bootloader. I have some spare Pro Micros, they show up as HID devices but the one I'm using doesnt. I think it has to do something with the Atmel DFU bootloader Im using.

I will try a fresh OotB Pro Micro with avrdude.
Title: Re: ADB to USB keyboard converter
Post by: BlastoSupreme on Thu, 24 January 2019, 22:05:06
Hello,

This is going to be my first coding project. I have next to no experience with any form of code. My education is in medicine so this is quite new to me. I have recently acquired an Apple Extended Keyboard II. I found online that it is possible to use a teensy to connect it to a modern day Mac. I have a question about the power button. I would like to use it to make my MacBook go to sleep. I know this can be done via a specific key stroke shortcut, but i am wondering if it is possible to accomplish this with the power button in a single press.

Thank you so much in advance. I appreciate your patience as I said, I have no clue what I'm doing.

Blasto
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 28 January 2019, 00:09:14
Hello,

This is going to be my first coding project. I have next to no experience with any form of code. My education is in medicine so this is quite new to me. I have recently acquired an Apple Extended Keyboard II. I found online that it is possible to use a teensy to connect it to a modern day Mac. I have a question about the power button. I would like to use it to make my MacBook go to sleep. I know this can be done via a specific key stroke shortcut, but i am wondering if it is possible to accomplish this with the power button in a single press.

Thank you so much in advance. I appreciate your patience as I said, I have no clue what I'm doing.

Blasto

It should work. Use code KC_PWR(or AC_PWR) for that pupose.
Try it and report back here when you have time.
Title: Re: ADB to USB keyboard converter
Post by: BlastoSupreme on Tue, 29 January 2019, 14:17:44
Hello,

This is going to be my first coding project. I have next to no experience with any form of code. My education is in medicine so this is quite new to me. I have recently acquired an Apple Extended Keyboard II. I found online that it is possible to use a teensy to connect it to a modern day Mac. I have a question about the power button. I would like to use it to make my MacBook go to sleep. I know this can be done via a specific key stroke shortcut, but i am wondering if it is possible to accomplish this with the power button in a single press.

Thank you so much in advance. I appreciate your patience as I said, I have no clue what I'm doing.

Blasto

It should work. Use code KC_PWR(or AC_PWR) for that pupose.
Try it and report back here when you have time

 
Do I need to attach the power switch wire to the teensy for that to work?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 29 January 2019, 18:20:07
No, you don't.
Title: Re: ADB to USB keyboard converter
Post by: mcmaxmcmc on Sat, 02 February 2019, 20:35:49
EDIT: I got it working! 1K Ohms weren't wasn't enough for my original ADB cable.   :thumb:

I've been trying to figure out why my controller isn't working for about 6 hours now...  Everything seems to be wired correctly, the pro micro is working and is detected by QMK Toolbox, there's a 1K Ohm resistor as a pull-up, and all of the wiring is active (as in, Continuity tests show that the wire isn't cut or anything).  When the board is plugged in, the lock LEDs light up normally as it would, but it updates very slowly, though it is controllable with another board.  I flashed in the rev.1 version of the hex file.  The board tested is an AEKII.  (I've also tested an ASK with it, though I feel like that board is broken due to it not giving anything in QMK Toolbox.)

Here's the wiring:
(https://i.imgur.com/hCu1BfK.jpg)
(https://i.imgur.com/vu2wbvs.jpg)
(https://i.imgur.com/WP8gwXh.jpg)
(https://i.imgur.com/dtAbSLC.jpg)

Here's what QMK Toolbox spits out:
(https://i.imgur.com/yrAQUhR.png)
If you need anymore info, please ask.  Cheers!
Title: Re: ADB to USB keyboard converter
Post by: Tactile on Sun, 03 February 2019, 00:24:11
I've been trying to figure out why my controller isn't working for about 6 hours now...  Everything seems to be wired correctly, the pro micro is working and is detected by QMK Toolbox, there's a 1K Ohm resistor as a pull-up, and all of the wiring is active (as in, Continuity tests show that the wire isn't cut or anything).  When the board is plugged in, the lock LEDs light up normally as it would, but it updates very slowly, though it is controllable with another board.  I flashed in the rev.1 version of the hex file.  The board tested is an AEKII.  (I've also tested an ASK with it, though I feel like that board is broken due to it not giving anything in QMK Toolbox.)

Here's the wiring:
Show Image
(https://i.imgur.com/hCu1BfK.jpg)

Show Image
(https://i.imgur.com/vu2wbvs.jpg)

Show Image
(https://i.imgur.com/WP8gwXh.jpg)

Show Image
(https://i.imgur.com/dtAbSLC.jpg)


Here's what QMK Toolbox spits out:
Show Image
(https://i.imgur.com/yrAQUhR.png)

If you need anymore info, please ask.  Cheers!

In the photos I can't see J1 very well. Have a look at this post (https://geekhack.org/index.php?topic=96236.msg2625899#msg2625899).
Title: Re: ADB to USB keyboard converter
Post by: GollyGee on Sun, 10 February 2019, 15:49:32
Hey Hasu, thanks for the great resource and code!  :) I'm working on converting an MO116.  I'm still new to this stuff, but I think I'm very close to getting it working. Right now, I'm getting nothing when I type on it, even though the keyboard is hooked up to the Teensy. I'm pretty sure I programmed the Teensy right and the wiring is fine, but I'll attach pictures. It's not soldered yet because I want to make sure everything works before making it permanent. Thanks for the help! :D

Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 10 February 2019, 17:31:34
Gollygee, it's probably a loose connection, something not making good contact because of not being soldered. If you want to do something this way (pre solder) use a breadboard & jumpers.

Try soldering the converter together, even if not permanent & see if problem persists.

Or make everything neat & solder for final assembly, you sound like you're pretty certain you have it put together correctly, go for it.
Title: Re: ADB to USB keyboard converter
Post by: GollyGee on Sun, 10 February 2019, 17:52:46
Gollygee, it's probably a loose connection, something not making good contact because of not being soldered. If you want to do something this way (pre solder) use a breadboard & jumpers.

Try soldering the converter together, even if not permanent & see if problem persists.

Or make everything neat & solder for final assembly, you sound like you're pretty certain you have it put together correctly, go for it.

Thanks for the help! Just a quick question: the copper wire is a bit thick to fit in the holes of the teensy with the resistor being in the same hole (that's why I'm using thinner braided wire atm). Does the copper wire have to go all the way through the hole, or can I just solder it to the top? I guess I could file the ends of the wire down.

Oh and something else: the data line should be connected to D0 by default, correct?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 10 February 2019, 18:01:50
solder the resistor in first (through hole), then solder the wire to the leg on the resistor just above the solder joint you just made. the connections don't have to go through the hole to work they just have to make a solid connection to the pad they are supposed to be connected to.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 10 February 2019, 18:10:47
here's another way to do it (wires first, then resistor), posted earlier in the thread:
SUCCESS

Turned out to be a 1 hour project, once I had all the components in place. Ultimately, I went with an external connector for three reasons:

  1) Fear of working in cramped conditions

  2) Can more easily fall back on one of the other spare keyboards if something goes wrong

  3) DAT original ADB cable!

Process writeup:

So, I bought the keyboards together on eBay from a single seller (he discounted the lot of 4 for $112 - $28 a pop!). He sent me serial numbers, confirming that all had the Alps switches. They had no cables, though, so I was originally planning on an internal mod with a pretty stock USB cable. I looked at the Zeal PC custom cables, and considered getting a grey coiled cable, but man, it'd be more than the keyboard! I planned for a bit of redundancy, so I ordered two of the Teensy 2.0 boards, and started collecting some other bits and bobs. Got some various soldering bits off Amazon and Adafruit, and got a batch of 10 S-Video connectors off eBay for $5. Also came across two coiled ADB cables on eBay, one NOS, each for ~$5. So, I was set. Easy peasy lemon squeezy.

Now to come up with some sort of housing for it.

Thanks for the inspiration, GeekHack, and thanks for the code, Hasu!

Happy clackety clack

...sorry, images didn't come through, one sec...

images credit (zacbir). images did not come across when i quoted his post.

[attach=1][attach=2][attach=3][attach=4]
Title: Re: ADB to USB keyboard converter
Post by: GollyGee on Sun, 10 February 2019, 18:39:32
Thanks for the information nevin! I'll try to remember to update once I try soldering it.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 10 February 2019, 21:12:05
looking for ward to it. good luck.

if your not very familiar with soldering look up a couple how to's on youtube or something.
Title: Re: ADB to USB keyboard converter
Post by: GollyGee on Mon, 11 February 2019, 19:10:52
I know someone who can solder, hopefully all will go well
Title: Re: ADB to USB keyboard converter
Post by: davidkoleda on Sat, 27 April 2019, 04:57:43
Hi,

I purchased a ADB to USB converter from hasu some months ago and now I'm try to use it with my AEKII.

I have an ADB cable running from the keyboard to the converter, and a micro USB, from the converter to PC. First time I attached the keyboard to the converter (which was already connected to the PC) num lock, scroll lock and caps lock LEDs all lit up, and after a short time went off. This happens every time I connect the keyboard, and from that moment on (when the LEDs turn off) the keyboard is like dead.
I am running windows 10 and in device manager, when the keyboard is connected, there is an unrecognized USB device. Tried to update driver, or unistall/install again from there but I had no luck.
I don't know if the keyboard works properly on its own (in an old apple PC) but it's supposed to: I cleaned it and disasselmbled it on my own, and on the inside everything looked perfect, pristine.

Is there something I did wrong? Sorry for asking maybe a trivial question but I wasn't able to find any info regarding this on the readme file on github
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 27 April 2019, 06:33:37
Check USB cable first. Believe me.  Many many people have suffered from crappy USB Micro cables.
https://github.com/tmk/tmk_keyboard/wiki/Troubleshooting#usb-cable
Title: Re: ADB to USB keyboard converter
Post by: davidkoleda on Sat, 27 April 2019, 09:00:31
Check USB cable first. Believe me.  Many many people have suffered from crappy USB Micro cables.
https://github.com/tmk/tmk_keyboard/wiki/Troubleshooting#usb-cable

It actually worked! eheh, thanks!
Title: Re: ADB to USB keyboard converter[Extended Mouse Protocol Support]
Post by: hasu on Sun, 23 June 2019, 03:11:57
Added Apple Extended Mouse Protocol and Kensignton Turbo Mouse support

I got Kensington Turbo Mouse(#64210) the other day and added supprt for Extended Mouse Protocol and the trackball specific crytptic intialization.
You can use Turbo Mouse with all four buttons and 200cpi resoution now. I also confirmed Apple one button mouse(G5431)  200cpi, instead of 100cpi.
https://github.com/tmk/tmk_keyboard/issues/274#issuecomment-504726633

It is possible other multi-button pointing devices work with the converter, perhaps. Some of those devices need to enigmatic commands to enable its full function, unfortunately.
If you have multi-button device try this and let me know your result.

You can get source or prebuilt binary from github repo or  Keymap Editor now.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 24 June 2019, 05:55:14
Excellent @hasu! Thank you for your continued work & dedication to this project.
Title: Re: ADB to USB keyboard converter
Post by: cglegaspi on Thu, 04 July 2019, 15:07:30
Hello to everyone,

First of all I would like to thank all of you for the hard work during the last years! It is really incredible what you guys have achieved.

I have experience in programming but I am a complete noob in flashing this type of board. I am using a Pro Micro board with the specifications that are required, an atmega32u4.

In my mac, after installing CrossPack and creating the .hex file I try to load it into the pro micro by using

avrdude -p atmega32u4 -P /dev/tty.usbmodem25 -c avr109 -U flash:w:unimap.hex

The response is a blink in the Pro Micro and the following simple message:

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

I have tried resetting the board to bootloader but I am not even sure of how to check if it is in bootloader or not, since I don't know how this board works. The first time I plugged it in, my Mac gave me a message about setting up as a keyboard and I discarded it, should it give me this message every time it goes into bootloader mode?

As you can see I am quite lost... any help or directions would be really appreciated
Title: Re: ADB to USB keyboard converter
Post by: cglegaspi on Sat, 06 July 2019, 07:18:52
Well now that I had some more time during the weekend I found the QMK Toolbox, which has given me more insight into what is happening (and a faster reaction time to the 8 seconds of needed to flash the keyboard during the bootloader!).

I managed to flash a self made .hex file from http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

I used the plain one, without making any changes to it.

After flashing, the keyboard appeared to be recognized as its lights blinked, and it showed up in the Apple keyboard manager. So I clicked continue, and clicked on the key next to my Shift key (note that this is an ISO Spain keyboard), but nothing happened. Waited for a while without any result so decided to exit and test outside that. No keystrokes were recorded.

The resulting code from this interaction was:

Quote
*** Caterina device connected
    Found port: /dev/cu.usbmodem1411
*** Attempting to flash, please don't remove device
>>> avrdude -p atmega32u4 -c avr109 -U flash:w:/Users/Aditi/Desktop/unimap.hex:i -P /dev/cu.usbmodem1411 -C avrdude.conf
    avrdude: warning at avrdude.conf:14976: part atmega32u4 overwrites previous definition avrdude.conf:11487.
   
    Connecting to programmer: .
    Found programmer: Id = "CATERIN"; type = S
        Software Version = 1.0; No Hardware Version given.
    Programmer supports auto addr increment.
    Programmer supports buffered memory access with buffersize=128 bytes.
   
    Programmer supports the following devices:
        Device code: 0x44
   
    avrdude: AVR device initialized and ready to accept instructions
   
    Reading | ################################################## | 100% 0.00s
   
    avrdude: Device signature = 0x1e9587
    avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
    avrdude: erasing chip
    avrdude: reading input file "/Users/Aditi/Desktop/unimap.hex"
    avrdude: writing flash (28672 bytes):
   
    Writing | ################################################## | 100% 1.73s
   
    avrdude: 28672 bytes of flash written
    avrdude: verifying flash memory against /Users/Aditi/Desktop/unimap.hex:
    avrdude: load data flash data from input file /Users/Aditi/Desktop/unimap.hex:
    avrdude: input file /Users/Aditi/Desktop/unimap.hex contains 28672 bytes
    avrdude: reading on-chip flash data:
   
    Reading | ################################################## | 100% 0.24s
   
    avrdude: verifying ...
    avrdude: 28672 bytes of flash verified
   
    avrdude done.  Thank you.
   
*** Caterina device disconnected
*** t.m.k. - ADB keyboard converter connected -- 0xFEED:0xADB
  >
   
    TMK:fb84cac5+/LUFA
   
   
    Scan:
    RRRRRRRRRRRRRRRR
    Keyboard:
    Rhadler: 00, ISO: no
    R
    Mouse:
    R
    Scan:
    RRRRRRRRRRRRRRRR
    USB configured.
   
  > Keyboard start.
    RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
*** t.m.k. - ADB keyboard converter disconnected -- 0xFEED:0xADB

I am not sure if it is a fault of the keyboard (repeating R keystroke being recorded), or if it is a fault of the connection (even if I reflash the chip, it never shows the option to configure it as a keyboard with the apple configurer.  Should I be looking for that? When I tried on another windows computer there was no result at all (apart from the computer identifying there is a usb device connected).

In the meantime I will keep trying and documenting. If anyone wiser than me can point me in the right direction that would be great!
Title: Re: ADB to USB keyboard converter
Post by: matty68k on Thu, 25 July 2019, 17:03:59
Hello,
Thank you for your time and effort on this project. However, I have a couple questions before I proceed. I am wondering if someone can verify that I have wired this correctly to the breadboard before I test it with my hardware. I have already flashed the proper .hex file to the Teensy 2.0. Attached below is a picture of my wiring. Sorry for my poor English - it is not my first language. :) I have uploaded my images of my wiring to the website Imgur :: https://imgur.com/a/iX1Wl9F
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 25 July 2019, 17:20:08
It looks ok to me. I guess something wrong is in connecter side.
Just swap vcc and ground or signal lines position if you are not sure about wiring?
I think you can't mess up your keyboard easily unless you were extreamly unlucky person :p

Hello,
Thank you for your time and effort on this project. However, I have a couple questions before I proceed. I am wondering if someone can verify that I have wired this correctly to the breadboard before I test it with my hardware. I have already flashed the proper .hex file to the Teensy 2.0. Attached below is a picture of my wiring. Sorry for my poor English - it is not my first language. :) I have uploaded my images of my wiring to the website Imgur :: https://imgur.com/a/iX1Wl9F

Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 25 July 2019, 17:31:51
Hey, sorry for late reply.
did you finish your converter yet?

The "R" means the conveter couldn't see activity on signal line within specific term(500ms).
But I'm 99% sure that your wiring is wrong.

After flashing, the keyboard appeared to be recognized as its lights blinked, and it showed up in the Apple keyboard manager. So I clicked continue, and clicked on the key next to my Shift key (note that this is an ISO Spain keyboard), but nothing happened. Waited for a while without any result so decided to exit and test outside that. No keystrokes were recorded.

The resulting code from this interaction was:

Quote
*** t.m.k. - ADB keyboard converter connected -- 0xFEED:0xADB
  >
   
    TMK:fb84cac5+/LUFA
   
   
    Scan:
    RRRRRRRRRRRRRRRR
    Keyboard:
    Rhadler: 00, ISO: no
    R
    Mouse:
    R
    Scan:
    RRRRRRRRRRRRRRRR
    USB configured.
   
  > Keyboard start.
    RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
*** t.m.k. - ADB keyboard converter disconnected -- 0xFEED:0xADB

I am not sure if it is a fault of the keyboard (repeating R keystroke being recorded), or if it is a fault of the connection (even if I reflash the chip, it never shows the option to configure it as a keyboard with the apple configurer.  Should I be looking for that? When I tried on another windows computer there was no result at all (apart from the computer identifying there is a usb device connected).

In the meantime I will keep trying and documenting. If anyone wiser than me can point me in the right direction that would be great!

Title: Re: ADB to USB keyboard converter
Post by: matty68k on Thu, 25 July 2019, 19:36:02
There appears to be a wiring issue. I connect the keyboard (US QWERTY / AEK-2) and lights flash but then no keystrokes are sent to the computer. Thank you for being so very patient with me. I may not know a lot, however my desire to learn is immense. You are doing such great things!

It looks ok to me. I guess something wrong is in connecter side.
Just swap vcc and ground or signal lines position if you are not sure about wiring?
I think you can't mess up your keyboard easily unless you were extreamly unlucky person :p

Hello,
Thank you for your time and effort on this project. However, I have a couple questions before I proceed. I am wondering if someone can verify that I have wired this correctly to the breadboard before I test it with my hardware. I have already flashed the proper .hex file to the Teensy 2.0. Attached below is a picture of my wiring. Sorry for my poor English - it is not my first language. :) I have uploaded my images of my wiring to the website Imgur :: https://imgur.com/a/iX1Wl9F
Title: Re: ADB to USB keyboard converter
Post by: brasspanels on Mon, 12 August 2019, 10:32:39
Hello!

I have recently obtained a apple m0116 keyboard. I have created a adb to usb converter using a arduino micro and it works perfectly!
The only question I have is about how to set-up layering so that I can use the function keys. I see that people are using the power button as the layer switch but that does not work if you are using windows. So what are yall using as your layering switch? or should the power button be working in windows ?

Thank you!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 12 August 2019, 17:50:38
Hello!

I have recently obtained a apple m0116 keyboard. I have created a adb to usb converter using a arduino micro and it works perfectly!
The only question I have is about how to set-up layering so that I can use the function keys. I see that people are using the power button as the layer switch but that does not work if you are using windows. So what are yall using as your layering switch? or should the power button be working in windows ?

Thank you!

Where did you see the configuration?

With default keymapping you can use grave and backslash as layer switching key, those key are located next to space bar on M0116.
The power button should work as power button even on Windows if you tap it and it is also 'Magic command' key when you hold it.
Title: Re: ADB to USB keyboard converter
Post by: brasspanels on Mon, 12 August 2019, 20:22:36


Where did you see the configuration?

With default keymapping you can use grave and backslash as layer switching key, those key are located next to space bar on M0116.
The power button should work as power button even on Windows if you tap it and it is also 'Magic command' key when you hold it.

I saw it somewhere in this forum. I might have misread it! For some reason the power button doesn’t work on my end. Every other key works fine tho so maybe there is an issue with the power button itself.

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: leovu on Fri, 23 August 2019, 21:37:51
Great job!  Love seeing this type of stuff. 
Title: Re: ADB to USB keyboard converter
Post by: SebFindsWeirdThings on Sat, 21 September 2019, 07:14:51
Hey hasu.

I've been trying to convert this Japanese AEK II to USB using pro micros for a few weeks now and I'm starting to think that the whole keyboard might just be dead.
I've got images showing what I have at current time -
(https://i.imgur.com/84JdKtn.jpg)
(https://i.imgur.com/dmNo5fN.jpg)
(https://i.imgur.com/X940qFK.jpg)
(https://i.imgur.com/J4kVV7v.jpg)

With this setup, the AEK flashes its LEDs and doesn't respond afterwards. I have a feeling the black cable (labeled as PSW or Power On) might have a place on the pro micro, but I honestly have no idea where to put it. I think I have the correct labelling for the cables anyway - tested it with a multimeter and all.

Any help would be appreciated - I'd love to get this board back to it's original glory.

Thanks!
Title: Re: ADB to USB keyboard converter
Post by: SuccnYeet on Sat, 12 October 2019, 19:37:11
Hi, i have been trying to convert my M0116 for a while now, but it would seem that i have no idea what I'm doing. I have wired it up with a 1k resistor, but i am not sure how to program it or anything. Every article i read says to do something different and nothing seems to work, at this stage all i have done is wire it up. could someone please help me out before I give up? https://imgur.com/n16Inka
Title: Re: ADB to USB keyboard converter
Post by: SuccnYeet on Sun, 13 October 2019, 05:16:58
Hi, i have been trying to convert my M0116 for a while now, but it would seem that i have no idea what I'm doing. I have wired it up with a 1k resistor, but i am not sure how to program it or anything. Every article i read says to do something different and nothing seems to work, at this stage all i have done is wire it up. could someone please help me out before I give up? https://imgur.com/n16Inka

All sorted.
Title: Re: ADB to USB keyboard converter
Post by: supermario802.1 on Sat, 25 January 2020, 16:56:23
Will the adb converter work with atmega328p with v-USB?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 25 January 2020, 20:31:41
No probably.  Current ADB code blocks V-USB executiton and vice versa. As far as I know V-USB can take around 50us to process USB and this makes ADB things harder. If you are still interested in implemening/modify the ADB converter with V-USB yourself I'm happy to help you.

Will the adb converter work with atmega328p with v-USB?

Title: Re: ADB to USB keyboard converter
Post by: Erisie on Mon, 27 January 2020, 21:26:28
Guys, I'm at the end of my rope here. I am building an adapter for an ADB 3M Renaissance Ergonomic mouse using a Pro Micro clone. After soldering the Mini-DIN plug and checking the wiring over and over, plus adding the 1k resistor, I can't get it to work.

Since I couldn't get the tmk Ubuntu Virtual Machine working correctly on my computer (it never detected the board), I tried doing more or less the same steps directly on an Ubuntu live drive by compiling the hex file manually from Github and flashing it in the Pro Micro with avrdude's command line interface. It did not work: neither Ubuntu or Windows 7 detected the board as a HID device, or at all.

Today, I tried flashing the board from Windows 7 using AVRDUDESS with a hex file I got from tmk-kbd.com. Same result as before: after flashing, Windows throws the message "USB Device Not Recognized"; there is not even a port on which the board is connected. However, if I short the reset pins to run the bootloader, I can see the board using USBLogView (https://www.nirsoft.net/utils/usb_log_view.html) as a "Leonardo bootloader" on port COM10 for 8 seconds, only to dissappear again.

What am I doing wrong?


EDIT: Finally made it work! I used this hex (https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/binary/adb_usb_rev1_unimap.hex) from TMK's Github, which I flashed using QMK Toolbox (https://github.com/qmk/qmk_toolbox/releases) directly on Windows. Board is recognized as a HID device and the mouse is operating in Windows. Thank you very much, hasu!

However, there's still an issue to be fixed: this particular mouse has two buttons and the right one is not operating correctly. I am using Browser Mouse Event Test Page (https://unixpapa.com/js/testmouse.html) to see the clicks as the computer sees them.

Left button is recognized as:
Code: [Select]
mousedown   which=1 button=0 buttons=1
mouseup     which=1 button=0 buttons=0
click       which=1 button=0 buttons=0
Which is the same as my regular Intellimouse 1.0.

However, right button is recognized on the first click as:
Code: [Select]
mousedown   which=1 button=0 buttons=1

and on the second click as:
Code: [Select]
mouseup     which=1 button=0 buttons=0
click       which=1 button=0 buttons=0

It's not reading right click as "contextmenu", which is what I think it is supposed to do. Is this particular mouse not supported for multi-button operation? Is it a firmware issue?

Any help would be appreciated.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 03 February 2020, 21:57:30
However, there's still an issue to be fixed: this particular mouse has two buttons and the right one is not operating correctly. I am using Browser Mouse Event Test Page (https://unixpapa.com/js/testmouse.html) to see the clicks as the computer sees them.

Left button is recognized as:
Code: [Select]
mousedown   which=1 button=0 buttons=1
mouseup     which=1 button=0 buttons=0
click       which=1 button=0 buttons=0
Which is the same as my regular Intellimouse 1.0.

However, right button is recognized on the first click as:
Code: [Select]
mousedown   which=1 button=0 buttons=1

and on the second click as:
Code: [Select]
mouseup     which=1 button=0 buttons=0
click       which=1 button=0 buttons=0

It's not reading right click as "contextmenu", which is what I think it is supposed to do. Is this particular mouse not supported for multi-button operation? Is it a firmware issue?

Any help would be appreciated.

Do you have manual of the mouse and driver diskett? They may explain this somewhat. Photos of its package description, manual and the mouse itself would be helpful, most of us never saw and don't know about the mouse at all.

To recognize two or more buttons, you may need to special initialization sequence that vendor-supplied driver did in the old days. The converter includes initialization code for standard mouses with Apple protocol and  Kinsington Turbo Mouse5, but some devices will require special init code to enable their full function.

Anyway, try hid_listen to see debug outputs from the converter.
https://www.pjrc.com/teensy/hid_listen.html

Title: Re: ADB to USB keyboard converter
Post by: Erisie on Wed, 05 February 2020, 00:06:22
Do you have manual of the mouse and driver diskett? They may explain this somewhat. Photos of its package description, manual and the mouse itself would be helpful, most of us never saw and don't know about the mouse at all.

To recognize two or more buttons, you may need to special initialization sequence that vendor-supplied driver did in the old days. The converter includes initialization code for standard mouses with Apple protocol and  Kinsington Turbo Mouse5, but some devices will require special init code to enable their full function.

The mouse itself came in a box similar to this one:
(https://i.imgur.com/FDbrias.jpg)

It included the mouse itself, a leaflet manual and a CD-ROM with utilities for Windows, but no drivers for any platform. In fact, the manual reads: "No driver needed. Mouse will automatically activate" and "No software needed for MAC or iMAC or ADB connector".

Checking the manual, however, I noticed something:
(https://i.imgur.com/fArsNkQ.png)

Right click provides drag function (MAC/iMac Models)

As such, I stand corrected: it seems the mouse is operating as designed, rather than activating context menu as a modern mouse would. In that case, I would need to remap the second button to act as "contextmenu": can TMK firmware do that? Regardless of my chances, I would still be wary of doing the bootloader process again: as I said before, all my attempts at compiling TMK manually did not work; the only firmware that worked for me was the already compiled .hex file I downloaded directly from Github.

Anyway, try hid_listen to see debug outputs from the converter.
https://www.pjrc.com/teensy/hid_listen.html

HID_Listen.exe only outputs the following after plugging in the converter:
Code: [Select]
TMK:fb84cac5+/LUFA


Scan:
 addr:3, reg3:7C01

Keyboard:
hadler: 00, ISO: no

Mouse:
Classic 200cpi

Scan:
 addr:10, reg3:7802

USB configured.

Keyboard start.

In any case, thank you very much for your reply, Hasu.
Title: Re: ADB to USB keyboard converter
Post by: supermario802.1 on Wed, 05 February 2020, 07:49:33
No probably.  Current ADB code blocks V-USB executiton and vice versa. As far as I know V-USB can take around 50us to process USB and this makes ADB things harder. If you are still interested in implemening/modify the ADB converter with V-USB yourself I'm happy to help you.

Will the adb converter work with atmega328p with v-USB?

Yes I would like to try.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 05 February 2020, 17:54:44
As such, I stand corrected: it seems the mouse is operating as designed, rather than activating context menu as a modern mouse would. In that case, I would need to remap the second button to act as "contextmenu": can TMK firmware do that? Regardless of my chances, I would still be wary of doing the bootloader process again: as I said before, all my attempts at compiling TMK manually did not work; the only firmware that worked for me was the already compiled .hex file I downloaded directly from Github.

Anyway, try hid_listen to see debug outputs from the converter.
https://www.pjrc.com/teensy/hid_listen.html

HID_Listen.exe only outputs the following after plugging in the converter:
Code: [Select]
TMK:fb84cac5+/LUFA


Scan:
 addr:3, reg3:7C01

Keyboard:
hadler: 00, ISO: no

Mouse:
Classic 200cpi

Scan:
 addr:10, reg3:7802

USB configured.

Keyboard start.

In any case, thank you very much for your reply, Hasu.

The output indicates the mouse is one-button device, it is common for Mac mouses in that era. The converter checked if the device supports Extended protocol(Multi-button) but it just speaks Classic protocol(one-button). Classic protocol doesn't require any driver while Extended protocol requires initialization process by specific device driver. "No driver needed." in manual is consistent with this result.

Yes, "Right click" provides just "drag" action for the same mouse button. The converter can't discriminate the Right/Left click because the mouse sends them as the same button action unfrotunately.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 05 February 2020, 17:56:23
No probably.  Current ADB code blocks V-USB executiton and vice versa. As far as I know V-USB can take around 50us to process USB and this makes ADB things harder. If you are still interested in implemening/modify the ADB converter with V-USB yourself I'm happy to help you.

Will the adb converter work with atmega328p with v-USB?

Yes I would like to try.

What is your hardware setup, MCU and Crystal frequency?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 06 February 2020, 17:51:27
No probably.  Current ADB code blocks V-USB executiton and vice versa. As far as I know V-USB can take around 50us to process USB and this makes ADB things harder. If you are still interested in implemening/modify the ADB converter with V-USB yourself I'm happy to help you.

Will the adb converter work with atmega328p with v-USB?

Yes I would like to try.

I just remembered blarrg's work and discovered this again. He already made ADB converter successfully with V-USB on USBASP board. Check his sequential posts around here and his github. I think you can start your project easily based on his work, instead of TMK ADB code.

https://geekhack.org/index.php?topic=14290.msg1109173#msg1109173
https://github.com/gblargg/adb-v-usb
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 12 February 2020, 18:33:48
Updated firmware to fix AEK modifier key and ISO support.

On Apple Extended keyboard(and II) left and right modifier keys can be discriminated(except for 'Command' key),
but the converter had failed to support this for these 8 months since last update. Also AEK ISO support had not worked.

If you are using with AEK try new firmware. You can get from Keymap Editor or github repo.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 12 February 2020, 23:22:15
great! thanks hasu!
Title: Re: ADB to USB keyboard converter
Post by: Sonno on Sat, 29 February 2020, 11:51:04
Hi I have some problems while trying to make the converter for my AEK2 with ISO layout.
Reference:
(https://imgur.com/a/YuI0GLP)
[attach=1]

I'm using the latest compiled rev1 hex from here https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/binary (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/binary).

Here's my sloppy wiring, i just desoldered the 1k resistor:
(https://imgur.com/a/wlGUwER)(https://imgur.com/a/9Ybk7rR)
[attach=2]  [attach=3]

And here's the hid_listen log:
Quote
Waiting for new device:....
Listening:


TMK:ce5e565f+/LUFA


Scan:
RRRRRRRRRRRRRRRR
Keyboard:
Rhandler: 00, ISO: no
R
Scan:
RRRRRRRRRRRRRRRR
USB configured.

Keyboard start.
RRRRRRRRRRRRRRRRRRRRRRRRRRR
RRRRRRRRRRRRRRRRRRRRRRRRRRR
RRRRRRRRRRRRRRRRRRRRR

Edited for attaching the pictures, because imgur links seem broken. :confused:
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 01 March 2020, 09:11:54
'R' errors indicate unstable/incorrect connection. On Teensy D0 pin should be used for DATA line.

Post hid_listen log again when you fix it. I like to check how ISO keyobard is detected.
Title: Re: ADB to USB keyboard converter
Post by: Sonno on Sun, 01 March 2020, 17:02:21
'R' errors indicate unstable/incorrect connection. On Teensy D0 pin should be used for DATA line.

Post hid_listen log again when you fix it. I like to check how ISO keyobard is detected.
Thanks a lot! I only had SMD 1/4 watt resistors around, so when i got a normal one i was sure i was wiring it wrong  :confused:
So i soldered the THT component and used the correction that is used with an arduino pro micro.

Now with thw correct wiring and resistor it works almost FLAWLESSLY except some mapping errors (maybe it's windows fault? i think that because looking at my laptop's keyboard i get on screen the same character on that spot, that is different from the one on the AEK)

P.S. tomorrow i'll try to connect the mouse on the other side, thanks a lot for the help and goodnight :3
Here's the log btw!  :D

More
Waiting for new device:...
Listening:


TMK:ce5e565f+/LUFA


Scan:
 addr:2, reg3:6E05

Keyboard:
handler: 05, ISO: yes

Scan:
 addr:2, reg3:6A03

USB configured.

Keyboard start.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 01 March 2020, 19:08:31
Thanks for the log, the converter seems to detect ISO correctly.
Legends on some of AEK keycaps show what you get on AppleII or old Mac. The converter translates AEK keys into usual USB HID keyboard baiscally without any emulation of the old Alpple system.

I'm almost sure both Windows and the converter work correctly. But let me know what the 'mapping errors' are exactly in case that is bug. And what is your keyboard layout on Windows, and AEK language?
Title: Re: ADB to USB keyboard converter
Post by: Sonno on Mon, 02 March 2020, 08:52:29
Thanks for the log, the converter seems to detect ISO correctly.
Legends on some of AEK keycaps show what you get on AppleII or old Mac. The converter translates AEK keys into usual USB HID keyboard baiscally without any emulation of the old Alpple system.

I'm almost sure both Windows and the converter work correctly. But let me know what the 'mapping errors' are exactly in case that is bug. And what is your keyboard layout on Windows, and AEK language?

Hi, I have a UK AEK2 so it has the apple UK layout
from wikipedia: (https://upload.wikimedia.org/wikipedia/commons/0/06/KB_United_Kingdom_Mac_-_Apple_Keyboard_%28MC184B%29.svg)

but i have a normal italian keyboard so for example I get "θ" instead of "[" and "*" instead of "}"
my keyboard for reference: [attach=1]


also the when i try to connect the mouse it freaks out, the keyboard stops working (tried also to plug first the mouse and then everything to the pc) and begins to spit out errors (reg3 remains always between 7001 and 7F01) on hid_listen:
More
Waiting for device:.............
Listening:


TMK:ce5e565f+/LUFA


Scan:
 addr:2, reg3:6B05
 addr:3, reg3:7B01

Keyboard:
handler: 05, ISO: yes

Scan:
 addr:2, reg3:6F03
 addr:3, reg3:7C01

USB configured.

Keyboard start.
M:addr3 reg3: 7501
M:move fail
M:addr3 reg3: 7001
M:move fail
M:addr3 reg3: 7A01
M:move fail
M:addr3 reg3: 7A01
M:move fail
M:addr3 reg3: 7D01

SOMETIMES after a bit everything works again, also the mouse, but not always, sometimes remains stuck giving errors.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 02 March 2020, 18:20:57
Thanks for the log, the converter seems to detect ISO correctly.
Legends on some of AEK keycaps show what you get on AppleII or old Mac. The converter translates AEK keys into usual USB HID keyboard baiscally without any emulation of the old Alpple system.

I'm almost sure both Windows and the converter work correctly. But let me know what the 'mapping errors' are exactly in case that is bug. And what is your keyboard layout on Windows, and AEK language?

Hi, I have a UK AEK2 so it has the apple UK layout
from wikipedia:
Show Image
(https://upload.wikimedia.org/wikipedia/commons/0/06/KB_United_Kingdom_Mac_-_Apple_Keyboard_%28MC184B%29.svg)


but i have a normal italian keyboard so for example I get "θ" instead of "[" and "*" instead of "}"
my keyboard for reference: (Attachment Link)

I think it is normal when you use Italian layout on Windows(or other OS's). It depends on layout setting, you will get '[' and ']' on the keys if you select UK layout on your OS.



Quote
also the when i try to connect the mouse it freaks out, the keyboard stops working (tried also to plug first the mouse and then everything to the pc) and begins to spit out errors (reg3 remains always between 7001 and 7F01) on hid_listen:
More
Waiting for device:.............
Listening:


TMK:ce5e565f+/LUFA


Scan:
 addr:2, reg3:6B05
 addr:3, reg3:7B01

Keyboard:
handler: 05, ISO: yes

Scan:
 addr:2, reg3:6F03
 addr:3, reg3:7C01

USB configured.

Keyboard start.
M:addr3 reg3: 7501
M:move fail
M:addr3 reg3: 7001
M:move fail
M:addr3 reg3: 7A01
M:move fail
M:addr3 reg3: 7A01
M:move fail
M:addr3 reg3: 7D01

SOMETIMES after a bit everything works again, also the mouse, but not always, sometimes remains stuck giving errors.

It seems that initialization and configuration for mouse failed.
what's your mouse?
Title: Re: ADB to USB keyboard converter
Post by: Sonno on Tue, 03 March 2020, 09:06:20
Quote
I think it is normal when you use Italian layout on Windows(or other OS's). It depends on layout setting, you will get '[' and ']' on the keys if you select UK layout on your OS.
Yeah, I put the correct layout while using debian and it works flawlessly (why the heck does it have the, i quote, "UK, Macintosh" layout god only knows, but now i'm sad that windows doesn't have it).

Quote
It seems that initialization and configuration for mouse failed.
what's your mouse?
I'm using an Apple Desktop Bus Mouse 2, Family No: M2706, it says it's been assembled in Ireland, no trace of date and the info are written on a plastic label instead of being carved (?) in the plastic like others of the same model.
There are no other noteworthy information, I should open it soon to clean it, tell me if I need to report anything else!

Thanks a lot for the support you're giving :D
Title: Re: ADB to USB keyboard converter
Post by: supermario802.1 on Wed, 04 March 2020, 17:49:36
Will it work with an ADB keyboard with French layout?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 04 March 2020, 20:02:22
Will it work with an ADB keyboard with French layout?

It should work. I don't think French keyboard is special from converter's perspective.
what is your keyboard exactly?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 06 March 2020, 09:27:23
Quote
It seems that initialization and configuration for mouse failed.
what's your mouse?
I'm using an Apple Desktop Bus Mouse 2, Family No: M2706, it says it's been assembled in Ireland, no trace of date and the info are written on a plastic label instead of being carved (?) in the plastic like others of the same model.
There are no other noteworthy information, I should open it soon to clean it, tell me if I need to report anything else!

Thanks a lot for the support you're giving :D

Can you try attached firmware with the mouse and show me hid_listen log?
With the fixed firmware the converter won't block keyboard probably.

And I can get M2706 mouse cheap to debug this, perhaps.
There seems to be some variants of M2706, which is country your M2706 made in, Taiwan, China, Malaysia, or else?

[attachurl=1]
Title: Re: ADB to USB keyboard converter
Post by: Sonno on Sun, 08 March 2020, 06:27:56
Quote
Can you try attached firmware with the mouse and show me hid_listen log?
With the fixed firmware the converter won't block keyboard probably.
Sorry for the real late reply, I tested it today, now the mouse still doesn't work, but at least the keyboard works and doesn't hang xD
Also the log is different but it still keeps printing errors with only reg3 changing (having debug and/or debug mouse active doesn't change much):
More
M:TMP: reg3:7101
M:EXT: reg3:7D01
M:Classic 100cpi
M:POL: fail reg3:7801

Scan:
 addr:2, reg3:6C03
 addr:15, reg3:7701

Quote
And I can get M2706 mouse cheap to debug this, perhaps.
There seems to be some variants of M2706, which is country your M2706 made in, Taiwan, China, Malaysia, or else?
My mouse only says "Assembled in Ireland" also seems difficult to open without damaging it.
[attach=1]
Title: Re: ADB to USB keyboard converter
Post by: Findecanor on Sun, 08 March 2020, 06:51:53
My mouse only says "Assembled in Ireland" also seems difficult to open without damaging it.
Made by Mitsumi, as indicated by the serial number starting with 'M'.
If you'd need to open it there should be two screws under the printed label, but is that really necessary?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 08 March 2020, 06:57:21
Sonno,
Thanks.
Hmm, the mouse fails to change address in init process for some reason.

Ah, I missed that you already referred to Ireland in previous post.  It is what I wanted.
I'll debug the issue on M2706 when I can obtain the mouse.
Title: Re: ADB to USB keyboard converter
Post by: Sonno on Sun, 08 March 2020, 10:08:00
I'll debug the issue on M2706 when I can obtain the mouse.
Uhm ok, there's something else I can do in the meantime to help?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 13 March 2020, 09:45:11
Sonno,
I couldn't find exact same model as yours here in Japan and got M2706 assembled in Taiwan instead.

(https://i.imgur.com/5XClxmal.jpg)

The mouse works well as long as I tested and couldn't reproduce the issue. It is specific to M2706 assembled in Ireland perhaps.

Code: [Select]
Waiting for new device:..                                                                                                                                                                                                             [0/1885]
Listening:


TMK:a4d4f149+/LUFA


Scan:
 addr:3, reg3:6E01


Keyboard:
handler: 00, ISO: no

Scan:
 addr:3, reg3:6801


USB configured.

Keyboard start.
M:TMP: reg3:6801
M:EXT: reg3:6602
M:Classic 200cpi
M:POL: done

Scan:
 addr:10, reg3:6802

M:[81 81 00 00 00]
M:[B:00 X:1(1) Y:1(1) A:1]
M:[82 80 00 00 00]
M:[B:00 X:0(0) Y:4(2) A:2]
M:[81 80 00 00 00]
M:[B:00 X:0(0) Y:1(1) A:1]
Title: Re: ADB to USB keyboard converter
Post by: Sonno on Fri, 13 March 2020, 11:02:35
Sonno,
I couldn't find exact same model as yours here in Japan and got M2706 assembled in Taiwan instead.

The mouse works well as long as I tested and couldn't reproduce the issue. It is specific to M2706 assembled in Ireland perhaps.

Uhm, if you know how to open it tell me, so i can check if there are differences inside. xD
Title: Re: ADB to USB keyboard converter
Post by: nevin on Fri, 13 March 2020, 11:20:20
Should be a single swrew under the sticker
Title: Re: ADB to USB keyboard converter
Post by: plaquette on Sat, 21 March 2020, 07:16:37
hi everyone!

i thought i use this time of social distancing to revive my old keyboard.

i soldered everything as i was supposed to on the teensy 2.0.

as of now, some keys work fully, some are dead and some are inbetween since they produce an output which is not matched with the keyboard. it is a german keyboard in case thats a useful information.

would be great if you could help me fixing it.

best & many thanks in advance,

p.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 21 March 2020, 21:25:21
hi everyone!

i thought i use this time of social distancing to revive my old keyboard.

i soldered everything as i was supposed to on the teensy 2.0.

as of now, some keys work fully, some are dead and some are inbetween since they produce an output which is not matched with the keyboard. it is a german keyboard in case thats a useful information.

would be great if you could help me fixing it.

best & many thanks in advance,

p.

What model number of your keyobard actually?
I'd say the red keys have hardware fault unless you are sure the keyboard works well.
You will have to take apart completely to clean switches if it has membrane switches.

This just converts ADB keyboards into normal USB keyboards, some keys don't always match to keycap ledgend and how the keys regsiter depends on your keyboard layout on OS. What layout are you using?
Title: Re: ADB to USB keyboard converter
Post by: plaquette on Sun, 22 March 2020, 03:27:30
the family number reads: M0487
- serial number: MM132PN503N

i compiled the firmware with the following layouts: KEYMAP=M0116_ANSI, KEYMAP=M0118_ISO as well as the regular adb_usb_rev1_unimap.hex version.

but i never got any response form the keys mentioned above.

i don't know if it was in working condition.

but it seems quite strange that certain rows won't respond...

thanks!

best, p.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 22 March 2020, 03:41:14
Keyboard is not everlast. The keyboard seems to me have something wrong on those keys.
Clean up the key switches thoroughly, or just get another one.
Title: Re: ADB to USB keyboard converter
Post by: plaquette on Sun, 22 March 2020, 04:15:35
alright - i'll start cleaning :)

what layout would you recommend?
Title: Re: ADB to USB keyboard converter
Post by: plaquette on Sun, 22 March 2020, 06:07:35
i guess its no as clean as i can get it
- still no response from the dead keys :(

is there anything else i could try?

best, p.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 22 March 2020, 07:20:44
as the first post  says, hid_listen may help you.
Title: Re: ADB to USB keyboard converter
Post by: plaquette on Sun, 22 March 2020, 08:15:48
sorry i forgot to mention
- i tried this, but only received a response from the keys i marked green...

best p.
Title: Re: ADB to USB keyboard converter
Post by: plaquette on Sun, 22 March 2020, 11:20:44
http://www.keyboard-layout-editor.com/#/layouts/fb6d2e7d8b753bedffaae1eb9016542b

this is the layout i want to reproduce in the end.

best, p.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 22 March 2020, 20:24:28
http://www.keyboard-layout-editor.com/#/layouts/fb6d2e7d8b753bedffaae1eb9016542b

this is the layout i want to reproduce in the end.

best, p.

Select the most suitable keyboard layout on OS and tweek keys on converter firmware by write C code or edit keyboard. Also use tool like AHK or Karabiner on OS if needed.


sorry i forgot to mention
- i tried this, but only received a response from the keys i marked green...

best p.


I guess your keyboard is faulty and converter can do nothing with it.
You will need to buy other keyboard in decent condition if you can fix it.
Title: Re: ADB to USB keyboard converter
Post by: plaquette on Wed, 25 March 2020, 03:28:34
hi - i tried to access the PCB directly with some wire and it shows, the dead keys stay dead and the other ones react as if i pushed the key. so i guess its safe to say, the PCB is dead :(
Title: Re: ADB to USB keyboard converter
Post by: gnho on Wed, 01 April 2020, 00:38:20
I am using an M0116 and having problem changing the right shift to up when tapped. What's stranger is that it shows up as left shift on QMK configurator. Does it mean that I have to change both left and right shifts to make it work? Thanks!

https://bit.ly/2yq743V

Haha... okay it did work... problem solved...
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 01 April 2020, 00:55:56
I am using an M0116 and having problem changing the right shift to up when tapped. What's stranger is that it shows up as left shift on QMK configurator. Does it mean that I have to change both left and right shifts to make it work? Thanks!

https://bit.ly/2yq743V

Haha... okay it did work... problem solved...

Post how you solved for future reference.
Title: Re: ADB to USB keyboard converter
Post by: gnho on Wed, 01 April 2020, 22:14:31
Here's the solution:

https://bit.ly/2UBhg2j

For people who want to change the arrow keys to a more conventional arrangement. Note that I also use the tap key action to put a layer key and a ctrl key in the right corner.
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Thu, 16 April 2020, 15:06:38
Hello everyone, I am trying to convert an Apple M0116 to usb using Teensy 2.0++ and I have trouble with a firmware. 

I don't have any coding experience so I try to follow hasu's step on Github but I keep stucking when trying to make .hex file. After moving the tmk_keyboard folder to my username folder, I try to do make- command but it kept saying "LUFA may be too old or not found" no matter what I put in. I think I downloaded all the neccessary tool but I have no idea how to check them. Running the hid_listen, the program did not respond anything.

I am using Windows and Cygwin terminal when doing the command line. I also adjust the Makefile Bootloader size to 1024 (for Teensy ++). For the wiring, I am using a 10k pull-up resistor between data and 5V.


Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 16 April 2020, 16:20:11
What error you get exactly when running make?
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Thu, 16 April 2020, 17:23:22
What error you get exactly when running make?

Hi hasu,
When I’m running make, it shows “LUFA may be too old or not found”. I don’t know what I did incorrectly. If you need any pic for clarification, please let me know.  Thanks
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 16 April 2020, 17:43:56
Get/update to the latest source code.
I believe you should  see "LUFA may be too old or not found: try 'git submodule update --init'".
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Thu, 16 April 2020, 18:15:50
Get/update to the latest source code.
I believe you should  see "LUFA may be too old or not found: try 'git submodule update --init'".

Yes, that's exactly what I constantly get while doing a make command.
I just download the master folder again but I still get the same problem. I notice there are some changes in tmk_core/protocol/lufa.mk 28 days ago so it might be the cause?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 16 April 2020, 18:22:30
Oh, I am confused.
Didn't  'git submodule update --init' work for you?

Yes, you seems to have the latest source codes.
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Thu, 16 April 2020, 19:32:01
Oh, I am confused.
Didn't  'git submodule update --init' work for you?

Yes, you seems to have the latest source codes.

What would be the command that I should put in the terminal? Is it
$ make -git submodule update --init
 
Sorry for the whole bunch of silly questions. I've never done anything like this before  :'(
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 16 April 2020, 20:04:47
Oh, I am confused.
Didn't  'git submodule update --init' work for you?

Yes, you seems to have the latest source codes.

What would be the command that I should put in the terminal? Is it
$ make -git submodule update --init
 
Sorry for the whole bunch of silly questions. I've never done anything like this before  :'(

Hmm,
Install 'git' command and change directry to 'tmk_keyboard' then 'git submodule update --init' should work.

What are you trying building firmware for? Prebuilt firmware is not enough for your need?
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Thu, 16 April 2020, 20:39:05
I thought the prebuilt firmware is for ATmega32u2 and Atmega32u4 so I presume I have to make my own .hex file for my Teensy ++ to work. My model is AT90USB1286.
Previously, I downloaded the hex file from http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb then flashed it using teensy loader but it did't work.
I would appreciate if you can make the hex file in keyboard editor and send me for my model. Thanks
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 16 April 2020, 20:45:40
Ah, right. Not available for that model.
You have to build firmware yourself.

EDIT: It should be fun to learn git and compiler things. There are many great resources for them on the internet.
And I believe you have plenty of time at home these days unless you work for medical serivce or public health.
Let me know in that case, I'm happy to build firmware for you.
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Thu, 16 April 2020, 21:40:26
Ah, right. Not available for that model.
You have to build firmware yourself.

EDIT: It should be fun to learn git and compiler things. There are many great resources for them on the internet.
And I believe you have plenty of time at home these days unless you work for medical serivce or public health.
Let me know in that case, I'm happy to build firmware for you.
I will try to learn how to do this for now.

Sooo I am able to clone and use git command to update the submodule and proceed to the next step. Now when I use
$ make -f Makefile clean

everything proceeds but after that, when I am using
$ make -f Makefile

it gives me  this
../../tmk_core/protocol/lufa/lufa.c:651: warning: implicit declaration of functi
on 'clock_prescale_set'
../../tmk_core/protocol/lufa/lufa.c:651: error: 'clock_div_1' undeclared (first
use in this function)
../../tmk_core/protocol/lufa/lufa.c:651: error: (Each undeclared identifier is r
eported only once
../../tmk_core/protocol/lufa/lufa.c:651: error: for each function it appears in.
)
make: *** [obj_adb_usb/protocol/lufa/lufa.o] Error 1

What should I do in this case?

Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 16 April 2020, 23:11:43
From the error messages compiler doesn't seem to find declaration of 'clock_prescale_set' and 'clock_div_1' for some reason.

Frist, you can use github.com search feature to check if those words are defined somewhere in tmk_firmware repository. Enter the word in text box at top of this page and then click 'in this repository' button.
https://github.com/tmk/tmk_keyboard

Hmm, they are used in tmk_firmware but not defined there. There is no useful info in this case.

I use google when I don't have clear idea. Google is your friend and extremely useful in particular when in trouble.
Google with 'clock_prescale_set' or 'clock_div_1', it will lead you to avr-libc pages.

https://www.nongnu.org/avr-libc/user-manual/group__avr__power.html

Now we get to know that those words are defined in avr-libc.

Did you install avr-libc? If so what is its version?
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Fri, 17 April 2020, 16:01:26
<Deleted>
Title: Re: ADB to USB keyboard converter
Post by: bibobim on Fri, 17 April 2020, 16:17:27
From the error messages compiler doesn't seem to find declaration of 'clock_prescale_set' and 'clock_div_1' for some reason.

Frist, you can use github.com search feature to check if those words are defined somewhere in tmk_firmware repository. Enter the word in text box at top of this page and then click 'in this repository' button.
https://github.com/tmk/tmk_keyboard

Hmm, they are used in tmk_firmware but not defined there. There is no useful info in this case.

I use google when I don't have clear idea. Google is your friend and extremely useful in particular when in trouble.
Google with 'clock_prescale_set' or 'clock_div_1', it will lead you to avr-libc pages.

https://www.nongnu.org/avr-libc/user-manual/group__avr__power.html

Now we get to know that those words are defined in avr-libc.

Did you install avr-libc? If so what is its version?
Hi Hasu, I am able to create a hex file but I have no idea where it was lol.  I use git command to clone the folder so I don't know where the directory that locates adb_usb.hex goes.
EDIT: Nevermind I got the file but it does nothing. When I try hid_listen, the only thing I got is RRRRRRRR
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 17 April 2020, 20:25:58
Great, you can build firmware?
You can post how to solve your problem related to compile firmware. What step was needed for your setup?
It would be useful for future reference.

As for the 'RRRR' it is typical error for wrong wirings, check the first post.

Title: Re: ADB to USB keyboard converter
Post by: bibobim on Fri, 17 April 2020, 20:57:13
Great, you can build firmware?
You can post how to solve your problem related to compile firmware. What step was needed for your setup?
It would be useful for future reference.

As for the 'RRRR' it is typical error for wrong wirings, check the first post.
I have to delete the WinAVR in order to use the newest avr-libc which I've already installed. After that everything runs smoothly.
As you said, it's the wiring issue and I am able to fix it as well as changing the resistor to 1k Ohm.
But now when I plug the keyboard in and try hid_listen, all I have is
Listening:

Attached are my Makefile (I only change the model and bootsize) and a screenshot of hid_listen:(
Title: Re: ADB to USB keyboard converter
Post by: shacintom on Sat, 02 May 2020, 12:20:40
Hello Everyone,

since a while i have a cheap digispark Attiny85 laying around.
I was wondering if it's possible to build an ADB converter out of it.
Found this project on Github: https://github.com/jammi/digidb
But when i try to compile it in ArduinoIDE, it gives me a bunch of errors  :-\
Does someone have already a solution or know how to make it work?

Best Regards

----------

EDIT: Found it out! Had to install the Old Arduino IDE :-)
Title: Re: ADB to USB keyboard converter for Teensy
Post by: notyou on Tue, 12 May 2020, 22:51:58
Hi all - it doesn't look like nodnerb is active anymore, but I have a Datadesk Switchboard, and I'm wondering if I'm running into the same problem that he had.

I believe my wiring is correct (power and caps lock are on), and when I look at the System Report on my MacBook Air, it shows "ADB keyboard converter", so I think I flashed it correctly.

But when I run hid_listen.mac, I get nothing, just
Waiting for device:
Listening:


I *don't* have an oscilloscope, nor do I have another ADB keyboard around to test. But worse still, I can't quite understand what changes I could make to the code address what nodnerb discovered. Could you possibly provide a diff/patch or a branch that implements a fix for what he found?

Thank you so much! And just in case I did screw up the wiring, here's some photos.
(https://lh3.googleusercontent.com/pw/ACtC-3cgr24WLPTd5hVohHy5JYOF6BSXCxXUdzhwlAiiO0wcPliXlrEN-nh7y_yUjZpXbct1ITwXXkpyR5-bwFf2NH1xR8y30Oqe_6Bk3aMWitEwghliT03Rk3TdPEAdlnH-89tAwrb6BIBkbAcTFJY7gx4_zQ=w992-h744-no)
(https://lh3.googleusercontent.com/pw/ACtC-3eUKVrd6AITotomgOdkZbJdEXZz8bLLCa8bChP6892VAjCEgLY_Yi4ye_Epv8vWzAsbFU89aV1W5KyLZUPCtgNYWWtb3IFjg9CJQ7-9oYwjRLvisugETKK6ghf-F9SZxjvPxZEFTCMp0xYBMtYGp9q0cw=w558-h744-no)

nodnerb,
Thank you for your feedback! This is good to know.

Quote from: nodnerb;441636
I had some problems with a Datadesk Smartboard, and it wasn't until I got it on an oscilloscope that I found out why...
For some reason, this keyboard sends a '1' as a stop bit (which is against the ADB standard... how did this keyboard ever work on a Mac?).
Also, the timing of the signals is a bit screwy,
__~~~ after 35 us for '1'
___~~ after 56 us for a '0' (This should be 65 us!) - this one is causing random bit-swapping with the default 55 us delay before reading the bit value.
So, for this board, I've changed the read delay to 45 us and disregard the value of the stop bit.
Your keyboard might be compliant for ADB spec though it is not good implementation without enough margin.
If my code could read a bit exactly after 55us it seems to has no problem.  My code intends to read a bit after 55us delay,
but delay time is not so accurate because the code is written in C as you know. It may be imposed a few excess micro seconds in addition to the 55us.

Quote from: nodnerb;441636
I'm going to look into your source code to see how the layer switching works.
Ah, it is a very confusing and chaotic part of my firmware :(
and its broken English comment doesn't work even for me :)
Title: Re: ADB to USB keyboard converter for Teensy
Post by: notyou on Tue, 12 May 2020, 23:19:38
Welp, I'm a dummy. Wrong resistor!

However, there's still some issues - seems like Caps Lock is stuck. But woo, progress!
Title: Re: ADB to USB keyboard converter for Teensy
Post by: notyou on Tue, 12 May 2020, 23:49:53
Welp, I'm a dummy. Wrong resistor!

However, there's still some issues - seems like Caps Lock is stuck. But woo, progress!

Well, here's the output from hid_listen.mac:


$ ./hid_listen.mac
Waiting for device:
Listening:


RRRRRRRRRRRRRRRRRRRM:addr3 reg3: 6301
M:addr15 reg3: 6F04
Ext: [00 00 ] cpi=100
Unknown


Not sure what that means.

And prior to plugging in USB, then ADB, then running hid_listen sometimes the Command-key gets stuck, or the Shift-key. Or now it's the Ctrl-key.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 12 May 2020, 23:52:20
notyou,
As for capslock, it is probably keymapping.
Default firmware has 'Locking Caps Lock' mapping for Caps Lock key, most of ADB keyboard has mechanical locking switch on the key.
I guess Datadesk Switchboard use normal switch for the key.


According to Deskthority wiki Datadesk Switchboard seems to support PC/XT and PS/2 protocol too.
The keyboard came with other cables for XT or PS/2?

https://deskthority.net/wiki/Datadesk_Switchboard
https://deskthority.net/wiki/File:DSI_Modular_Pro_--_DIP_switch_legend.jpg


It would be helpful if you can try my IBMPC converter with the keyboard on XT and PS/2 protocol.
https://geekhack.org/index.php?topic=103648.0
Title: Re: ADB to USB keyboard converter
Post by: notyou on Wed, 13 May 2020, 12:26:58
Yes, the Switchboard uses a normal switch for Caps Lock (there is a DIP switch to have it be used as Ctrl).

I see this in config.h:

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */


But the plain keymap uses LCAP, not KC_LCAP.

I will try commenting out Mechanical Locking support to see if that makes a difference.

Yes, the Switchboard is also PS/2 compatible, but unfortunately it uses a proprietary plug. Or the XT/PS2 interface is broken on my keyboard. I already have a Monoprice PS/2->USB converter, but need to get the right pinouts on the cable.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 13 May 2020, 20:19:54
Yes, the Switchboard uses a normal switch for Caps Lock (there is a DIP switch to have it be used as Ctrl).

I see this in config.h:

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */


But the plain keymap uses LCAP, not KC_LCAP.

I will try commenting out Mechanical Locking support to see if that makes a difference.

LCAP and KC_LCAP are identical, you can omit 'KC_' in keymap file.
Just use CAPS instead of LCAP in you keymap file, or use normal 'Caps Lock' in Keymap Editor.


Quote
Yes, the Switchboard is also PS/2 compatible, but unfortunately it uses a proprietary plug. Or the XT/PS2 interface is broken on my keyboard. I already have a Monoprice PS/2->USB converter, but need to get the right pinouts on the cable.

OK. No problem. Thanks for the explanation.
Title: Re: ADB to USB keyboard converter
Post by: notyou on Thu, 14 May 2020, 17:25:24
More on the Switchboard:

So the left and right Shift Keys seem to work fine. I believe the Left and Right Command Keys work ok.

Where things get wonky is with the Caps Lock and Left Control key.

I think part of the issue is that the Switchboard has a weird DIP switch setting to let you make Caps Lock into a Control key.

The Caps Lock does *not* mechanically lock, but sometimes it seems to trigger a Shift Lock.

The Left Control key doesn't seem to do anything, but when I use the Right Control key, it seems to get locked.

I've tried running hid_listen to get some diagnostics out of the keyboard, but I'm not seeing anything for the Caps Lock/Control keys. Is there a way to view what's actually getting sent by the keyboard?

Thank you!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 14 May 2020, 18:36:13
Some ADB keyboards emulate locking CapsLock by firmware, so you can't remap Caps Lock key to Control and have to use 'LCAP' on the key in the case.

How do you configure the DIP switches?  'SHIFTED PERIOD' affects something on the key?
Didn't  you get manual or something with the keyboard?

Press Power and x to see keyboard matrix state and scancodes on hid_listen.
Title: Re: ADB to USB keyboard converter
Post by: kelvinhall05 on Mon, 18 May 2020, 09:15:29
Can I use a 180ohm resistor as my pull-up resistor? Literally the only thing I have around...
Title: Re: ADB to USB keyboard converter
Post by: notyou on Mon, 18 May 2020, 14:44:16
Some ADB keyboards emulate locking CapsLock by firmware, so you can't remap Caps Lock key to Control and have to use 'LCAP' on the key in the case.

How do you configure the DIP switches?  'SHIFTED PERIOD' affects something on the key?
Didn't  you get manual or something with the keyboard?

Press Power and x to see keyboard matrix state and scancodes on hid_listen.

Hi, I have not enabled SHIFTED PERIOD. I believe it would basically disable the > character on this keyboard (which is weird.) The manual is long gone (although I'm sure somebody has posted a scan of it), but the DIP switch settings are printed on the lid.

Anyways, thank you for the key combo to get scancodes. Here's what I saw. I appreciate any help!

Left Control:
Code: [Select]
(Nothing)

Left Option:
Code: [Select]
adb_host_kbd_recv: FF3A
r/c 01234567
00: 00000000
01: 00000000
02: 00000000
03: 00000000
04: 00000000
05: 00000000
06: 00000000
07: 00100000
08: 00000000
09: 00000000
0A: 00000000
0B: 00000000
0C: 00000000
0D: 00000000
0E: 00000000
0F: 00000000
adb_host_kbd_recv: FF3A

Left Alt:
Code: [Select]
adb_host_kbd_recv: FF37
r/c 01234567
00: 00000000
01: 00000000
02: 00000000
03: 00000000
04: 00000000
05: 00000000
06: 00000001
07: 00100000
08: 00000000
09: 00000000
0A: 00000000
0B: 00000000
0C: 00000000
0D: 00000000
0E: 00000000
0F: 00000000
adb_host_kbd_recv: FF37

Left Shift:
Code: [Select]
adb_host_kbd_recv: FF38
r/c 01234567
00: 00000000
01: 00000000
02: 00000000
03: 00000000
04: 00000000
05: 00000000
06: 00000001
07: 10100000
08: 00000000
09: 00000000
0A: 00000000
0B: 00000000
0C: 00000000
0D: 00000000
0E: 00000000
0F: 00000000
adb_host_kbd_recv: FF38

Caps Lock (with DIP switch set to normal):
Code: [Select]
adb_hos5: 00000000
06: 00000001
07: 11100000
08: 00000000
09: 00000000
0A: 00000000
0B: 00000000
0C: 00
0F: 00000000

Right Alt:
Code: [Select]
adb_host_kbd_recv: FF37
adb_host_kbd_recv: FF37

Right Option:
Code: [Select]
adb_host_kbd_recv: FF7C
r/c 01234567
00: 00000000
01: 00000000
02: 00000000
03: 00000000
04: 00000000
05: 00000000
06: 00000001
07: 11100000
08: 00000000
09: 00000000
0A: 00000000
0B: 00000000
0C: 00000000
0D: 00000000
0E: 00000000
0F: 00001000
adb_host_kbd_recv: FF7C

Right Control:
Code: [Select]
adb_host_kbd_recv: FF7D
r/c 01234567
00: 00000000
01: 00000000
02: 00000000
03: 00000000
04: 00000000
05: 00000000
06: 00000001
07: 11100000
08: 00000000
09: 00000000
0A: 00000000
0B: 00000000
0C: 00000000
0D: 00000000
0E: 00000000
0F: 00001100
adb_host_kbd_recv: FF7D

Right Shift:
Code: [Select]
F7B
r/c 01234567
00: 00000000
0100000
09: 00000000
0A: 00000000
000000
0E: 00000000
0F: 00011100
db_host_kbd_recv: FF7B
Title: open
Post by: macDaf on Sat, 30 May 2020, 21:19:31
Hello, where server will reopen?
Title: Re: ADB to USB keyboard converter
Post by: zammykoo on Sun, 12 July 2020, 00:20:40
My first mechanical keyboard came in the mail today and I got my converter protoype working fairly quickly. Thank you Hasu!

(https://i.imgur.com/eAW6Td3.jpg)
(https://i.imgur.com/DAoD8pq.jpg)
Title: Re: ADB to USB keyboard converter
Post by: envyy24 on Wed, 22 July 2020, 15:10:01
Hi Hasu any everyone,

First off thanks for sharing this great knowledge. I have managed to make on converter myself for my m0116. However it works only once, as when I unplugged it to fix one of the switch (it is broken) and plugged it back in, it now does not work. Any suggestions on how to troubleshoot this?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 22 July 2020, 15:25:01
Hi Hasu any everyone,

First off thanks for sharing this great knowledge. I have managed to make on converter myself for my m0116. However it works only once, as when I unplugged it to fix one of the switch (it is broken) and plugged it back in, it now does not work. Any suggestions on how to troubleshoot this?
- Double check all your connections make sure nothing came loose.
- unplug everything & plug it all back in
Title: Re: ADB to USB keyboard converter
Post by: envyy24 on Wed, 22 July 2020, 15:32:28
Hi Hasu any everyone,

First off thanks for sharing this great knowledge. I have managed to make on converter myself for my m0116. However it works only once, as when I unplugged it to fix one of the switch (it is broken) and plugged it back in, it now does not work. Any suggestions on how to troubleshoot this?
- Double check all your connections make sure nothing came loose.
- unplug everything & plug it all back in

Thanks man check and plug everything in still does not work. It is not the prettiest but i think i soldered the pins in pretty good
https://i.imgur.com/uvVJnpn.jpg
https://i.imgur.com/Soj3TxS.jpg

Could it be something wrong with the pro micro? As my oc once recognize it as a keyboard and now it does not?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 22 July 2020, 15:37:34
Make sure nothing is shorting on those legs of the resistor
Title: Re: ADB to USB keyboard converter
Post by: envyy24 on Thu, 23 July 2020, 02:35:37
Make sure nothing is shorting on those legs of the resistor

Can you specify more what should I look for? Thanks man
Title: Re: ADB to USB keyboard converter
Post by: envyy24 on Thu, 23 July 2020, 09:50:18
@Nevin: it is working now. I did two things differently, they may contribute to it or not IDK. One is that i start to plug things in in order of keyboard -> adapter -> to pc. The other thing i did is changing to the other port of the keyboard.

So it works now. it could be that one of my port is broken. Cheers for all your help mate.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Thu, 23 July 2020, 09:57:47
yes, that's the order you should do it. that way there is a keyboard connected to the converter when you plug it into the computer

glad you got it working.

....when you get a chance, tidy up the converter. there should not be that much wire/resistor legs exposed (you're just asking for trouble).
Title: Re: ADB to USB keyboard converter
Post by: envyy24 on Thu, 23 July 2020, 10:15:14
yes, that's the order you should do it. that way there is a keyboard connected to the converter when you plug it into the computer

glad you got it working.

....when you get a chance, tidy up the converter. there should not be that much wire/resistor legs exposed (you're just asking for trouble).

definitely, first time doing this sort of thing. I will get on it right tonight i think, now im pretty confident of how to get this working woohoo.
Title: Re: ADB to USB keyboard converter
Post by: Verseus Tahl on Thu, 01 October 2020, 16:29:24
Hello, I am attempting to make my own ADB to USB converter, and I am attempting to make the hex file, but I am getting an error.

I am using OS X, and after I navigate the the correct project folder, I run the command "make -f Makefile.rev1 clean" followed by "make -f Makefile.rev1." Both commands result in this error message:
'''
../../tmk_core/protocol/lufa.mk:12: *** LUFA may be too old or not found: try 'git submodule update --init'.  Stop.
'''

I've tried searching for additional info, but I haven't had any luck thus far.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 01 October 2020, 18:31:27
The error message was not helpful enough?
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Mon, 30 November 2020, 19:28:50
I'm awaiting a NeXT ADB keyboard (QWERTZ). As I understand, there isn't a mapping for it - yet.
To be prepared for this, I've decided to test the HID Listen program with my Teensy and my AEK II. And e.g. later find out which handler id the NeXT keyboard has got, etc.
But, alas! on my Mac with OSX 11 (Big Sur), I've get the message "Bad CPU type in executable".
Any hints on how to build HID Listen for OSX 11?
Or has even anyone experimented with such a keyboard?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 01 December 2020, 02:00:43
I'm awaiting a NeXT ADB keyboard (QWERTZ). As I understand, there isn't a mapping for it - yet.
To be prepared for this, I've decided to test the HID Listen program with my Teensy and my AEK II. And e.g. later find out which handler id the NeXT keyboard has got, etc.
But, alas! on my Mac with OSX 11 (Big Sur), I've get the message "Bad CPU type in executable".
Any hints on how to build HID Listen for OSX 11?
Or has even anyone experimented with such a keyboard?

Try this 64-bit binary. From Catarina 10.15 Mac OS doesn't support 32-bit binary anymore.
https://github.com/tmk/hid_listen/raw/master/binaries/hid_listen.mac64

Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Tue, 01 December 2020, 06:36:37
@hasu
Thanks - the 64bit binary works great!
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Fri, 25 December 2020, 15:59:06
Hello,
I need help to modify the source code for my QWERTZ NeXT keyboard (ADB).
Problem: How can I remap e.g. <ALT>-8, which gives { to send [ to the computer? Of course I could re-map it in the OSX settings, but it would be much more elegant to solve it in tmk_keyboard.
I've looked into the source code, e.g. action map.h etc., but I couldn't identify the right spot. And I couldn't find the right type of macro. I've also liked into ACTION_MODS_KEY, but this is also not the right way.

Thanks in advance!
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 25 December 2020, 18:40:03
What is your layout on the OS and how can you get [ with normal USB keyboard there?
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sat, 26 December 2020, 09:31:04
Hello,

this is the normal layout of a QWERTZ keyboard on OSX.
[attachimg=2]
<ALT-5> maps to "[", <ALT-6> to "]", <ALT-7> to "|", etc.
The standard adb-usb mapping works this way. And normally you want exactly this behaviour, e.g. with an QWERTZ AEK II keyboard.
So, to get "[" either on an AEK II (QWERTZ) with ADB-USB converter or on an QWERTZ USB keyboard, you press <ALT-5>.

But unfortunately, on the QWERTZ ADB NeXT keyboard, the printing on the keys mirrors in this area a PC keyboard:
[attachimg=1]
Here <ALT-7> should map to "{" instead of "|", etc.

In OSX I've got the standard keyboard settings and behaviour.

Perhaps helpful: The key "7" gives in the matrix-scan function of matrix.c the value 0x1A when pressed, and 0x9A when released, "8" 0x1C and 0x9C, "9" 0x19 and 0x99. So the scan codes(?) on the NeXT ADB keyboard are basically sound.

Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 26 December 2020, 10:35:06
The converter works as expected and this is not a bug. The scan codes are identilcal to Apple ADB keyboard, NeXT supplied that layout on computer(not keyobard).

Are you just curious or really eager to use the NeXT layout? You don't care legends on key when you can touch type :D

You will have to send 'Alt + 5' to get '[' on MacOS when depressing Alt and 8 key probably, for example.
(Alt should be AltGr(Right Alt) here, right? I don't know how QWERTZ keyboard actually works.)

First, you should set ACTION_LAYER_MODS(layer-3, KC_RALT) on the Alt key and map 8 key to 5 on layer-2.

I think you get '[' with AltGr + 8 key using this mapping. Check Right Alt on layer0 and 8 on layer3.
Use 'Code Edit' tab to see/edit 'ACTION_LAYER_MODS()'.
https://bit.ly/2WIVB8q



Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 26 December 2020, 11:05:41
Can you share hid_listen log at startup?
https://github.com/tmk/tmk_keyboard/wiki#hid_listen

I like to know halder_id of the NeXT QWERTZ keyboard and how the converter recognize it.
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sat, 26 December 2020, 13:15:28
Can you share hid_listen log at startup?
https://github.com/tmk/tmk_keyboard/wiki#hid_listen

I like to know halder_id of the NeXT QWERTZ keyboard and how the converter recognize it.

Device disconnected.
Waiting for new device:.........
Listening:


TMK:93e9ee22+/LUFA


Scan:
 addr:2, reg3:6103

Keyboard:
handler: 03, ISO: no

Scan:
 addr:2, reg3:6603

USB configured.

Keyboard start.

Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sat, 26 December 2020, 13:56:21
The converter works as expected and this is not a bug.
ACK. I don't count this as bug - the NeXT QWERTZ ADB keyboard simply differs much from other keyboards, as we can see.

Quote
Are you just curious or really eager to use the NeXT layout? You don't care legends on key when you can touch type :D
I'm no touch typist, so I'm eager to use the NeXT layout.  :)

Quote
You will have to send 'Alt + 5' to get '[' on MacOS when depressing Alt and 8 key probably, for example.
Works with your hints (lay 3 etc., but... the Mac interprets it as "ό".  :rolleyes: As intended by the software, no bug, either.

But now I have to work out how to use a macro to get "[" etc.

Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sat, 26 December 2020, 14:04:57
The layout of the QWERTZ ADB NeXT keyboard is really unique, is it?
[attach=1]

<CRTL> and <CAPSLOCK> (the locking type, but without indicator LED) are reversed.
Notice the two [ i ]-keys right and left from the spacebar, and the command key right under the spacebar. And the position of the "|,\,˜" on the right of the bottom row - interesting.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 27 December 2020, 00:31:28
The converter recognzies it as non-ISO keyboard according to that debug output. NeXT german keyboard should be handled in different way from Apple ISO keyboard probably.

Esc, '<'(between left shift and Y) and #(next to return) key work as expected?
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sun, 27 December 2020, 05:18:48
The converter recognzies it as non-ISO keyboard according to that debug output. NeXT german keyboard should be handled in different way from Apple ISO keyboard probably.
Yes, I think so, too.

Quote
Esc, '<'(between left shift and Y) and #(next to return) key work as expected?
Yes, without a flaw.

So far, I've managed to modify [attachmini=1] so that nearly everything works fine. I believe the way I've achieved this was a little bit crude, but it works. This is still work in progress! E.g. I need to translate some comments to english, insert more comments, etc., etc.

What remains is the "|\˜"-key (code 0x32 / 0xB2) on the bottom row to work as intended. For this, I need to use macros. Problem here: I've found fine examples how to implement action_get_macro, but as far as I can see, they can only be used in keycap.c, which isn't part of adb_usb, or in some xxx_hasu files. I'm a little bit stuck here. :-(
EDIT: I've managed macros! So I will hopefully soon be able to post my solution here.
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sat, 02 January 2021, 12:16:01
NeXT QWERTZ ADB keyboard on a Mac
Hello,
first, I like to thank hasu for his valuable advice. It has been of great help for me!

Now the good news: I was able create a modified version of the firmware - see below [attachmini=1] and [attachmini=2] - that maps the NeXT ADB QWERTZ keyboard according to its layout and the imprints on the keys.
The bad news: This modified version is suitable only for OSX (german keyboard setting), not for Windows or Linux. The macros e.g. to get "[" are OSX specific. Some experiments with a windows PC have shown that most keys are mapped correctly with the standard firmware. But not all. So in my opinion, to use this NeXT keyboard with a Windows or Linux PC another version of the firmware tailored for this is needed.

Here the layout of the keyboard:
[attach=3]

Some remarks about my modifications:


EDIT: For an unknown reason, the original file attachments have been empty. Second try.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 02 January 2021, 21:10:45
Fritz the German,
Attached files is downloaded as empty file, can you check them again?
Thanks to share your work.
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sun, 03 January 2021, 06:42:06
Fritz the German,
Attached files is downloaded as empty file, can you check them again?
Thanks to share your work.
Here they are.
[attachurl=1]
[attachurl=2]
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sun, 03 January 2021, 10:10:36
Interesting. NeXT seems to use ADB scan codes in a bit different way.
I'm curious about its scan code of keys below especially.

1. <>(between Left Shift and Y)
2.  #^(next to Return),
3.  '`@(next to Backspace)
4. \|~(at right bottom) [0x32 you refered this before]
5. ESC
6. 'Command' bar
7. [ i ] keys

Can you check scan code of the keys with applying this patch?

Thanks


Code: [Select]
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index f4bf50c1..ac88cab5 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -387,10 +387,12 @@ uint8_t matrix_scan(void)
         tick_ms = timer_read();
 
         codes = adb_host_kbd_recv(ADB_ADDR_KEYBOARD);
+        if (codes) xprintf("%04X ", codes);
 
         // Adjustable keybaord media keys
         if (codes == 0 && has_media_keys &&
                 (codes = adb_host_kbd_recv(ADB_ADDR_APPLIANCE))) {
+            xprintf("m:%04X ", codes);
             // key1
             switch (codes & 0x7f ) {
             case 0x00:  // Mic

You will see raw scan codes like below on 'hid_listen' tool with this patch. 'FF' should be ignored here.
Code: [Select]
TMK:e7aa9e5c+/LUFA


Scan:
 addr:2, reg3:6C01

Keyboard:
handler: 01, ISO: no

Scan:
 addr:2, reg3:6701

USB configured.

Keyboard start.
32FF B2FF 2AFF AAFF 00FF 80FF 01FF 81FF
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sun, 03 January 2021, 11:55:22
Hello,
here are the scan codes of the NeXT QWERTZ keyboard. To complete the picture, I've included some other scan codes of it as well. The green power button doesn't show up, in contrast to the power button on my AEK II, which gives 7F7F FFFF.
Additional scan codes.



Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 04 January 2021, 00:32:25
Thanks for the your work.
NeXT German keyboard works deferently from Apple ISO keyobard, but I think current firmware can recognize the keys as expected. Good to know.

As for Power key of the NeXT keyboard you can read PSW pin for the key. PSW pin support is disabled on default firmware but you can eanable it.


You can check PSW line state with this patch, for example.

Code: [Select]
diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h
index 3500188d..fb7777c0 100644
--- a/converter/adb_usb/config.h
+++ b/converter/adb_usb/config.h
@@ -45,7 +45,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define ADB_PIN         PIND
 #define ADB_DDR         DDRD
 #define ADB_DATA_BIT    0
-//#define ADB_PSW_BIT     1       // optional
+#define ADB_PSW_BIT     1
 
 /* key combination for command */
 #ifndef __ASSEMBLER__
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index f4bf50c1..89ba3adc 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -380,6 +380,12 @@ uint8_t matrix_scan(void)
     codes = extra_key;
     extra_key = 0xFFFF;
 
+#ifdef ADB_PSW_BIT
+    if (!adb_host_psw()) {
+        xprintf("psw ");
+    }
+#endif
+
     if ( codes == 0xFFFF )
     {
         // polling with 12ms interval
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Thu, 21 January 2021, 07:42:23
Hi there.
I have an AEKII, and I set up the keys. I attached it down bellow.
It works fine, except the Alt Gr key. It's set as an RAlt, but it doesn't quite work that way seemingly. Since I'm using a hungarian layout, this is a problem for me. Literally everything is hidden under the Alt Gr key, incl. the @, #, [, ], { ,} keys. Using the simple Ralt, Sharpkeys doesn't even know what it is really. Control Alt Delete works. So it knows it is an alt. But a wrong kind of alt.
However, it works an an AltGR if I map it to the REAL altGR of the AEKII. And the windwos key does not work now. I'm confused af.

Can someone help me set it up correctly please? Thanks a lot. I want to make this, and an M0118 as my primary.

EDIT: It is only willing to send the Alt Gr scancode (checked with sharpkeys) when it's set to the Real alt gr. Any other combinations, and it will not work as an alt gr. This is annoying on windows especially.
EDIT 2: I've used this: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1
on my Teensy 2.0. Seems like my only way to do this is to rewire the keys... Which, I REALLY don't want to do.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Thu, 21 January 2021, 10:50:50
this is a known limitation on some of the apple boards. whether it be how they are wired electrically or how they are implemented in the adb protocol.

was mentioned here as well
https://geekhack.org/index.php?topic=14290.msg1495044#msg1495044
but it says
Quote
While Extended keyboard(AEK and AEKII) has discriminate between left and right modifier keys except Command keys.
so you might be in luck, just have the wrong keycode in the keymap or something.

there has also been a replacement pcb that was started for the AEK/AEKII. (not sure how far along it is)
https://geekhack.org/index.php?topic=94144.0

what does your board look like? pic? ansi? iso? (not positive about international models)
i can help you with a keymap if you're not finding what you're looking for.
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Thu, 21 January 2021, 12:33:32
this is a known limitation on some of the apple boards. whether it be how they are wired electrically or how they are implemented in the adb protocol.

was mentioned here as well
https://geekhack.org/index.php?topic=14290.msg1495044#msg1495044
but it says
Quote
While Extended keyboard(AEK and AEKII) has discriminate between left and right modifier keys except Command keys.
so you might be in luck, just have the wrong keycode in the keymap or something.

there has also been a replacement pcb that was started for the AEK/AEKII. (not sure how far along it is)
https://geekhack.org/index.php?topic=94144.0

what does your board look like? pic? ansi? iso? (not positive about international models)
i can help you with a keymap if you're not finding what you're looking for.

Dude... you're awesome.
Really, they appear to be the same. Now I solved the problem, well... a bit weirdly, but I did anyway. I set Alt Gr to Left Apple Key, and it works flawlessly since they are the same. If I ever needed Left Alt, I set it to Right Apple Alt Gr (the only reason is to use Alt F4 to exit form a few programs), and set a windows key to Left apple alt. Best of both worlds in my honest oppinion.

Now another question: The Num Equal outputs a "5". Scancode according to sharpkey: 0x0059. Is there any way I can make it spit out Equals in hungarian keyboard layout set in windows?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Thu, 21 January 2021, 12:52:33
glad you got it partly sorted.

keypad equal...
what does the "5" output?
what keymap are you using? unicode?
international gets a little funky... not real good documentation... check http://kbdlayout.info/kbdhu/scancodes+scancodes (hopefully this will help)
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Thu, 21 January 2021, 13:49:28
Num 5 outputs: 4C. Corresponds with the page you sent me.
5/% (Num row) outputs: 06. Corresponds with the page
Apple EKII Numpad Equal: 00_59, Unknown according to sharpkey.

EDIT: Fck... Altgr prtscrn messed it up xD Sorry, my bad. Just pretend that it says: 00_59, Unknown
EDIT2: I'm just asking, is there a way to implement macros in this? I think quite a few people would find it useable, and it'd make it the ultumate macro board, like the Gateway anykey xD
Title: Re: ADB to USB keyboard converter
Post by: nevin on Thu, 21 January 2021, 14:00:51
the apple keyboards numpad enter is different than the normal "enter/return" in the alpha block. but on a PC they probably show up the same way. so you could substitute it for the normal "enter" (from the alpha block) if it doesn't understand the mac number-pad "enter"

i don't know if it actually sends a shifted "return" key scan code but that's how the keypad "enter" acts on apples. (like a shifted "return")

or plug in a hungarian usb membrane keyboard and see what code you get for the numberpad enter and use that.... sorry, don't know the specifics... i'm on a mac (not a PC) and in the us.

you can refer to
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keycode.txt
and try the couple noted there
Code: [Select]
KC_PENT key Pad ENTer
or
Code: [Select]
KC_ENT the regular alpha block ENTer
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Thu, 21 January 2021, 14:53:34
The Numpad Enter works flawlessly. I've got problems with this:
If I press this, it spits out a "00_59: Unknown" scancode, which in Notepad (or wherever) prints a 5 out.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Thu, 21 January 2021, 15:05:55
there's
Code: [Select]
KC_PEQL         67 Keypad =and
Code: [Select]
KC_EQL          2E Keyboard = and +and
Code: [Select]
KC_KP_EQUAL_AS400                   86 Keypad Equal Sign29 which sounds like it's specific to the AS400
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Fri, 22 January 2021, 12:57:35
there's
Code: [Select]
KC_PEQL         67 Keypad =and
Code: [Select]
KC_EQL          2E Keyboard = and +and
Code: [Select]
KC_KP_EQUAL_AS400                   86 Keypad Equal Sign29 which sounds like it's specific to the AS400


How can I make it output that scancode?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Fri, 22 January 2021, 13:32:39
you can change them in the configurator
did you buy your converter? which version 1 or 2?
or did you make a converter? teensy? promicro?

let me know what converter you have, so you get the correct configurator for your converter
you can see the whole list here:
http://www.tmk-kbd.com/tmk_keyboard/editor/index.html

from there, it's just clicking on the key you want to change in the layout, and clicking the corresponding key below in the tabs you want to change it to.

it looks like it's keypad equals, you could try changing it to number row equal 1 2 3 4 5 6 7 8 9 0 - (=) if it's not understanding keypad equals (as this is not on a typical PC numberpad).

[attach=1]
typical PC numberpad
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Fri, 22 January 2021, 16:02:26
I've built it with a Teensy 2.0 myself.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Fri, 22 January 2021, 16:46:37
ok. then you want this one
TMK Converter rev.1(ATmega32U4)
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 22 January 2021, 18:12:43
nevin,
Thank you for your help!


casualdehid,
The key is assigned to keycode 'PEQL'(keypad equal) on default keymap. The keycode(USB usage 0x67) works on Linux and MacOS but doesn't on Windows.
If you are on Windows you need to remap the key with 'EQL'(equal) or anything you want on TMK Keymap Editor, as nevin already suggested.



Instead of 'PEQL', using 'EQL' on the default keymap would be useful for Windows users as long as it doesn't cause problems for other OSes. I'll check this some later.
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Sat, 23 January 2021, 16:01:39
I'm using this, and built at least 30 firmwares with it trying to get the layers to work properly. I'll need help when I'll get my M0118 early next month.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sat, 23 January 2021, 17:16:15
what are you having trouble with?
are you on discord? (little easier to quickly chat there)

i can help you with layers, just let me know what you're looking to do.
PM sent
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 26 January 2021, 17:38:40
casualdehid,
Quote
Also, saw the remapping of Num = in the changelog. Today, I downloaded a firmware from the TMK Version 1 editor, and it still just outputs a "5", even if I set it to ENG ANSI layout in Windows.


Post 'hid_listen' log when pressing the key.
It should look like this.


Code: [Select]
Waiting for new device:....................................
Listening:


TMK:a36eff92/LUFA


Scan:
 addr:2, reg3:6C01

Keyboard:
handler: 01, ISO: no

Scan:
 addr:2, reg3:6201

USB configured.

Keyboard start.
51FF D1FF 51FF D1FF 51FF D1FF 51FF D1FF 51FF D1FF

Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 26 January 2021, 19:39:16
i was talking to casualdehid (discord voice chat), and for his hungarian layout, to get "=" from the number row, he presses "shift" + "7"

i was telling him about how the layers & such work. he was hoping to use the power key on the AEKII to cycle toggle through the layers... something like, tap once for layer 1, tap twice for layer 2, etc.... i said i didn't think that was an option, and suggested the "action_layer_tap_key" to get dual function keys so he didn't have a handful of dedicated Fn/layer keys.

i believe he is starting to figure out what all the different options are and how to use the configurator.

@hasu, with international layouts, is there a way to specify a specific character that's not already in the keycodes?
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keycode.txt

instead of "KC_" could you specify the scancode instead? or would that not parse correctly because it's a different format or not a variable the firmware is expecting?
Hungarian layout   http://kbdlayout.info/kbdhu
the Hungarian scancodes    http://kbdlayout.info/kbdhu/scancodes+scancodes
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 26 January 2021, 21:15:10
i was talking to casualdehid (discord voice chat), and for his hungarian layout, to get "=" from the number row, he presses "shift" + "7"

Interesting. He can't get  '=' with the key in Hungarian layout perhaps, but I beleive he can get it in US layout.

I updated prebuilt firmware and changed default keymap a few days ago, the key is assigned to keycode  '='(EQL) instead of 'keypad ='(PEQL) now.
With the latest firmware he can get character '=' on Windows, as long as he use US layout on the OS at least.
I guess the '='(EQL) emits character 'ό' in Hungarian layout, though.

But I still don't understant why he get character '5' with the key.
Debug prints and more detailed info from him would be needed.



Quote
i was telling him about how the layers & such work. he was hoping to use the power key on the AEKII to cycle toggle through the layers... something like, tap once for layer 1, tap twice for layer 2, etc.... i said i didn't think that was an option, and suggested the "action_layer_tap_key" to get dual function keys so he didn't have a handful of dedicated Fn/layer keys.

i believe he is starting to figure out what all the different options are and how to use the configurator.

In default ADB covnerter firmware Power key is used for special function 'Magic keys', you will have to build firmware to chage the configuration if this prevents you.


Quote
@hasu, with international layouts, is there a way to specify a specific character that's not already in the keycodes?
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keycode.txt

instead of "KC_" could you specify the scancode instead? or would that not parse correctly because it's a different format or not a variable the firmware is expecting?
Hungarian layout   http://kbdlayout.info/kbdhu
the Hungarian scancodes    http://kbdlayout.info/kbdhu/scancodes+scancodes

Probably you can do both but I think it is not that good idea.
I don' t have plan to add code names specific to international layouts. As you know USB specification uses QWERTY US layout by default.
In French AZERTY you should use KC_Q for 'a' key and KC_A for 'q' with TMK, for example.

You can swap definitions of KC_Q and KC_A with C-preprocessor trick probably, but I think it is just confusing for people who already know how USB keyboard works correctly.


Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 26 January 2021, 21:37:41
thanks hasu!

yes, i noticed the change form "pequal" to "equal" should be fine on either OS.

this is definitely a unique case.

will keep you posted on any progress.
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Wed, 27 January 2021, 12:12:28
It outputs this when I press Num Equal.

Waiting for device:
Listening:
51FF D1FF


Layerwise, I want to achive the following: I need at least 4 layers, since I want to use my M3501 and M0118.
Layer 0->1, and 2->3 I need as momentary
Layer 1->2 5 tap.

What I can see, is that I'm stuck at the highest (in this case Layer 3), and can't get back to Layer 0.
I only want to sacrafise the Power On key for this porpuse, to toggle between the layers.

Building my own firmware is out of my capabilities sincs I know nothing about programming that'd be requried to start understanding how to do so.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 27 January 2021, 13:01:04
there was something else i forgot which hasu reminded me...
Quote
In default ADB covnerter firmware Power key is used for special function 'Magic keys', you will have to build firmware to change the configuration if this prevents you.

let me mess with it some, then i'll get any changes you are using in your layout and build a hex from source if need be. should also be able to get your "=" outputting the correct code for your language. probably tomorrow at the earliest, very busy.
Title: Re: ADB to USB keyboard converter
Post by: dx7 on Wed, 27 January 2021, 18:05:00
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.
Title: Re: ADB to USB keyboard converter
Post by: godzillq25 on Wed, 27 January 2021, 19:19:20
maybe i am dumb or something, but i cant find anywhere as to which software to use to flash the unimap.hex on to a promicro. would love top know before i buy a tennsy. im cheap i had these pro micros laying around
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 27 January 2021, 19:42:38
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.

yes, that's one of the main differences between apple keyboards and PC keyboards. the win (gui) and alt keys are swapped.
where control is the main modifier key on PCs, command (gui) is the main modifier on apple/macs.

maybe i am dumb or something, but i cant find anywhere as to which software to use to flash the unimap.hex on to a promicro. would love top know before i buy a tennsy. im cheap i had these pro micros laying around

what OS are you using?
promicros are catalina so you can use QMK toolbox (https://github.com/qmk/qmk_toolbox) (Mac, Win),  Atmel FLIP (https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/FLIP) (Win, Linux) or avrdude (http://savannah.nongnu.org/projects/avrdude) (command line, most platforms i believe) to flash the hex
teensy uses it's own flash utility




Title: Re: ADB to USB keyboard converter
Post by: godzillq25 on Wed, 27 January 2021, 20:31:03
thank you, didn't know you could with qmk toolbox
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 27 January 2021, 21:17:54
It outputs this when I press Num Equal.

Waiting for device:
Listening:
51FF D1FF

Show other part before 'Keyboard start.' as well. It may give useful insight on debug this.
You have to download the latest firmware from Keymap Editor without any keymap edit when testing this.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

That seems to work as expected, and you should get '=' as long as you use US layout on Windows.

Use US keyobard layout on Windows.
Don't foget to disable or unistall keyboard related software like AHK on Windows.
And you will have to clean registry if you used SharpKeys to remap before.

You still get '5'? Check whether it is normal '5' or keypad '5' with tool like 'Switch Hitter'. Let us know BIOS Code of the '5'.
https://web.archive.org/web/20190413233743/www.elitekeyboards.com/switchhitter.php



As for this keymap topic let's discuss after the problem above is solved.
Quote
Layerwise, I want to achive the following: I need at least 4 layers, since I want to use my M3501 and M0118.
Layer 0->1, and 2->3 I need as momentary
Layer 1->2 5 tap.

What I can see, is that I'm stuck at the highest (in this case Layer 3), and can't get back to Layer 0.
I only want to sacrafise the Power On key for this porpuse, to toggle between the layers.

Building my own firmware is out of my capabilities sincs I know nothing about programming that'd be requried to start understanding how to do so.

Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 27 January 2021, 22:09:48
thank you, didn't know you could with qmk toolbox

you're just using QMK toolbox as a way to flash the promicro. it's a little easier than command line especially if you're using the configurator to get the hex file.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 27 January 2021, 22:18:09
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.

You mean you have the problem after updating the latest firmware and didn't have it before, right?
This problem was introduced accidentally this month at commit 0518db68957e6. It will be fixed soon later.

Default firmware intends to send LGUI with Command(Apple) key and LALT with Opt(Alt) key as you expected.

Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Thu, 28 January 2021, 16:11:14
It outputs this when I press Num Equal.

Waiting for device:
Listening:
51FF D1FF

Show other part before 'Keyboard start.' as well. It may give useful insight on debug this.
You have to download the latest firmware from Keymap Editor without any keymap edit when testing this.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

That seems to work as expected, and you should get '=' as long as you use US layout on Windows.

Use US keyobard layout on Windows.
Don't foget to disable or unistall keyboard related software like AHK on Windows.
And you will have to clean registry if you used SharpKeys to remap before.

You still get '5'? Check whether it is normal '5' or keypad '5' with tool like 'Switch Hitter'. Let us know BIOS Code of the '5'.
https://web.archive.org/web/20190413233743/www.elitekeyboards.com/switchhitter.php



As for this keymap topic let's discuss after the problem above is solved.
Quote
Layerwise, I want to achive the following: I need at least 4 layers, since I want to use my M3501 and M0118.
Layer 0->1, and 2->3 I need as momentary
Layer 1->2 5 tap.

What I can see, is that I'm stuck at the highest (in this case Layer 3), and can't get back to Layer 0.
I only want to sacrafise the Power On key for this porpuse, to toggle between the layers.

Building my own firmware is out of my capabilities sincs I know nothing about programming that'd be requried to start understanding how to do so.

Now it outputs an "σ" which is literally the equals key in US ANSI xD
If I set it to ANSI, it works flawlessly tho... (which I think is the majority of the user base)
Sorry, the software I found literally only outputs that text that I copied for you. However, here's Switchhitter's output.
New firmware:
48:06.0425 = (0xBB, BIOS 0x0D) DOWN
48:06.0496 = (0xBB, BIOS 0x0D) UP -> 72ms


Original firmware:
50:16.0252  (0x0C, BIOS 0x59) DOWN
50:16.0345  (0x0C, BIOS 0x59) UP -> 104ms

I just got this idea:
Alt+6 1 (you press Alt, and type 61 on numpad). Can I you make it a macro to output "Alt"+"6->1" ? It'd spit out an equals key in every single layout possible, since it's the ASCII Alt code. Tested it on both USA ANSI and HUN layouts. My only question is - would it break compatibilty on Linux/Mac OS?

Can you implement a macro editor into the editor sometimes in the future? Where you literally press buttons (or tell the literal scancodes one by one, key combinations, etc.), or raw ADB data, and you can set it to spit out specific key combinations, etc. I think that could rival even the best macro keyboards out there, it'd make an useful feature to the editor/converter (I think this would be literally the killer app), and it'd solve my issue as well.
It's not like I really need that equals key. My view on this topic was this: if it's there, might as well make use of it. My priority would be to get the layer switching to work to be honest.

And I'd take this opportunity to express my gratitude to this community. I'm blown away by the support that I get from you guys and this is just simply very amazing. You are heros! I did not expect any of you to go above and beyond to help me out like this. I was like... I'll simply report theese bugs to help this project out. And wow... You guys are just so helpful and so nice... I'm unbeliveably thankful.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Thu, 28 January 2021, 16:32:48
 :thumb:
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 28 January 2021, 17:56:41
Now it outputs an "σ" which is literally the equals key in US ANSI xD
If I set it to ANSI, it works flawlessly tho... (which I think is the majority of the user base)
Sorry, the software I found literally only outputs that text that I copied for you. However, here's Switchhitter's output.
New firmware:
48:06.0425 = (0xBB, BIOS 0x0D) DOWN
48:06.0496 = (0xBB, BIOS 0x0D) UP -> 72ms


Original firmware:
50:16.0252  (0x0C, BIOS 0x59) DOWN
50:16.0345  (0x0C, BIOS 0x59) UP -> 104ms

Those are exactly what is expected and confirmed that the converter works as expected.
New firmeware sends USB code of '=' and Original one sends code of 'keypad  ='.

I'm still curious and don't understand why you get '5' with Original firmware('keypad =') when you are on Hungarian layout.
I guess it may be caused by glitch of Windows Hungarian layout or other key configuration. Let me know if you find something.



Quote
I just got this idea:
Alt+6 1 (you press Alt, and type 61 on numpad). Can I you make it a macro to output "Alt"+"6->1" ? It'd spit out an equals key in every single layout possible, since it's the ASCII Alt code. Tested it on both USA ANSI and HUN layouts. My only question is - would it break compatibilty on Linux/Mac OS?

You can define a macro like that with writing user keymap code but not with Keymap Editor. Alt-Code works only on Windows.

Quote
Can you implement a macro editor into the editor sometimes in the future? Where you literally press buttons (or tell the literal scancodes one by one, key combinations, etc.), or raw ADB data, and you can set it to spit out specific key combinations, etc. I think that could rival even the best macro keyboards out there, it'd make an useful feature to the editor/converter (I think this would be literally the killer app), and it'd solve my issue as well.
I have had a plan for years but it has not that high priority in my list.

Quote
It's not like I really need that equals key. My view on this topic was this: if it's there, might as well make use of it. My priority would be to get the layer switching to work to be honest.

OK. Lets start discussing that layer switching.
I'd like to check if layer switch problem on your keymap is specific to 'power key'.
Share your keymap URL using 'URL Shortener' button on Keymap editor or you can just attach hex file here.



Title: Re: ADB to USB keyboard converter
Post by: dx7 on Thu, 28 January 2021, 22:11:01
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.

You mean you have the problem after updating the latest firmware and didn't have it before, right?
This problem was introduced accidentally this month at commit 0518db68957e6. It will be fixed soon later.

Default firmware intends to send LGUI with Command(Apple) key and LALT with Opt(Alt) key as you expected.

That's great! Thanks hasu!
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Fri, 29 January 2021, 05:30:55
OK. Lets start discussing that layer switching.
I'd like to check if layer switch problem on your keymap is specific to 'power key'.
Share your keymap URL using 'URL Shortener' button on Keymap editor or you can just attach hex file here.
I filmed my issue:
[attachurl=1]
Title: Re: ADB to USB keyboard converter
Post by: nevin on Fri, 29 January 2021, 07:20:16
ok. been messing with it for a little.

this is how he is trying to use "layer toggle"
- on layer0 (we'll pick "Home") and make it "T1"
- on layer1 we'll change "Home" to "T2"
- on layer2 we'll change "Home" to "T3"
- etc...

using "layer toggle" will ascend the layers: layer0 > layer1 > layer2, etc...
     or skip to a higher layer: layer2 > layer5

but does not want to descend layers: layer3 > layer2
    or skip to a lower layer: layer5 > layer1
in this configuration.

because it is not meant to be used this way.

"layer toggle" is meant to ACTIVATE a layer, then tapping the same key again to DEACTIVATE the layer and go back to the layer you were on previously.
how it's meant to function:
- on layer0 (we'll pick "Home" again) and make it T3
- we tap on "Home" to TOGGLE ON layer3, then we can use the keymap for layer3
- we tap on "Home" again to TOGGLE OFF layer3 and are now back to layer0

i really think the dual role "action_layer_tap_key" is your best option to momentarily (while holding key) access a layer without having a bunch of dedicated layer toggles.
the way "action_layer_tap_key" functions is:
- on layer0 (we'll pick "Home" again) and make it "action_layer_tap_key", "Home", "layer1"
- when you TAP "Home" you get "Home"
- when you HOLD "Home" you get access to layer1
see below:
[attach=1]

TMK layer switching descriptions
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#3-layer-switching-example
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 29 January 2021, 08:10:27
casualdehid,
This issue is not specific to ADB converter, so let's move to this general TMK firmware thread.
https://geekhack.org/index.php?topic=41989.msg3007564#msg3007564
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Wed, 03 February 2021, 12:43:40
Hi there
A small hardware question:
Can I hotplug ADB devices while the Teensy is plugged into USB? Will it damage anything?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 03 February 2021, 12:50:13
no, shouldn't damage anything. i just tried it. and it picked up the mouse. (teensy version) and AEKII and A9M0331 mouse on a mac

if it doesn't automatically pick it up. unplug/replug the converter's usb connection to the computer.
Title: Re: ADB to USB keyboard converter
Post by: ideable on Wed, 03 February 2021, 15:08:21
Hi here!
Thank you so much for the work on ADB = to => USB, makes me exited that I can start using an old Apple Keyboard 2.

I do own a Teensy 4.0 but I couldn't find guides for flashing for the ADB -> USB converter. I try to compile the code with arm-none-eabi-gcc but I didn't get that far to resolve all the compilation errors and the libraries missing.

I just notice that the website unimap editor just allows you to download an .hex which I promptly flashed into the Teensy, but I didn't get my keyboard to work.
Now I wonder, would it work? in which pin should I've plug in?

(I know should be PD0 but that seems for Teensy 2, and I plug my data cable on the pin 0, but might not correspond)

Anticipated thanks.
Title: Re: ADB to USB keyboard converter
Post by: casualdehid on Wed, 03 February 2021, 15:47:20
no, shouldn't damage anything. i just tried it. and it picked up the mouse. (teensy version) and AEKII and A9M0331 mouse on a mac

if it doesn't automatically pick it up. unplug/replug the converter's usb connection to the computer.

Yeah..  but it does not like being hotswapped: It swaps ISO 102nd key with Grave when hotplugged.
Also I'm jellaous of your M0331  :thumb:
always loved how that board looks like.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 03 February 2021, 18:00:17
Hi here!
Thank you so much for the work on ADB = to => USB, makes me exited that I can start using an old Apple Keyboard 2.

I do own a Teensy 4.0 but I couldn't find guides for flashing for the ADB -> USB converter. I try to compile the code with arm-none-eabi-gcc but I didn't get that far to resolve all the compilation errors and the libraries missing.

I just notice that the website unimap editor just allows you to download an .hex which I promptly flashed into the Teensy, but I didn't get my keyboard to work.
Now I wonder, would it work? in which pin should I've plug in?

(I know should be PD0 but that seems for Teensy 2, and I plug my data cable on the pin 0, but might not correspond)

Anticipated thanks.
Teensy 4 uses a different processor than either of the adb to usb (v1 or v2) protocol converters.

No, it won't work, the teensy 4 is not supported.

The rev1 firmware is for atmega 32u4
The rev2 firmware is for atmega 32u2

Take a look at the 1st post for more info
Title: Re: ADB to USB keyboard converter
Post by: nevin on Wed, 03 February 2021, 18:04:59
no, shouldn't damage anything. i just tried it. and it picked up the mouse. (teensy version) and AEKII and A9M0331 mouse on a mac

if it doesn't automatically pick it up. unplug/replug the converter's usb connection to the computer.

Yeah..  but it does not like being hotswapped: It swaps ISO 102nd key with Grave when hotplugged.
Also I'm jellaous of your M0331  :thumb:
always loved how that board looks like.

i was just plugging in a mouse to an aekII that was already plugged in

if you were trying to swap keyboards without unplugging the converter, that's something totally different. different boards may have different key assignments, which you would have to adjust for in the keymap for that particular keyboard.

it's more typical to have one converter per keyboard or flash a different keymap to match the keyboard you want to switch to before using it.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 03 February 2021, 21:01:57
Hotswap for Extended or ISO keyboard is not supported at this time. You have to connect them with converter first, then plug into USB.

Meanwhile, hotswap is supported for mouses.


Quote
AEK left/right modifiers discrimination, ISO layout and Adjustable keyboard media keys
To use these features you have to connect keyboard to the converter first before plug-in USB port.
Keyboard initilization needed for the features occurs only when the converter powers up with current firmware.
from the first post.
Title: Re: ADB to USB keyboard converter
Post by: ephemeral25 on Sun, 14 February 2021, 11:05:56
Hey there,

Thks for sharing everything with the community, it's F nice of you  :thumb:

I can't seem to make my converter works. It automatically disconnects when plugged into the AEKII M0118 ISO.

J1 is jumped and 1K resistor is soldered between PD0 and VCC. I've check everything with a multimeter, it's is 5V and all wiring is correct ( Ground, Data and VCC).

Any idea what could be the problem? In the makefile I only changed MCU to atmega32u4 then compiled and got the stock hex.
http://imgur.com/a/QOFdcv4 (http://imgur.com/a/QOFdcv4)
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 14 February 2021, 15:09:02
Here's some troubleshooting questions:
- what shape are the adb cables in? (Could be a bad/broken cable) you can use s-video cables as well, same connector & no funny crossovers
- does the converter work with another keyboard, but not with the m0118?
- did you try both adb ports on the keyboard? (Maybe one is not working)
- what does the inside of the m0118 look like?
-Can you see any wires that came loose or broken electrical components
Title: Re: ADB to USB keyboard converter
Post by: ephemeral25 on Sun, 14 February 2021, 15:36:31
Here's some troubleshooting questions:
- what shape are the adb cables in? (Could be a bad/broken cable) you can use s-video cables as well, same connector & no funny crossovers
- does the converter work with another keyboard, but not with the m0118?
- did you try both adb ports on the keyboard? (Maybe one is not working)
- what does the inside of the m0118 look like?
-Can you see any wires that came loose or broken electrical components

I am using a custom made cable from ADB to the micro controller which I fully tested with a multimeter.
I do not have any other boards to try it out.
I tried both of the ADB port and both are reacting the exact same way.
The insides of the board were dirty, the board have quite a bit of use into it and I did not notice any broken components.

What I can do is make a full album of pictures of the board so you guys can get an idea. Even if my board was broken, it seems really odd that the converter is turning off.
When I plug the converter only in usb (disconnected from the board) and I open the HID console, it's logs stuff that would make you think it works normally.

Listening:


TMK:a93677cb+/LUFA


Scan:

Keyboard:
handler: 00, ISO: no

Scan:

USB configured.

Keyboard start.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 14 February 2021, 17:05:46
plug the keyboard into the converter and then plug the converter into the computer.

the only other thing i can think of is you may have the lines mixed up and are creating a short or something when you plug in the keyboard.
see the wiring diagram (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb), the pinout that is shown is for the female adb socket, not the male cable connector
Title: Re: ADB to USB keyboard converter
Post by: ephemeral25 on Sun, 14 February 2021, 18:16:04
plug the keyboard into the converter and then plug the converter into the computer.

the only other thing i can think of is you may have the lines mixed up and are creating a short or something when you plug in the keyboard.
see the wiring diagram (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb), the pinout that is shown is for the female adb socket, not the male cable connector

I think you found the problem, I am going to redo the wiring tomorrow and see if it changes anything. I considered the schιma as male connector...
Thks a lot for helping people and retard like me  :confused:
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sun, 14 February 2021, 19:02:01
no problem, and you're not a retard.

hopefully that's all it was and you'll be good.
reply back with results when you get a chance.
Title: Re: ADB to USB keyboard converter
Post by: ephemeral25 on Mon, 15 February 2021, 12:08:20
no problem, and you're not a retard.

hopefully that's all it was and you'll be good.
reply back with results when you get a chance.


It's perfectly working, quite happy with the result, looks even dodgier than before but imma try to make a 3d printed enclosure and mod the board now that I know that it's working.

Thks a lot for your help
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 15 February 2021, 12:16:03
glad you got it working.
no problem. some incorporate into the case (if it's to be permanent) and put a female usb port at the one adb port location

this is a different model, but you can see what was done.
[attach=1]
Title: Re: ADB to USB keyboard converter
Post by: ephemeral25 on Mon, 15 February 2021, 13:29:37
Yeah I've seen multiple projects for that. I think for now I'd prefer having the converter on the outside, not modifying anything but switches.

I also need to make a converter for my old Digitran Fortune 32:16 keyboard... Lots of fun ahead  :thumb:
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 15 February 2021, 15:23:12
i'd open up & check the foam/foil on the Digitran before you get too far into the converter. might need to replace a bunch of the foam. there are sources to get replacements. look for Key Tronic replacement foam & foil.
Title: Re: ADB to USB keyboard converter
Post by: Noodloodle on Sun, 21 February 2021, 20:14:12
Howdy from Texas,

I'm just now getting into really messing with my first mechanical keyboard that hasn't been prebuilt (tough start I know) and was wondering if there was any way to use the Tmk_keyboard files to do an ADB to USB conversion and having it work on Windows 10. I'm not too technologically advanced but I can maneuver around things pretty quick. I'm getting stuck right now on how to flash the Teensy 2.0 to flash the ADB_USB file to the microcontroller. Everything that I've found has referenced using the 'make' command but of course, it doesn't exist plain and simple on windows. I just wanted to know how to bypass this and get this bad boy working.

Thanks, Noodle
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 22 February 2021, 07:18:30
the make command is if your are building the firmware from source. and you can do it in windows, just make sure you have all the software installed for the build environment.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md

if you're using a teensy, they have their own dedicated flashing utility
https://www.pjrc.com/teensy/loader.html

and hasu has a online configurator so you don't have to build from source (unless you want to)
under the adb to usb converter, you want this variant for teensy 2.0
TMK Converter rev.1(ATmega32U4): [ Full-key ]
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

make sure you add a pull-up resistor
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb

and pay attention to the connector pinout. what he has noted on the page is the female adb socket (the connector in the keyboard), not the male cable
Title: Re: ADB to USB keyboard converter
Post by: Noodloodle on Mon, 22 February 2021, 08:46:42
the make command is if your are building the firmware from source. and you can do it in windows, just make sure you have all the software installed for the build environment.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md

if you're using a teensy, they have their own dedicated flashing utility
https://www.pjrc.com/teensy/loader.html

and hasu has a online configurator so you don't have to build from source (unless you want to)
under the adb to usb converter, you want this variant for teensy 2.0
TMK Converter rev.1(ATmega32U4): [ Full-key ]

While typing that I couldn't find it I found it. Thank you for the help, Ill reply here if anything else comes up as an issue.
Title: Re: ADB to USB keyboard converter
Post by: Noodloodle on Mon, 22 February 2021, 21:10:18
New errors I have no ideas how to deal with. I downloaded the latest version of Cygwin and am trying to build the firmware from the Tmk_master file. Was I supposed to unzip the file or leave it zipped? I'm trying to follow the guide that you sent earlier to use with a Teensy 2.0, but when I am trying to build the firmware, the line where it asks for me to
Code: [Select]
make -f Makefile.<variant> clean it keeps erroring saying:

Code: [Select]
../../tmk_core/protocol/Lufa.mk:12: *** LUFA may be too old or not found: try 'git submodule update --init'. Stop. [attach=1]

when trying this command it fails to find a repository and update the Lufa. What do I do from here? am I stuck because I have too new of a system or is there a way to get around this? Is there any way to bypass this by just getting a pre-created hex file for the ADB_USB variant that I can just flash?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 22 February 2021, 21:16:11
Use the online configurator (link in previous post). At the bottom of the configurator page you can download a hex file to flash to the teensy.
Title: Re: ADB to USB keyboard converter
Post by: Noodloodle on Mon, 22 February 2021, 22:12:33
Thank you for all the help Nevin, sorry for not seeing it the first time.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 23 February 2021, 07:30:31
No worries. It's always a bit confusing until you learn the terminology & tools when your first getting started.
Title: Re: ADB to USB keyboard converter
Post by: Potatomonkey on Mon, 01 March 2021, 21:21:36
Hey guys, I just made a converter for my AEK II and when I plug it in, the leds on the keyboard flash once, then all turn on solid. The converter is being recognized in hid_listen, but I'm not getting any scancodes or error messages. I have 6ish-k resistor between the gnd and data lines. Any ideas as to what is happening?
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 02 March 2021, 08:51:28
not really sure, need a little more info.

what controller are you using?
which firmware did you use?
- with the adb converter there are two variants one for 32u4 (rev 1) for teensy & promicros & similar
and 32u2 (rev 2) for the one hasu sells

sounds like it didn't flash right or is not the right firmware for your controller?
Title: Re: ADB to USB keyboard converter
Post by: Potatomonkey on Tue, 02 March 2021, 18:49:32
Sorry for not clarifying, I was using the QMK variant on a promicro (32u4), however I also tried hasu's rev1 for TMK and I'm getting the same result. The keyboard still shows up correctly in hid_listen on the TMK version.

Code: [Select]
    TMK:a36eff92/LUFA
   
   
    Scan:
   
    Keyboard:
    handler: 00, ISO: no
   
    Scan:
   
    USB configured.
   
    Keyboard start.

Is the output I get from the hid_listen on the QMK toolbox, which is what i use to flash.
Title: Re: ADB to USB keyboard converter
Post by: Potatomonkey on Tue, 02 March 2021, 19:39:50
ok this is kinda awkward, but after pouring over my wiring for the 15th time i noticed that the GND trace on my adb breakout was broken right by the pad, kind of embarrassing but jumping that trace fixed my issue.
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 02 March 2021, 20:54:41
glad you figured out what it was. congrats
Title: Re: ADB to USB keyboard converter
Post by: DwieDave on Mon, 29 March 2021, 13:16:33
Hello;

Today I tried to built my own ADB Converter using a (non-official) ProMicro.
First I had issues flashing the ProMicro with the Rev.1 Firmware provided on the Keymapping website
(http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1)
but in the end it worked out and it shows as  "ADB keyboard converter" in my system settings.

Sadly the keyboard (Apple Extended Keyboard II) is not working.
There are no lights on capslock or numpad.
Sometimes after connecting the usb cable to the ProMicro the LED
dies after some seconds and the adapter is not visible in system info anymore.


I rechecked the wiring multiple times.
Is my Apple Keyboard or my ProMicro broken?

I connected 5V to VCC; GND to GND and DATA to Pin3 on the ProMicro (labeled only with 3)
And I bridged J1 with solder.

I would be really thankful for every bit of help!
Thank you

Kind regards
Dave
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 29 March 2021, 13:27:49
you are correct in using the rev1 firmware. 32u4

make sure you use a pull-up resistor. also check the pinout of the connector. the diagram of the connector is keyboard side (female)
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb
Title: Re: ADB to USB keyboard converter
Post by: DwieDave on Mon, 29 March 2021, 13:43:45
@nevin:
Thank you so much!
It's really embarrassing but I thought the
wiring diagram was for the plug and not the socket.

Just typed this reply on the AEKii  :D

Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 29 March 2021, 13:44:46
it happens more than you think, that's why i mentioned it.
congrats!
Title: Re: ADB to USB keyboard converter
Post by: Fritz the German on Sat, 03 April 2021, 13:43:07
I'm a little bit tempted to get an Apple Adjustable Keyboard M1242 and the corresponding separate Numeric Keypad.
But I believe that the converter doesn't support two daisy-chained ADB keyboards, correct?
Title: Re: ADB to USB keyboard converter
Post by: hasu on Sat, 03 April 2021, 21:22:27
It should support actutally :D
Try it and report if you have problem.
Title: Re: ADB to USB keyboard converter
Post by: godzillq25 on Sun, 04 April 2021, 04:14:14
the converter works fine and thank you sooo much for that, but i can't seem to generate a custom hex from tmk keymap editor and im only able use the standard layout.
i am i following the steps right?

edit layout
press the download button under 'Firmware Hex File Download:'
and then flash hex using qmk toolbox
i have repeated this 3-4 times

im using it for a m0116
Title: Re: ADB to USB keyboard converter
Post by: nevin on Mon, 05 April 2021, 08:30:08
looks like the file downloads fine. are you having trouble flashing it?
- is it one you bought form hasu or one you built?
- if built, what microcontroller did you use teensy 2.0 or promicro (or similar)
    ... i'm asking because they use different bootloaders for flashing.
Title: Re: ADB to USB keyboard converter
Post by: godzillq25 on Tue, 06 April 2021, 05:30:16
i built it my self using a promicro, the board works fine as a stock layout, i just cant assign a layer changer to ad volume controls on second layer
Title: Re: ADB to USB keyboard converter
Post by: nevin on Tue, 06 April 2021, 09:06:41
i built it my self using a promicro, the board works fine as a stock layout, i just cant assign a layer changer to ad volume controls on second layer

1. double check witch version of the firmware you are using. it should be the rev.1 version for 32u4 processors
TMK Converter rev.1(ATmega32U4): [ Full-key ]
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

2. delete or move any other .hex files out of the folder your browser downloads to (just in case you're grabbing the wrong one)

3. promicros can be tricky to flash, even with resetting twice in a row you only get 8 seconds to catch the bootloader
so, - edit & download the firmware
- open QMK toolbox and get it ready, select the correct firmware
- reset it twice quickly
- as soon as you see the port open up in the window, click flash.
[attach=1]
- wait for the confirmation message that flashing was successful
[attach=2]

4. if you're still having trouble, try clearing the EEPROM.
- reset twice quickly
- soon as the port is found click "Clear EEPROM"
(not sure if the ADB converter stores the keymap in EEPROM but other firmwares do, i've run into this myself with flashing new firmware while there was a previous keymap sitting in the EEPROM from VIA, so my revised keymap in the firmware was being overridden by the keymap in the EEPROM from VIA. this was a QMK keyboard not a converter though)
Title: Re: ADB to USB keyboard converter
Post by: hbloub on Wed, 28 April 2021, 07:51:04
Hey, first I'd like to thank you for making this converter that's really awesome  :thumb:. I managed to revive an AEKII which is working perfectly with a cheap pro micro.
I also have a question, although it may not really be about the converter itself. I have another AEKII that I wanted to convert, and since I had trouble making it work, I used my functioning converter with it and found out it didn't help. When I'm plugging it, the three LEDs on the keyboard turn on and nothing else happens. Do you have any idea about what I could do to check what could be wrong with the keyboard itself ?
Title: Re: ADB to USB keyboard converter
Post by: cmdrriker on Thu, 06 May 2021, 00:39:02
I'm having a bear of a time trying to get my Teensy 2.0 to work with my old Apple Extended Keyboard model M0115.

(https://i.imgur.com/IsCbd0P.jpg)

I added pins to my Teensy so I could try various wire combinations without having to desolder if I got things wrong (preparing for something to be incorrect :().

Image of the top of the board with my 1k Ohm resistor across PD0 and VCC

(https://i.imgur.com/BL0w9Yu.jpg)

Bottom of the board showing my jumper wires:

(https://i.imgur.com/EqtZDCG.jpg)


I fed my jumpers into either ADB ports on my keyboard shown here:

(https://i.imgur.com/EAfMVFT.jpg)

I was unable to build the firmware because it seems that there are issues with the compiler being 64bit only on Catalina. The Teensyduino/Arduino tools are not recognizing changes made on pointers etc, make barfs on the code.

No biggie I found the V1 firmware on https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/binary (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/binary). Using Teensy Loader for MacOS i was able to flash the board and it reports in under System Profiler as it should:

(https://i.imgur.com/A8iZAEo.jpg)

My Mac recognizes it as ADB Keyboard Converter.

However, I plug in my old ADB-E Keyboard in, and anticlimactically nothing seems to work. I went back to rearranging the wiring and it's just stone cold Steve Austin dead lol.

I used hid_listen.mac64 to profile the board and it sees the Teensy fine (also Teensyduino sees it too as well

Code: [Select]
❯ [size=14pt]./hid_listen.mac64
Waiting for device:.....
Listening:


TMK:a36eff92/LUFA


Scan:
RRRRRRRRRRRRR
Keyboard:
Rhandler: 00, ISO: no
R
Scan:
RRRRRRRRRRRRRRRR
USB configured.

Keyboard start.
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR^C
~/Development/tmk_keyboard/converter/adb_usb master* 8s[/size]

I see that Hasu says that the RRRR nonsense being returned means that something is wrong with my wiring but I've run out of ideas as to what I'm doing wrong. Is my Teensy dead? or am I missing something not evident?

Thanks in advance for any thoughtful tips/ideas!

Regards

-riker
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 06 May 2021, 02:20:34
The "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-L164

This happens when connecting keyboard with converter already powered(hotplug/hotswap) 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.

I'd check that resistor value and its soldered points. I'm not familiar with that type of color codes, it looks to me brown, black, black, unknown, brown. Is that really 1K?
what if the resistor is removed?

Title: Re: ADB to USB keyboard converter
Post by: cmdrriker on Fri, 07 May 2021, 21:50:29
The resistor is supposedly a 1K ohm... but I picked up a new Teensy2.0 and just soldered pins to VCC, PD0, & ground. Then because I misplaced the 1kΩ parts I had and used a 10kΩ part instead and it worked!

I don't know if I burned the other board, perhaps got stray solder somewhere on it, or if it was defective? Oh well!

I can't believe that after sitting in the closet after all these years that my old EK works! You know it took an entire summer of work to save up my after-school job monies to be able to afford a Mac IIcx, 13" AppleColor Monitor, & this here keyboard. My old mouse crapped out years ago lol.

What a great project Hasu! I thank you!

In health,

-Riker
Title: Re: ADB to USB keyboard converter
Post by: hasu on Fri, 07 May 2021, 22:37:35
Glad to hear it works with the keyboard from your school days!

In many cases this converter works without pull-up resistor, you can try removing the resistor and cleaning up solder around PD0 pin on the first Teensy.
If you still get too many "R" errors after those remedies the PD0 pin might been burned and latch-up'd.
Title: Re: ADB to USB keyboard converter
Post by: cmdrriker on Fri, 07 May 2021, 23:31:23
Good idea about the other board. I have to get a better desolder tool, the one I have is a piece o' cr*p and then I'll try removing the mess I made. A colleague of mine gave me one of those ergonomic apple keyboards that I also have on a shelf somewhere at work so if I get that board resuscitated I'll use it with that one.

I just used the online keyboard layout tool and edited the layout to flip the squiggle key(apple) to the right and move alt leftward, reflashed the teensy and things are working great!

Another satisfied customer  :D

In health & gratitude,

-riker
Title: Re: ADB to USB keyboard converter
Post by: nevin on Sat, 08 May 2021, 06:41:59
Quote
A colleague of mine gave me one of those ergonomic apple keyboards that I also have on a shelf somewhere at work so if I get that board resuscitated I'll use it with that one.

ahh... the apple adjustable keyboard. nice. i have one of those too, i don't have the "wings" (wrist rests) though. warning though... the switches (Alps SKFS) feel a bit different than apple's other boards. they're a low profile version of full size alps.

here's some more info on the board:
https://deskthority.net/wiki/Apple_Adjustable_Keyboard
and
http://sandy55.fc2web.com/keyboard/apple_adjustable_e.html

switch info: https://deskthority.net/wiki/Alps_SKFR/SKFS_series

if memory serves, the buttons in the outer bezel won't work with the converter (wired different (not part of the matrix) and non-standard codes), maybe the esc does... i can't remember, iit's been a couple years since i played with that one. even if a couple do work, they are not pleasant to use as they are just tiny tact switches. and with most apple boards you can't differentiate the left & right apple key as they are wired as the same key. (not sure anymore if the same applies to any of the other modifier keys). i remember using the period as a dual role Fn key (period when tapped, Fn when held)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 03 June 2021, 04:25:01
[FIRMWARE UPDATE]
Updated prebuild firmware in github repo and Keymap Editor.

With new firmware:
- Power key works on Windows as well https://github.com/tmk/tmk_keyboard/commit/a93677cbf145baf210f92a9129ded55c9ef5657b
- Fix swap issue on LAlt and LGUI(Cmd or WIn) https://github.com/tmk/tmk_keyboard/commit/ea4baf1cb6ed34a88c0d478f71d9f17ae069c3c6


Also I updated the first post about pull-up registor, 1K Ohm is recommended now.
4.7K and 10K Ohm didn't work on daisy-chain with multiple devices. See github issue, this is interesting find, methinks. https://github.com/tmk/tmk_keyboard/issues/683#issuecomment-850190574
Title: Re: ADB to USB keyboard converter
Post by: djvs on Mon, 16 August 2021, 20:31:40
Having issues with my own converter.  Connections all secured, firmware flashed & input device registering to lsusb as you'd hope, 1k resistor added, J1 soldered, but getting no response from keyboard ("RRRRRR...") via sudo hid_listen.  Pictures attached...

My fear is I got the connections mirrored?  But I did try it the other way around as well.  I also tried a second pro micro, albeit that one I didn't try with a resistor yet (I had to wait for some in the mail).
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 16 August 2021, 20:52:15
Wiring looks good to me.
But I still think wiring is a problem.

Are you  sure the resistor is 1k? If not you can test without it.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Mon, 16 August 2021, 20:56:05
Also rework soldering may help. It doesn't look so good at some joints.

Title: Re: ADB to USB keyboard converter
Post by: djvs on Mon, 16 August 2021, 21:10:19
Yeah resistor is labelled 1k, brand new and multimeter measures it at 990ohm.  Continuity on all connections and no shorts.  This is AliExpress pro micro by the way, if it makes any difference, but J1 is soldered and crystal reads 16mhz, and I used rev1 (atmega32u4).
Title: Re: ADB to USB keyboard converter
Post by: djvs on Mon, 16 August 2021, 21:37:08
Mapping of sockets to main PCB (assuming this is correct - if anyone else is trying to wire directly to board) -

Code: [Select]
Left side AEK2 socket (near Esc key) - facing from the bottom side:

      2   4       8
      G   V       D
    o o o o o o o o o
    1 2 3 4 5 6 7 8 9

    o o
    o o
    o
Title: Re: ADB to USB keyboard converter
Post by: cmdrriker on Tue, 17 August 2021, 12:03:43
Having issues with my own converter.  Connections all secured, firmware flashed & input device registering to lsusb as you'd hope, 1k resistor added, J1 soldered, but getting no response from the keyboard ("RRRRRR...") via sudo hid_listen.  Pictures attached...

My fear is I got the connections mirrored?  But I did try it the other way around as well.  I also tried a second pro micro, albeit that one I didn't try with a resistor yet (I had to wait for some in the mail).

Do you have header pins? Some breadboard pin connectors?

I'd suggest using them as if you don't have a steady hand or good soldering skills. Then use IMHO, it's easy to get your wires "crossed" or worse burnout a through-hole or the board. I accidentally torched a through-hole on my 1st attempt.
Title: Re: ADB to USB keyboard converter
Post by: djvs on Sun, 22 August 2021, 11:15:35
I got it on a later try with a different Pro Micro - not sure what the issue was, maybe a burnt out pad or the ADB connector, but everything working now.

Tip for people doing M3501 internal adapter - don't use a Pro Micro, use a Teensy, or something else small.  It's a really tight fit in the M3501 case.  You can fit it vertically between the foot and the plate, but it might jam against the foot.
Title: Re: ADB to USB keyboard converter
Post by: jeb on Wed, 29 September 2021, 14:19:42
I got a MicroSpeed MacTRAC 2.0 trackball, and I was able to make this adapter using a Pro Micro to convert it, which is wonderful. The resistor was required before the adapter would do anything (the trackball's PCB actually had an empty, labeled spot for the resistor, which was nice). It is a three button mouse, and the buttons behave strangely, which I'm wondering if it's possible to fix. Here is some output from hid_listen.

On plugging in:
Code: [Select]
Listening:

TMK:86482d/LUFA:d6a7df

Scan:
 addr:3, reg3:672F

Keyboard:
handler: 00, ISO: no

Scan:
 addr:3, reg3:652F

USB configured.

Loop start.
M:addr3 reg3: 6F2F

Here is a left click (press and release), which looks normal:
Code: [Select]
M:[00 80 00 00 00]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[80 80 00 00 00]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

Middle click, press:
Code: [Select]
M:[80 00 00 00 00]
M:[B:02 X:0(0) Y:0(0) V:0 A:1]

Middle click, release:
Code: [Select]
M:[00 80 00 00 00]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]

If middle click is pressed again, there is no result, but then on release:
Code: [Select]
M:[80 80 00 00 00]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

Right click, press:
Code: [Select]
M:[00 00 00 00 00]
M:[B:03 X:0(0) Y:0(0) V:0 A:1]

Right click, release:
Code: [Select]
M:[80 80 00 00 00]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

The middle click behavior is especially weird, but is probably somehow intended by the mouse. I might end up just inserting some hacky code into my specific adapter to try to make its behavior more sensible for me, but someone has any better idea that would be more generally useful, that would be great.

Edit:
There appears to be some MicroSpeed specific code in this Linux driver: https://elixir.bootlin.com/linux/v4.4/source/drivers/macintosh/adbhid.c (https://elixir.bootlin.com/linux/v4.4/source/drivers/macintosh/adbhid.c). I will try to understand the relevant segments of code when I have the opportunity.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 29 September 2021, 19:04:53
Great. Let us know how it goes!

NetBSD code repo was another useful resoruce when I added TurboMouse support.

https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#kensington-turbo-mouse

Edit:
There appears to be some MicroSpeed specific code in this Linux driver: https://elixir.bootlin.com/linux/v4.4/source/drivers/macintosh/adbhid.c (https://elixir.bootlin.com/linux/v4.4/source/drivers/macintosh/adbhid.c). I will try to understand the relevant segments of code when I have the opportunity.

Title: Re: ADB to USB keyboard converter
Post by: jeb on Mon, 18 October 2021, 22:17:29
I spent quite a while trying to figure this out. I was able to track down the original Mac drivers for these. I could not run them, as I don't have any Macs or anything with an ADB port and they wouldn't do anything in an emulator without a mouse attached (and I was unable to trick them), so I disassembled them. The important thing from viewing the archive of Microspeed's website, was a note that the newer driver required a mouse with a newer/updated firmware. In the newer driver, I was able to identify the code that was sending the string of bytes that's found in the Linux driver. My trackball didn't respond to these at all, and would never tell me anything for the contents of register 1 (which I don't know if that's normal).

Looking at the older driver, and reading the help text embedded in it, I determined that all of the features of it could be accomplished using the output, along with software logic. I also think that the output is weird, but structured in a clever way so that its button presses would all look like a button 1 click (or a click lock, for the middle button) if the computer were ignoring any additional buttons.

There is also a strange behavior I noticed, which now makes sense: if you hold down the middle button, then press the left or right buttons, the second nibble of the first or second bytes returned will be 1 and movement is no longer sent. The help text mentioned a "signaling" mode, where you hold the middle button, then press either the left or right button 1-4 times, in order to trigger a macro.

I have not decided how I want to implement the logic in the adapter. It may not be worth doing the more complex logic to track if the middle button is held. I think my ideal solution would be to rewire the switches directly to the adapter and ignore the nonsense from the mouse. This would likely be more difficult, as I don't think the adapter can currently look for any buttons on other pins. But if successful, it would be more generally useful.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 19 October 2021, 23:24:50
I spent quite a while trying to figure this out. I was able to track down the original Mac drivers for these. I could not run them, as I don't have any Macs or anything with an ADB port and they wouldn't do anything in an emulator without a mouse attached (and I was unable to trick them), so I disassembled them. The important thing from viewing the archive of Microspeed's website, was a note that the newer driver required a mouse with a newer/updated firmware. In the newer driver, I was able to identify the code that was sending the string of bytes that's found in the Linux driver. My trackball didn't respond to these at all, and would never tell me anything for the contents of register 1 (which I don't know if that's normal).

You think your trackball has old firmware, which is not supported by Microspeed new driver and Linux ADB driver.
So you will have to look into old driver version 1.2 to find 'magic' byte string for your old MacTrac? Did you see version 1.2 driver?

I found this note as you said and new/old drivers for MacTrac here. Unfortunately, it is almost no chance to upgrade your MacTrac to the new firmware anymore.
Quote
Note:  If you are using a Mac Trac 2.0 TrackBall with Control Panel software version 1.2, and you wish to download the latest software,
you will need to contact the Support Dept. for an Upgrade Kit.  You Cannot use Software version 3.4 with your current TrackBall configuration.  You WILL require a firmware upgrade.
https://web.archive.org/web/20020124235248/http://www.microspeed.com/pages/support/supdown.html
Title: Re: ADB to USB keyboard converter
Post by: jeb on Wed, 20 October 2021, 21:33:46
You think your trackball has old firmware, which is not supported by Microspeed new driver and Linux ADB driver.
So you will have to look into old driver version 1.2 to find 'magic' byte string for your old MacTrac? Did you see version 1.2 driver?

I think the old firmware uses a non-standard implementation, and there is no magic byte or any way to change its output. Its output was meant to work as a one-button mouse with a middle button "click lock" function, if there is no special driver installed. And then if the driver is installed, the driver uses the extra button values sent to handle the extra features. But all three buttons will send a value that contains a left-button click. (Left button -> button 1; Right button -> buttons 1 and 2; Middle button -> button 2 then button 1.)

It's possible the 1.2 driver has something interesting, but I couldn't find anything. At least, it is not calling the Mac system calls to do ADB listen or ADB read, so I think it is just adding a handler to intercept the calls for mice at its address. Unless it is old and listen/read were handled in a different way in earlier versions of the Macintosh OS.

I found this note as you said and new/old drivers for MacTrac here. Unfortunately, it is almost no chance to upgrade your MacTrac to the new firmware anymore.

Also, it's funny, that the circuit board for my MacTrac says "PS/2 Trac" on it. So, I think it could be possible to get a firmware from that model of trackball to work, too. But I think that firmware is also not available. The firmware must be on a microcontroller, because there is no other logic on the board.
Title: Re: ADB to USB keyboard converter
Post by: hasu on Thu, 21 October 2021, 00:58:31
I  see. Your explanation appears to be reasonable.
I guess Mac supports only button1 and just ignores button2 without specific driver. So Left and Right button would act as button1, and Middle button as a click-lock there, as you said.


I found this 1995 Dec. press release of firmware update and new driver software.
Early version of MacTrac2.0 before this update doesn't seem to support the Microspeed specific protocol unfortunately.
https://web.archive.org/web/19970329135742/http://www.microspeed.com/doc8.htm
Title: Re: ADB to USB keyboard converter
Post by: kettuz on Tue, 16 November 2021, 05:16:35
First of all, many thanks to Hasu and everyone who has contributed to this project! Great work!

Almost two years ago I purchased an Apple Extended Keyboard II from a seller, who had made this project and installed a Teensy 2.0 in that keyboard. At first I thought something was broken, as I wasn't able to get the AltGr work what ever I did. But having come back now to that keyboard I read the bugtracker and found out someone else had had the exact same issue and Hasu had fixed it  :thumb:

Now, having tried the keyboard a bit more after this long hiatus from it I'd like to ask if others have some of these small issues I have just discovered - that is, if what I'm facing is just how this keyboard, ADB and this converter are expected to work.

1) Latency. Testing AEKII against an AT keyboard with a proprietary USB converter I feel there is a small lag. It's very small, but somewhat easier to note when playing a game. Using the keyboard with my retro setup and playing a game, for example like Duke Nukem 3D, felt like I was moving underwater: playing needed more effort, something felt off.

2) When using file manager Volkov Commander, the clone of old Norton Commander, I was suddenly wondering: was it really so that moving from one line to another I couldn't keep the down arrow pushed and instead had to make a separate push and move one line at a time? When I switched AEKII to my USB-converted AT-keyboard, the expected behavior returned: I could keep the down arrow pushed and scroll down very smoothly and effortlessly.

I guess my use cases are a bit unusual compared to just writing, but I'd like to hear your comments :)
Title: Re: ADB to USB keyboard converter
Post by: hasu on Tue, 16 November 2021, 22:25:34
1) Primary source of the latency is polling interval 12ms key strokes. That interval value is conservative perhaps and II think you can tune it for your keyboard. Some of ADB keyboards requires longer interval than others.

https://github.com/tmk/tmk_keyboard/blob/a76a3ee9147ac9ec912f0799a816e4c99587ab8c/converter/adb_usb/matrix.c#L440-L441

Also refer to these post for the interval value decision.
https://geekhack.org/index.php?topic=14290.msg1068919#msg1068919
https://geekhack.org/index.php?topic=14290.msg1070139#msg1070139

I'm curious about how far AEK can go with faster interval.

Other soruce may be mouse feature, you can disable it.
https://github.com/tmk/tmk_keyboard/blob/a76a3ee9147ac9ec912f0799a816e4c99587ab8c/converter/adb_usb/matrix.c#L131-L418

2) You use the application on MS-DOS, right?
The converter works in boot mode(6KRO) with DOS and it may has a bug in the mode.(no bug there)

Does normal keys like 'a' can repeat?

You don't have the problem on modern OS, right?

What is exactly "USB-converted AT-keyboard" and what controller or converter do you use for it?
Title: Re: ADB to USB keyboard converter
Post by: kettuz on Wed, 17 November 2021, 09:22:22

Thanks Hasu! I'll explore those links in more detail :)

Does normal keys like 'a' can repeat?
I might have seen that behavior but I'm not certain. I'll have to test more thoroughly

You don't have the problem on modern OS, right?
Well, one of the reasons I wanted to test the games in DOS was that I felt like there was slight sluggishness in Ubuntu 18.04 too.

What is exactly "USB-converted AT-keyboard" and what controller or converter do you use for it?
I have an AST Research Inc. AST102 -- pretty much same as this: https://www.retropcstore.com/product/ast-research-inc-model-astkb102-with-cherry-doubleshot-rubber-dome-keycaps/
Converter seems to be one of these "Blue Cubes": https://deskthority.net/wiki/File:Blue_Cube.jpg
Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 17 November 2021, 17:15:44
kettuz,
You can get debug log with hid_listen if you have the problem on Ubuntu also. See 'DEBUG' in the first post.

Title: Re: ADB to USB keyboard converter
Post by: hasu on Wed, 17 November 2021, 17:19:36
[FIRMWARE UPDATE]

Updated prebuilt firmware files in repo and they are available on Keymap Editor too.

Chages:
    - Initialize keyboard dynamically #671
      Extended and ISO keyboard are properly setup even after hot-plug
    - Mouse buttons state integration #101
      This allows users to use mousekey buttons with ADB mouse
    - Reset devices on startup
      This restores devices to default state on warm startup like flashing firmware
    - mouse extended 16-bit report support
    - Add scroll wheel emulation #692

Title: Re: TMK ADB to USB keyboard converter
Post by: casualdehid on Sat, 18 December 2021, 07:56:05
Hi there.
Again (sorry), a small bug report I have here:
Pressing Esc on the Power On key does absolutelly nothing, confirmed with EK Swtich Hitter.

Keyb: M0118, Assembled in Ireland. .hex attached.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sat, 18 December 2021, 18:07:47
In TMK ADB converter Power key is used for 'Magic key' and you can access 'Magic commands' by pressing some key while holding the Power key. This means you can't remap the Power key to keys used for 'Magic commands' like below by default unfortunately.

Quote
z e h d x k m v s n c / ` Esc CapsLock Pause
0 1 2 3 4 5 6 7 8 9 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10


Disable 'Magic command' function and build firmware yourself if you need to remap Power key to those keys.
Quote
diff --git a/converter/adb_usb/Makefile b/converter/adb_usb/Makefile
index 3b10a10a..af3e2b54 100644
--- a/converter/adb_usb/Makefile
+++ b/converter/adb_usb/Makefile
@@ -71,7 +71,7 @@ BOOTMAGIC_ENABLE ?= no                # Virtual DIP switch configuration(+1000)
 MOUSEKEY_ENABLE ?= yes         # Mouse keys(+4700)
 EXTRAKEY_ENABLE ?= yes         # Audio control and System control(+450)
 CONSOLE_ENABLE ?= yes          # Console for debug(+400)
-COMMAND_ENABLE ?= yes          # Commands for debug and configuration
+COMMAND_ENABLE ?= no           # Commands for debug and configuration
 NKRO_ENABLE ?= no              # USB Nkey Rollover
 ADB_MOUSE_ENABLE ?= yes                # ADB Mouse support
 UNIMAP_ENABLE ?= yes           # Use unimap
Title: Re: TMK ADB to USB keyboard converter
Post by: kungfu_jesus on Thu, 17 February 2022, 18:01:22
I've resurrected this project (M0116) from my closet of shame and it's alive but I'm missing a "column" of keys. I think I resoldered all of these switches at some point... Can anyone speak to the construction of these boards and if I may be looking at a software or a hardware issue here? Not sure if one bad switch would affect the rest in a certain configuration or if a misconfigured layout would do it as well. Trying to look into recompiling but it's been so long my head is spinning.  ;)
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Thu, 17 February 2022, 19:37:31
Is it a converter you bought or built?
You can use the configurator linked in the 1st post.
Title: Re: TMK ADB to USB keyboard converter
Post by: kungfu_jesus on Thu, 17 February 2022, 19:43:31
Built using a Teensy 2.0+++. I can't seem to get the latest tmk to make, but the repo from 2018 still works.

I do have the regular Teensy 2.0 handy as well so I may as well just solder the connections to that and try a flash on that as well using the configurator.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Thu, 17 February 2022, 19:46:15
Did you wire columns or using it as a converter?

The ++ 2.0 uses a different processor than teensy 2.0 or promicro. It's doable, just chase to change processor designation.
Title: Re: TMK ADB to USB keyboard converter
Post by: kungfu_jesus on Fri, 18 February 2022, 08:15:05
I am using it as a converter. Good news though, I got it working! I did end up wiring in the Teensy 2.0 and had the same issues which indicated a hardware problem. I actually traced the leads on the PCB and wouldn't you know the numpad 4 traces through the numpad 1 over and up through the affected keys. I had a poor solder job on the 0 key which affected everything else 'down the line.' Thank you for your help and suggestions!

Happily typing this on my M0116!  :thumb:
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Fri, 18 February 2022, 09:05:58
glad you got it figured out.

enjoy the board.
Title: Re: TMK ADB to USB keyboard converter
Post by: Jiekebo on Sun, 20 February 2022, 06:22:39
Thank you for this amazing converter. Worked like a charm right away, and brought this board back into service :)
Only needed make some small changes to the default keymap before it was just right.
Since I wanted to use the power button to switch layer and have F1-F12 on the number row, I changed the COMMAND_ENABLE to no in the makefile.
Again big thanks!

(https://i.imgur.com/qQNc8Jc.jpg)
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Mon, 21 March 2022, 10:11:01
Hi

I have a TMK adapter (and i have compiled the last firmware) and a Macally ADB Mouse with two buttons.

And the second button will not  work. I have tested with others USB/ADB adapter, with the same problem

After many search, i have found a thing : the Macally mouse use a special protocol. The GNU/Linux driver can use the mouse and the second button, is this possible to add support for that ? (https://elixir.bootlin.com/linux/latest/source/drivers/macintosh/adbhid.c)

I can try to compile.

Pierre

Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Mon, 21 March 2022, 11:00:23
i know of the "Macally ADB Mouse", used to have one we used with our Power Macintosh 9600's. though i don't have one currently to test.
although, generally, the right click is usually a contol + click. so if it's registering as a normal click, you can set it as a macro to be "control + click"
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Mon, 21 March 2022, 12:58:33
This mouse don't send a nomrla click on the right click, it's a special protocol. I have only the left click (on Mac OS 9, the mouse need a special extension)
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Mon, 21 March 2022, 14:20:02
i'd bet it's a modified left click. like i said, a control + click. so the right is just a modifier to the left.

yep. see below.
this is kinda backwards of what hasu's device is. but confirms my suspicion.
https://www.bigmessowires.com/2017/06/23/multi-button-mouse-support/

or if you just really like the shape of it, you could give it new guts, make it optical and get rid of the ball.

i'm sure @Hasu will comment as well
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Mon, 21 March 2022, 18:40:57
Dandu,
did you check debug prints with hid_listen?
It would be helpful to see how the converter recognizes the mouse.
Can you share log?

It needs manufacture specific initialization code to enable its full function probably as you said.
If it happens to support Apple Extended protocol the second button will work as a middle button without 'specific initialization'. Though, many adb mouses don't support.

Anyway, I'm also interested in adding support for Macally mouse and happy to help.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 22 March 2022, 10:17:21
i'd bet it's a modified left click. like i said, a control + click. so the right is just a modifier to the left.

yep. see below.
this is kinda backwards of what hasu's device is. but confirms my suspicion.
https://www.bigmessowires.com/2017/06/23/multi-button-mouse-support/

or if you just really like the shape of it, you could give it new guts, make it optical and get rid of the ball.

i'm sure @Hasu will comment as well

Actually, i have tested many two button mouse. Many mouse dont't make "ctrl + clic", they make a "forced clic" The first press make a clic, the second release it.

With this mouse, i have nothing when i press the right clic (even with an old Mac, by the way). The only way to have a right clic is to install the extension on Mac OS 9 (i have write about this mouse, in french) : https://www.journaldulapin.com/2022/03/21/adb-souris-macally/
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 22 March 2022, 10:23:00
Dandu,
did you check debug prints with hid_listen?
It would be helpful to see how the converter recognizes the mouse.
Can you share log?

It needs manufacture specific initialization code to enable its full function probably as you said.
If it happens to support Apple Extended protocol the second button will work as a middle button without 'specific initialization'. Though, many adb mouses don't support.

Anyway, I'm also interested in adding support for Macally mouse and happy to help.

Thank you

I have tried HID_listen (under macOS) and the left clic make a thing, but not the right clic.

I join a little sample (when i have tried, i have press the right clic). And the right clic work with Mac OS 9 and the extension.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 22 March 2022, 19:17:21
It seems to work as a one-button mouse.

Didn't you see oputputs like below? This part indicates how the converter initializes mouse.
To see this debug print you may have to hot-plug the mouse after plugging the converter into USB port.

For reference:
This is debug prints of 'Apple Desktop Bus Mouse II', which has only one button.
Quote

M:TMP: reg3:6B01
M:EXT: reg3:6902
M:Classic 200cpi
M:POL: done

Scan:
 addr:10, reg3:6D02


and this is Kensington TurboMouse 5.
Quote

TMP: reg3:6F01             
M:EXT: reg3:6104                                                                                                     
M:EXT: [4B 4D 4C 31 00 C8 02 04] cpi=200                                                                             
M:TM5: found                                                                                                         
M:TMP: reg3:6E32                                                                                                     
TM5: setup                                                                                                           
M:POL: done                                                                                                           
                                                                                                                     
Scan:                                                                                                                 
 addr:10, reg3:6232



Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 22 March 2022, 19:51:43
Dandu,
Can you try this patch?

Code: [Select]
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index ee99d7d5..0c7f291d 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -242,6 +242,12 @@ again:
             adb_host_flush(ADB_ADDR_MOUSE_TMP);
             adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, ((reg3 >> 8) & 0xF0) | ADB_ADDR_0, 0xFE);
             goto again;
+        } else if (buf[0] == 0x4B && buf[1] == 0x4F && buf[2] == 0x49 && buf[3] == 0x54) {
+            // https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L1068
+            dmprintf("Macally2: found\n");
+            adb_host_flush(ADB_ADDR_MOUSE_TMP);
+            adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, (reg3 >> 8), 0x42);
+            mouse_handler = (reg3 = adb_host_talk(ADB_ADDR_MOUSE_TMP, ADB_REG_3)) & 0xFF;
         } else {
             dmprintf("Unknown\n");
         }
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Wed, 23 March 2022, 12:30:51
Hi

It works ! After the patch, i have a right clic. But there is a little problem : the mouse send the cursor ΰ the bottom right of the display. Very weird (and only with this mouse, i suppose it's a problem with the patch).
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 23 March 2022, 19:14:29
Try this patch then. Macally2 seems to need to be handled peculiarly.


Code: [Select]
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index ee99d7d5..43368119 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -153,10 +153,10 @@ void matrix_init(void)
 }
 
 #ifdef ADB_MOUSE_ENABLE
+static uint8_t mouse_handler;
 static void mouse_init(void)
 {
     uint16_t reg3;
-    uint8_t mouse_handler;
 
 again:
     // Check if there is mouse device at default address 3
@@ -242,6 +242,12 @@ again:
             adb_host_flush(ADB_ADDR_MOUSE_TMP);
             adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, ((reg3 >> 8) & 0xF0) | ADB_ADDR_0, 0xFE);
             goto again;
+        } else if (buf[0] == 0x4B && buf[1] == 0x4F && buf[2] == 0x49 && buf[3] == 0x54) {
+            // https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L1068
+            dmprintf("Macally2: found\n");
+            adb_host_flush(ADB_ADDR_MOUSE_TMP);
+            adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, (reg3 >> 8), ADB_HANDLER_MACALLY2_MOUSE);
+            mouse_handler = (reg3 = adb_host_talk(ADB_ADDR_MOUSE_TMP, ADB_REG_3)) & 0xFF;
         } else {
             dmprintf("Unknown\n");
         }
@@ -350,6 +356,13 @@ void adb_mouse_task(void)
     //   b--: Button state.(0: on, 1: off)
     //   x--: X axis movement.
     //   y--: Y axis movement.
+    //
+    // Macally2
+    //
+    //   Byte 0: b00 y06 y05 y04 y03 y02 y01 y00
+    //   Byte 1: b01 x06 x05 x04 x03 x02 x01 x00
+    //   Byte 2: 1   0   0   0   1   0   0   0
+    //   Byte 3: 1   0   0   0   1   0   0   0
     len = adb_host_talk_buf(ADB_ADDR_MOUSE_POLL, ADB_REG_0, buf, sizeof(buf));
 
     // If nothing received reset mouse acceleration, and quit.
@@ -365,6 +378,9 @@ void adb_mouse_task(void)
     if (len == 2) {
         if (buf[0] & 0x40) yneg = true;
         if (buf[1] & 0x40) xneg = true;
+    } else if (mouse_handler == ADB_HANDLER_MACALLY2_MOUSE) {
+        if (buf[0] & 0x40) yneg = true;
+        if (buf[1] & 0x40) xneg = true;
     } else {
         if (buf[len - 1] & 0x40) yneg = true;
         if (buf[len - 1] & 0x04) xneg = true;
diff --git a/tmk_core/protocol/adb.h b/tmk_core/protocol/adb.h
index 31c26fb9..578f9883 100644
--- a/tmk_core/protocol/adb.h
+++ b/tmk_core/protocol/adb.h
@@ -95,6 +95,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define ADB_HANDLER_CLASSIC2_MOUSE      0x02
 #define ADB_HANDLER_EXTENDED_MOUSE      0x04
 #define ADB_HANDLER_TURBO_MOUSE         0x32
+#define ADB_HANDLER_MACALLY2_MOUSE      0x42
 
 
 // ADB host
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Thu, 24 March 2022, 03:39:27
Same problem : the cursor go to the bottom right when i move the mouse (but the right clic is working)

For the patch, i have revert the first one and apply the second one. Is this right ?

(and thank you for your work)
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Thu, 24 March 2022, 05:01:05
Right. Apply the patche to the latest 'master' branch.
Post debug log would be helpful.

Handling sign of mouse movement value is a cause probably.
If you can debug it see lines around this.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/matrix.c#L398-L400
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Thu, 24 March 2022, 14:53:33
What can i do exactly ?

I join a log with debug "on" (i have chained a keyboard to do that).

I'm not an expert. I can compile, modify things if you explain me, but it's too hard for me : i don't understand all the code.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Thu, 24 March 2022, 16:25:20
Thanks for the log.

OK. Let me ask some.
What is your converter's mcu?  ATmega32u2, ATmega32u4 or other? I'll build the firmware for you next time.
What is your OS? MacOS, Windows or Linux?

Debug print is enabled by default in current firmware configuration, you don't have to turn it on by hand.


Added some debug prints to see how mouse movement data are processed. Try this patch and post debug log.
Code: [Select]
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index ee99d7d5..6b03b71e 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -153,10 +153,10 @@ void matrix_init(void)
 }
 
 #ifdef ADB_MOUSE_ENABLE
+static uint8_t mouse_handler;
 static void mouse_init(void)
 {
     uint16_t reg3;
-    uint8_t mouse_handler;
 
 again:
     // Check if there is mouse device at default address 3
@@ -242,6 +242,12 @@ again:
             adb_host_flush(ADB_ADDR_MOUSE_TMP);
             adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, ((reg3 >> 8) & 0xF0) | ADB_ADDR_0, 0xFE);
             goto again;
+        } else if (buf[0] == 0x4B && buf[1] == 0x4F && buf[2] == 0x49 && buf[3] == 0x54) {
+            // https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L1068
+            dmprintf("Macally2: found\n");
+            adb_host_flush(ADB_ADDR_MOUSE_TMP);
+            adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, (reg3 >> 8), ADB_HANDLER_MACALLY2_MOUSE);
+            mouse_handler = (reg3 = adb_host_talk(ADB_ADDR_MOUSE_TMP, ADB_REG_3)) & 0xFF;
         } else {
             dmprintf("Unknown\n");
         }
@@ -350,6 +356,13 @@ void adb_mouse_task(void)
     //   b--: Button state.(0: on, 1: off)
     //   x--: X axis movement.
     //   y--: Y axis movement.
+    //
+    // Macally2
+    //
+    //   Byte 0: b00 y06 y05 y04 y03 y02 y01 y00
+    //   Byte 1: b01 x06 x05 x04 x03 x02 x01 x00
+    //   Byte 2: 1   0   0   0   1   0   0   0
+    //   Byte 3: 1   0   0   0   1   0   0   0
     len = adb_host_talk_buf(ADB_ADDR_MOUSE_POLL, ADB_REG_0, buf, sizeof(buf));
 
     // If nothing received reset mouse acceleration, and quit.
@@ -357,7 +370,12 @@ void adb_mouse_task(void)
         mouseacc = 1;
         return;
     };
-    dmprintf("[%02X %02X %02X %02X %02X]\n", buf[0], buf[1], buf[2], buf[3], buf[4]);
+
+    //dmprintf("[%02X %02X %02X %02X %02X] %02X\n", buf[0], buf[1], buf[2], buf[3], buf[4], len);
+    xprintf("M:[ ");
+    for (uint8_t i = 0; i < len; i++)
+        xprintf("%02X ", buf[i]);
+    xprintf("]\n");
 
     // Store off-buttons and 0-movements in unused bytes
     bool xneg = false;
@@ -365,6 +383,9 @@ void adb_mouse_task(void)
     if (len == 2) {
         if (buf[0] & 0x40) yneg = true;
         if (buf[1] & 0x40) xneg = true;
+    } else if (mouse_handler == ADB_HANDLER_MACALLY2_MOUSE) {
+        if (buf[0] & 0x40) yneg = true;
+        if (buf[1] & 0x40) xneg = true;
     } else {
         if (buf[len - 1] & 0x40) yneg = true;
         if (buf[len - 1] & 0x04) xneg = true;
@@ -376,6 +397,11 @@ void adb_mouse_task(void)
         if (xneg) buf[i] |= 0x07;
     }
 
+    xprintf("M:[ ");
+    for (uint8_t i = 0; i < sizeof(buf); i++)
+        xprintf("%02X ", buf[i]);
+    xprintf("]\n");
+
     // 8 buttons at max
     // TODO: Fix HID report descriptor for mouse to support button6-8
     uint8_t buttons = 0;
diff --git a/tmk_core/protocol/adb.h b/tmk_core/protocol/adb.h
index 31c26fb9..578f9883 100644
--- a/tmk_core/protocol/adb.h
+++ b/tmk_core/protocol/adb.h
@@ -95,6 +95,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define ADB_HANDLER_CLASSIC2_MOUSE      0x02
 #define ADB_HANDLER_EXTENDED_MOUSE      0x04
 #define ADB_HANDLER_TURBO_MOUSE         0x32
+#define ADB_HANDLER_MACALLY2_MOUSE      0x42
 
 
 // ADB host
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Fri, 25 March 2022, 06:51:26
Hi

Thank you !

I join the log.

For the adapter, it's an old model with a ATmega32u4 (Arduino Pro Micro, i mean), made by a friend many years ago.

And i'm testing with macOS (the last version) and i compile on a Mac too.


Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Fri, 25 March 2022, 06:56:18
And i have many mouse and keyboard.

Can i post here to try to correct some problems ?

I have many mouse with a weird right clic too : they send a left clic for the right and the left button, but i don't know if it's a problem with the conversion, or a hardware thing. Is this possible to see that with the logs ?

Many mouse works correctly (thank you !) like Logitech mouse with 3 buttons.

But i have mouse who will not work, like NeXT ADB mouse and a trackpad (Glidepoint).

I can post logs and try things to verify that.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Fri, 25 March 2022, 18:08:39
Fixed signed integer handling for Macally 2. Apply this patch or try attached firmware.
Can you post debug log again?

Code: [Select]
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index ee99d7d5..b4225a9f 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -153,10 +153,10 @@ void matrix_init(void)
 }
 
 #ifdef ADB_MOUSE_ENABLE
+static uint8_t mouse_handler;
 static void mouse_init(void)
 {
     uint16_t reg3;
-    uint8_t mouse_handler;
 
 again:
     // Check if there is mouse device at default address 3
@@ -242,6 +242,12 @@ again:
             adb_host_flush(ADB_ADDR_MOUSE_TMP);
             adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, ((reg3 >> 8) & 0xF0) | ADB_ADDR_0, 0xFE);
             goto again;
+        } else if (buf[0] == 0x4B && buf[1] == 0x4F && buf[2] == 0x49 && buf[3] == 0x54) {
+            // https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L1068
+            dmprintf("Macally2: found\n");
+            adb_host_flush(ADB_ADDR_MOUSE_TMP);
+            adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, (reg3 >> 8), ADB_HANDLER_MACALLY2_MOUSE);
+            mouse_handler = (reg3 = adb_host_talk(ADB_ADDR_MOUSE_TMP, ADB_REG_3)) & 0xFF;
         } else {
             dmprintf("Unknown\n");
         }
@@ -350,6 +356,15 @@ void adb_mouse_task(void)
     //   b--: Button state.(0: on, 1: off)
     //   x--: X axis movement.
     //   y--: Y axis movement.
+    //
+    // Macally2
+    //
+    //   Byte 0: b00 y06 y05 y04 y03 y02 y01 y00
+    //   Byte 1: b01 x06 x05 x04 x03 x02 x01 x00
+    //   Byte 2: 1   0   0   0   1   0   0   0
+    //   Byte 3: 1   0   0   0   1   0   0   0
+    //
+    //   Byte 2 and 3 have no meaningful info.
     len = adb_host_talk_buf(ADB_ADDR_MOUSE_POLL, ADB_REG_0, buf, sizeof(buf));
 
     // If nothing received reset mouse acceleration, and quit.
@@ -357,7 +372,12 @@ void adb_mouse_task(void)
         mouseacc = 1;
         return;
     };
-    dmprintf("[%02X %02X %02X %02X %02X]\n", buf[0], buf[1], buf[2], buf[3], buf[4]);
+
+    //dmprintf("[%02X %02X %02X %02X %02X] %02X\n", buf[0], buf[1], buf[2], buf[3], buf[4], len);
+    xprintf("M:[ ");
+    for (uint8_t i = 0; i < len; i++)
+        xprintf("%02X ", buf[i]);
+    xprintf("]\n");
 
     // Store off-buttons and 0-movements in unused bytes
     bool xneg = false;
@@ -365,17 +385,28 @@ void adb_mouse_task(void)
     if (len == 2) {
         if (buf[0] & 0x40) yneg = true;
         if (buf[1] & 0x40) xneg = true;
+    } else if (mouse_handler == ADB_HANDLER_MACALLY2_MOUSE) {
+        if (buf[0] & 0x40) yneg = true;
+        if (buf[1] & 0x40) xneg = true;
+        // Ignore Byte 2 and 3
+        len = 2;
     } else {
         if (buf[len - 1] & 0x40) yneg = true;
         if (buf[len - 1] & 0x04) xneg = true;
     }
 
+    // Make unused buf bytes compatible with Extended Mouse Protocol
     for (int8_t i = len; i < sizeof(buf); i++) {
         buf[i] = 0x88;
         if (yneg) buf[i] |= 0x70;
         if (xneg) buf[i] |= 0x07;
     }
 
+    xprintf("M:[ ");
+    for (uint8_t i = 0; i < sizeof(buf); i++)
+        xprintf("%02X ", buf[i]);
+    xprintf("]\n");
+
     // 8 buttons at max
     // TODO: Fix HID report descriptor for mouse to support button6-8
     uint8_t buttons = 0;
diff --git a/tmk_core/protocol/adb.h b/tmk_core/protocol/adb.h
index 31c26fb9..578f9883 100644
--- a/tmk_core/protocol/adb.h
+++ b/tmk_core/protocol/adb.h
@@ -95,6 +95,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define ADB_HANDLER_CLASSIC2_MOUSE      0x02
 #define ADB_HANDLER_EXTENDED_MOUSE      0x04
 #define ADB_HANDLER_TURBO_MOUSE         0x32
+#define ADB_HANDLER_MACALLY2_MOUSE      0x42
 
 
 // ADB host

[attachurl=1]
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Fri, 25 March 2022, 19:12:12
Yes, sharing problem here would be helpful for us and future users.
Can you happen to have list of your keyboards and mouses with berief description of their result and problem?

As for keyboards, let me know if you find any problem. I definitely want to know.
I believe any ADB keyboards should work with current firmware. They don't require specific driver code.

As for mouses,  most of multi-button mouses will require specific driver code and many won't work with current firmware.
Any ADB mouses including multi-button ones work as one-button mouse at least. Let me know if you find exception.

I don't necessarily aim to support all multi-button mouses. But I'll try if you have enough time to debug.


As for  "weird" right button, I think many of two(multi)-button mouses had custom action(control+left click, for example) by default,  as nevin referred to before. Some of them are configurable with manufacturer driver and others are hard-coded.

It would be helpful if you have printed 'user's manual' or can find it on the net.




And i have many mouse and keyboard.

Can i post here to try to correct some problems ?

I have many mouse with a weird right clic too : they send a left clic for the right and the left button, but i don't know if it's a problem with the conversion, or a hardware thing. Is this possible to see that with the logs ?

Many mouse works correctly (thank you !) like Logitech mouse with 3 buttons.

But i have mouse who will not work, like NeXT ADB mouse and a trackpad (Glidepoint).

I can post logs and try things to verify that.

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 05:04:46
Fixed signed integer handling for Macally 2. Apply this patch or try attached firmware.
Can you post debug log again?


The mouse do the same thing : go directly to the bottom right (and the right clic is working). It's very annoying on my Mac, by the way : i have the "active corner" (i don't know the name in english) and the display go to sleep.

I have tried with the code (i have patched) and with your firmware.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 05:10:56
Yes, sharing problem here would be helpful for us and future users.
Can you happen to have list of your keyboards and mouses with berief description of their result and problem?

As for keyboards, let me know if you find any problem. I definitely want to know.
I believe any ADB keyboards should work with current firmware. They don't require specific driver code.

As for mouses,  most of multi-button mouses will require specific driver code and many won't work with current firmware.
Any ADB mouses including multi-button ones work as one-button mouse at least. Let me know if you find exception.

I don't necessarily aim to support all multi-button mouses. But I'll try if you have enough time to debug.

As for  "weird" right button, I think many of two(multi)-button mouses had custom action(control+left click, for example) by default,  as nevin referred to before. Some of them are configurable with manufacturer driver and others are hard-coded.

It would be helpful if you have printed 'user's manual' or can find it on the net.


Actually, i have tested all my mouse with 2 buttons or more (~20 mouse). All the mouse with one button are working. Many mouse will work as intended, like Logitech with three buttons.

I will made many post to separate the things, because i have different problem.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 05:31:47
First, three mouse with the same problem : there is a right clic, but the clic send the left clic. Honestly, i suppose it will be normal, but i'm not sure.

The first one (logs 01) is a noname mouse, i have not the manual. (https://www.journaldulapin.com/2019/03/22/une-souris-adb-avec-trois-boutons-et-une-fausse-molette/)

I have removed the ball and just press the left button (3 times) and the right button (three times). Its seems to be an hardware things (the logs seems identical).

The second one is a Logitech Kidz (https://www.journaldulapin.com/2017/06/28/logitech-kidz-mouse/)

Same thing : i have removed the ball and pressed three times at left, and three times at right. And i have not found the manual.

And the 3rd one : a mini trackball. https://www.journaldulapin.com/2019/04/04/mini-trackball-adb/

Actually, i have the manual, but it's weird : a version say the two button are the same, and a second version say "the first button change the speed". (i have join the page)
 
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 05:40:17
Second, two trackballs with a weird problem (and probably an hardware things) : they send left and right clic when i press the button.

The trackball (https://www.journaldulapin.com/2019/10/23/un-trackball-adb-original-et-inutilisable-sur-un-mac-moderne/) send a left clic *and* a right clic when i press the button. I have pressed three times the button on the log.

The second trackball do the same things, but with a second problem : it's a keypad and a trackball into the same enclosure. And the keypad will not work. https://www.journaldulapin.com/2020/02/19/trackball-pad/



Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 05:46:33
Weird problem :

A Logitech Trackball (https://www.journaldulapin.com/2017/09/23/le-trackball-adb-de-logitech/)

First thing : button 1 send a clic (seems OK), button 2 and 3 send keyboard command (left and right). I think it's the normal way.

But the ball don't move the mouse, and my HID test app' say it's the "Mouse Wheel". Very Weird.

I the log, i have pressed the three button three times, and i have move the ball.

It's a TrackMan Mouse, FCCID DZLTAA1, M/N : T-AA1-4MD.

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 05:51:36
Another weird mouse : a "wooden" mouse with two button, and when i connect the mouse, i cannot make a right clic with the other mouse on my Mac. (https://www.journaldulapin.com/2020/06/02/souris-plastique-bois/)

And the right clic on the mouse seems to send a left clic. I have removed the ball, too, so only 3 left clic and 3 right clic on the logs.


Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 06:00:26
The last three are not working, at all.

First one is a GlidPoint trackpad : i have nothing. Nothing on the logs (https://www.journaldulapin.com/2020/07/29/trackpad-adb/)

The second is a Kensington Thinking Mouse. https://www.journaldulapin.com/2017/02/24/souris-adb-boutons-2/

It's Logs 08, and when i connect the mouse, i have RRRR on the logs, and a "s" every second or so.

And the last one is a NeXT mouse (the ADB one, obviously). Like the trackpad : nothing on logs.

The three mouse works with an iMate, and the NeXT mouse send a real right clic.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 27 March 2022, 07:08:36
Fixed signed integer handling for Macally 2. Apply this patch or try attached firmware.
Can you post debug log again?


The mouse do the same thing : go directly to the bottom right (and the right clic is working). It's very annoying on my Mac, by the way : i have the "active corner" (i don't know the name in english) and the display go to sleep.

I have tried with the code (i have patched) and with your firmware.



Can you try attached firmware again and do procedures below?

0. run hid_listen.
1. plugin only the converter  into USB port.
2. then pulgin Macally2 mouse into the converter.
3. move mouse

[attachurl=1]
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 27 March 2022, 08:31:53
Device 01, 02, 03: Agree. It seems they are working as intended.

Device 04, 05: Interesting. They are unusable with this converter.
How do these device behave with iMate? They registers left and right click at same time, or left only?
Do you happen to know how these devices works without driver on  classic Mac?

Device 07: This always registers right click. This is unusable.

Device 06: Logitech Trackman require driver. We know Linux have one for this.

If you still have classic Mac(OS9?) with ADB interface try Device 04, 05 and 07 to see how they work. It would be helpful.


For reference,
Debug Log lines indicates:
Quote

M:[ 80 80 ]  // Raw bytes in hexdecimal that device sends
M:[ 80 80 88 88 88 ] // Prcessed bytes internally by firmware
M:[B:00 X:0(0) Y:0(0) V:0 A:1]  // How firmware recogizes the bytes

The raw bytes(in Apple Mouse Classic protocol) should be recognized like this.
(https://developer.apple.com/library/archive/technotes/hw/images/hw_01_001.gif)
https://developer.apple.com/library/archive/technotes/hw/hw_01.html#Section6

For example,
Quote

M:[ 80 80 ] // both buttons released
M:[ 00 80 ] // lert button depressed
M:[ 80 00 ] // right(optional) button depressed
M:[ 00 00 ] // both buttons deppressed
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 27 March 2022, 08:32:42
Do they work well with iMate? Assuming you have Griffin iMate.
Ah, you said they work with iMate.

'RRR' is likely to displayed when the converter has no pull-up resistor, or when you hot-plug device(this is no harm).
Do you solder pull-up resistor on DATA line?

I can't know without debug log. But I guess they have different signal timing  and the converter miss.


The last three are not working, at all.

First one is a GlidPoint trackpad : i have nothing. Nothing on the logs (https://www.journaldulapin.com/2020/07/29/trackpad-adb/)

The second is a Kensington Thinking Mouse. https://www.journaldulapin.com/2017/02/24/souris-adb-boutons-2/

It's Logs 08, and when i connect the mouse, i have RRRR on the logs, and a "s" every second or so.

And the last one is a NeXT mouse (the ADB one, obviously). Like the trackpad : nothing on logs.

The three mouse works with an iMate, and the NeXT mouse send a real right clic.


Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 12:23:25
Fixed signed integer handling for Macally 2. Apply this patch or try attached firmware.
Can you post debug log again?


The mouse do the same thing : go directly to the bottom right (and the right clic is working). It's very annoying on my Mac, by the way : i have the "active corner" (i don't know the name in english) and the display go to sleep.

I have tried with the code (i have patched) and with your firmware.



Can you try attached firmware again and do procedures below?

0. run hid_listen.
1. plugin only the converter  into USB port.
2. then pulgin Macally2 mouse into the converter.
3. move mouse

(Attachment Link)

Done.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 12:49:28
Device 01, 02, 03: Agree. It seems they are working as intended.

Device 04, 05: Interesting. They are unusable with this converter.
How do these device behave with iMate? They registers left and right click at same time, or left only?
Do you happen to know how these devices works without driver on  classic Mac?

Device 07: This always registers right click. This is unusable.

Device 06: Logitech Trackman require driver. We know Linux have one for this.

If you still have classic Mac(OS9?) with ADB interface try Device 04, 05 and 07 to see how they work. It would be helpful.

For reference,
Debug Log lines indicates:
Quote

M:[ 80 80 ]  // Raw bytes in hexdecimal that device sends
M:[ 80 80 88 88 88 ] // Prcessed bytes internally by firmware
M:[B:00 X:0(0) Y:0(0) V:0 A:1]  // How firmware recogizes the bytes

The raw bytes(in Apple Mouse Classic protocol) should be recognized like this.
Show Image
(https://developer.apple.com/library/archive/technotes/hw/images/hw_01_001.gif)

https://developer.apple.com/library/archive/technotes/hw/hw_01.html#Section6

For example,
Quote

M:[ 80 80 ] // both buttons released
M:[ 00 80 ] // lert button depressed
M:[ 80 00 ] // right(optional) button depressed
M:[ 00 00 ] // both buttons deppressed

Thanks !

For Device 4 (the Trackball) with left and right clic : it works the same with iMate (left and right when i press the button). No problem with Mac OS 9 on a Power Mac G3 (but Mac OS don't use the right clic, i suppose).

For Device 5 (the same trackball with a Keypad)  : same problem with iMate, but with iMate, the Keypad is working as intended. On a real Mac, no problem, and the Keypad is working.

For Device 7 (the mouse with right clic unusable) : same problem, the mouse seems to send a right clic when i connect the iMate, and after that, the right clic is unusable (i suppose the mouse is not releasing the clic ?). No problem on a real Mac.

For Device 6 (the Logitech TrackMan) : it works with the iMate, the cursor move. The two additional buttons send keyboard key (left and right, but i suppose it's normal). On a real old Mac : the cursor move very slowly and send clic (the cursor try to make a selection). It's unusable. I will try to find the driver for Mac OS 9.

I think it will be interessant to try to find the problem with the keypad on Device 5, and eventually to support the Logitech TrackMan.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 27 March 2022, 13:05:30
Do they work well with iMate? Assuming you have Griffin iMate.
Ah, you said they work with iMate.

'RRR' is likely to displayed when the converter has no pull-up resistor, or when you hot-plug device(this is no harm).
Do you solder pull-up resistor on DATA line?

I can't know without debug log. But I guess they have different signal timing  and the converter miss.


Actually, i have tried with hot-plug the first time.

This time :

-for the Kensington mouse, i have only the "s" when i connect the adapter with the mouse on it.

-for the NeXT mouse, i have this message :
Code: [Select]
Listening:

TMK:f67a6c/LUFA:d6a7df

Scan:
 addr:3, reg3:6501


USB configured.

Loop start.

For the trackpad, this message :

Code: [Select]
Waiting for device:....
Listening:

TMK:f67a6c/LUFA:d6a7df

Scan:
 addr:3, reg3:6001


USB configured.

Loop start.

For the resistor, i have not a resistor. I join two photos from my adapter. I can add the resistor : i must just solder a resistor on two pins, right ? I will try that this week if i have the correct value. Can you just indicate the pins and the value ?

Thank's !


Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 27 March 2022, 18:56:59
Hmm, I'm missing something on Macally2.
Added debug prints to see what happens.

Can you try attached firmware with procedure below this time?


0. run hid_listen.
1. plugin only the converter  into USB port.
2. wait until you find 'Loop start.' on console.
3. then pulgin Macally2 mouse into the converter.
4. move mouse


You should see version string at procedure 2 with this firmware.
Code: [Select]
TMK:deaa49/LUFA:d6a7df


[attachurl=1]
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 27 March 2022, 19:37:20
For the resistor, i have not a resistor. I join two photos from my adapter. I can add the resistor : i must just solder a resistor on two pins, right ? I will try that this week if i have the correct value. Can you just indicate the pins and the value ?

I found design files of your converter here, it has already 10k pull-up resistor but it may be weak in some cases. Recently I found 1-4.7k resisitor is required for ADB.
https://github.com/tibounise/ADBUSB-0x1

And voltage drop is another concern because the converter uses Pro Micro.
https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge


First, close J1 on Pro Micro with solder bridge.

Try this if first one doesn't change situation on GlidePoint/Kensington/NeXT.
Second, solder pull-up resistor between '3' pin and 'VCC' pin on Pro Micro.
Proper resistor value is 1.5k-4.7k in your case. But 1k is a bit strong but probably ok.

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Mon, 28 March 2022, 11:59:02
Hmm, I'm missing something on Macally2.
Added debug prints to see what happens.

Can you try attached firmware with procedure below this time?


0. run hid_listen.
1. plugin only the converter  into USB port.
2. wait until you find 'Loop start.' on console.
3. then pulgin Macally2 mouse into the converter.
4. move mouse


You should see version string at procedure 2 with this firmware.
Code: [Select]
TMK:deaa49/LUFA:d6a7df


(Attachment Link)

I have done that, i join the logs.

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Mon, 28 March 2022, 12:08:31
For the resistor, i have not a resistor. I join two photos from my adapter. I can add the resistor : i must just solder a resistor on two pins, right ? I will try that this week if i have the correct value. Can you just indicate the pins and the value ?

I found design files of your converter here, it has already 10k pull-up resistor but it may be weak in some cases. Recently I found 1-4.7k resisitor is required for ADB.
https://github.com/tibounise/ADBUSB-0x1

And voltage drop is another concern because the converter uses Pro Micro.
https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge


First, close J1 on Pro Micro with solder bridge.

Try this if first one doesn't change situation on GlidePoint/Kensington/NeXT.
Second, solder pull-up resistor between '3' pin and 'VCC' pin on Pro Micro.
Proper resistor value is 1.5k-4.7k in your case. But 1k is a bit strong but probably ok.

The J1 don't change. But with a 4,7K ohm resistor, the NeXT mouse is working (and with a right clic).
The Kensington mouse, too, but with a little problem : the mouse has 4 buttons. The first three works as intended (button 1 to 3 on my HID test app'). The button 4 send a clic (the logs are OK) but on my HID test app', i have not the button 4. If i understand the code, the mouse send a button "0" ?

I have pressed the button 1 three times, the button 2 three times, etc.

And even with the resistor, the trackpad will not work.


Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Mon, 28 March 2022, 23:57:17
For the resistor, i have not a resistor. I join two photos from my adapter. I can add the resistor : i must just solder a resistor on two pins, right ? I will try that this week if i have the correct value. Can you just indicate the pins and the value ?

I found design files of your converter here, it has already 10k pull-up resistor but it may be weak in some cases. Recently I found 1-4.7k resisitor is required for ADB.
https://github.com/tibounise/ADBUSB-0x1

And voltage drop is another concern because the converter uses Pro Micro.
https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge


First, close J1 on Pro Micro with solder bridge.

Try this if first one doesn't change situation on GlidePoint/Kensington/NeXT.
Second, solder pull-up resistor between '3' pin and 'VCC' pin on Pro Micro.
Proper resistor value is 1.5k-4.7k in your case. But 1k is a bit strong but probably ok.

The J1 don't change. But with a 4,7K ohm resistor, the NeXT mouse is working (and with a right clic).
The Kensington mouse, too, but with a little problem : the mouse has 4 buttons. The first three works as intended (button 1 to 3 on my HID test app'). The button 4 send a clic (the logs are OK) but on my HID test app', i have not the button 4. If i understand the code, the mouse send a button "0" ?

I have pressed the button 1 three times, the button 2 three times, etc.

And even with the resistor, the trackpad will not work.

hmm, interesting. This bit Those devices requires that strong pull-up against what I expected.

As for fourth button, it is configured as 'scroll button' by current firmware. This is useful for Kensington Turbo Mouse5.
You can scroll vertically by holding the button and move mouse.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/Makefile#L85-L98


GlidPoint trackpad may require stronger pull-up?
You can try 2.2k, 1.5k or 1k(or even 470 ohm?) instead of 4.7k.

I looked into my iMate and found it uses 470 ohm. This value surprised me and I'm not sure it is totally safe for controller in ADB devices.
Checked schematics and Apple IIgs has 470 ohm on its ADB interface as pull-up resistor. So 470 is OK probably.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Tue, 29 March 2022, 07:42:04
very cool. interesting about the pull-up resistor.

thank you two for really digging into this and for having such a vast collection of adb peripherals @Dandu & @hasu
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 29 March 2022, 11:13:31
@hasu : i have tried with a 470 ohms resistor and the GlidePoint is not recognised.

And thank's for the Kensington mouse, it works like that, excellent !

Actually, there is three mouse with a problem :

The Logitech TrackMan and the trackball with a keypad (tmk_keyboard only works with the trackball). And the Macally mouse with 2 buttons.

I will try my keyboards and joysticks next week (many ADB joystick works as mouse).
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 29 March 2022, 20:24:01
I think I found a bug and fixed for Macally2 finally. With this Macally2 should move cursor correctly.

This firmware also includes fix for Device 4, 5 and 7, these pointing devices should work as expected(same behaviour on Mac OS9) now.
I described this issue on github: https://github.com/tmk/tmk_keyboard/issues/724

As for Keypad part of Device 5 and GlidePoint I don't have any idea at this point. Please post debug log when trying cold-plug and hot-plug the devices.

Also I like to check debug log of NeXT mouse and Thinking mouse.

I'll work on Logitech TrackMan specific support later.

As for keyboards and joysticks test, let's postpone until current mouse issues are resolved.


[attachurl=1]

This is current patch, just for reference.
Code: [Select]
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index ee99d7d5..f94e94d0 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -153,10 +153,10 @@ void matrix_init(void)
 }
 
 #ifdef ADB_MOUSE_ENABLE
+static uint8_t mouse_handler;
 static void mouse_init(void)
 {
     uint16_t reg3;
-    uint8_t mouse_handler;
 
 again:
     // Check if there is mouse device at default address 3
@@ -173,11 +173,12 @@ again:
     }
 
     // Check if there is mouse device to setup at temporary address 15
-    mouse_handler = (reg3 = adb_host_talk(ADB_ADDR_MOUSE_TMP, ADB_REG_3)) & 0xFF;
+    reg3 = adb_host_talk(ADB_ADDR_MOUSE_TMP, ADB_REG_3);
     if (!reg3) {
         return;
     }
     dmprintf("TMP: reg3:%04X\n", reg3);
+    mouse_handler = reg3 & 0xFF;
 
 
     // Try to escalate into extended/classic2 protocol
@@ -242,6 +243,13 @@ again:
             adb_host_flush(ADB_ADDR_MOUSE_TMP);
             adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, ((reg3 >> 8) & 0xF0) | ADB_ADDR_0, 0xFE);
             goto again;
+        } else if (buf[0] == 0x4B && buf[1] == 0x4F && buf[2] == 0x49 && buf[3] == 0x54) {
+            // https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L1068
+            adb_host_flush(ADB_ADDR_MOUSE_TMP);
+            adb_host_listen(ADB_ADDR_MOUSE_TMP, ADB_REG_3, (reg3 >> 8), ADB_HANDLER_MACALLY2_MOUSE);
+            mouse_handler = (reg3 = adb_host_talk(ADB_ADDR_MOUSE_TMP, ADB_REG_3)) & 0xFF;
+            xprintf("MM: reg3:%04X\n", reg3);
+            dmprintf("Macally2: found: %02X\n", mouse_handler);
         } else {
             dmprintf("Unknown\n");
         }
@@ -350,6 +358,15 @@ void adb_mouse_task(void)
     //   b--: Button state.(0: on, 1: off)
     //   x--: X axis movement.
     //   y--: Y axis movement.
+    //
+    // Macally2
+    //
+    //   Byte 0: b00 y06 y05 y04 y03 y02 y01 y00
+    //   Byte 1: b01 x06 x05 x04 x03 x02 x01 x00
+    //   Byte 2: 1   0   0   0   1   0   0   0
+    //   Byte 3: 1   0   0   0   1   0   0   0
+    //
+    //   Byte 2 and 3 have no meaningful info.
     len = adb_host_talk_buf(ADB_ADDR_MOUSE_POLL, ADB_REG_0, buf, sizeof(buf));
 
     // If nothing received reset mouse acceleration, and quit.
@@ -357,7 +374,12 @@ void adb_mouse_task(void)
         mouseacc = 1;
         return;
     };
-    dmprintf("[%02X %02X %02X %02X %02X]\n", buf[0], buf[1], buf[2], buf[3], buf[4]);
+
+    dmprintf("[%02X %02X %02X %02X %02X] len:%02X\n", buf[0], buf[1], buf[2], buf[3], buf[4], len);
+    xprintf("MM:[ ");
+    for (uint8_t i = 0; i < len; i++)
+        xprintf("%02X ", buf[i]);
+    xprintf("] mh:%02X\n", mouse_handler);
 
     // Store off-buttons and 0-movements in unused bytes
     bool xneg = false;
@@ -365,17 +387,36 @@ void adb_mouse_task(void)
     if (len == 2) {
         if (buf[0] & 0x40) yneg = true;
         if (buf[1] & 0x40) xneg = true;
+    } else if (mouse_handler == ADB_HANDLER_MACALLY2_MOUSE) {
+        xprintf("MM: Macally2\n");
+        if (buf[0] & 0x40) yneg = true;
+        if (buf[1] & 0x40) xneg = true;
+        // Ignore Byte 2 and 3
+        len = 2;
     } else {
         if (buf[len - 1] & 0x40) yneg = true;
         if (buf[len - 1] & 0x04) xneg = true;
     }
 
+    // Make unused buf bytes compatible with Extended Mouse Protocol
     for (int8_t i = len; i < sizeof(buf); i++) {
         buf[i] = 0x88;
         if (yneg) buf[i] |= 0x70;
         if (xneg) buf[i] |= 0x07;
     }
 
+    if (mouse_handler == ADB_HANDLER_CLASSIC1_MOUSE ||
+        mouse_handler == ADB_HANDLER_CLASSIC2_MOUSE) {
+        // Some mouses misuse 'second button' bit we have to ignore it
+        // https://github.com/tmk/tmk_keyboard/issues/724
+        buf[1] |= 0x80;
+    }
+
+    xprintf("MM:[ ");
+    for (uint8_t i = 0; i < sizeof(buf); i++)
+        xprintf("%02X ", buf[i]);
+    xprintf("]\n");
+
     // 8 buttons at max
     // TODO: Fix HID report descriptor for mouse to support button6-8
     uint8_t buttons = 0;
diff --git a/tmk_core/protocol/adb.h b/tmk_core/protocol/adb.h
index 31c26fb9..578f9883 100644
--- a/tmk_core/protocol/adb.h
+++ b/tmk_core/protocol/adb.h
@@ -95,6 +95,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define ADB_HANDLER_CLASSIC2_MOUSE      0x02
 #define ADB_HANDLER_EXTENDED_MOUSE      0x04
 #define ADB_HANDLER_TURBO_MOUSE         0x32
+#define ADB_HANDLER_MACALLY2_MOUSE      0x42
 
 
 // ADB host
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index a314e5c7..af45afa6 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -120,7 +120,7 @@ static bool console_is_ready(void)
 {
     static bool hid_listen_ready = false;
     if (!hid_listen_ready) {
-        if (timer_read32() < 2500)
+        if (timer_read32() < 5000)
             return false;
         hid_listen_ready = true;
     }
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Wed, 30 March 2022, 03:57:36
So :

For the Macally Mouse, it works ! I have the two buttons, the cursor move, no problem.

For all the 3 devices with weird right clic, it works. No right clic when i press the main button. Thank's !

I join the Kensington Mouse logs (with 4 buttons).

I join the logs for the Keypad/Trackball too.
Actually, i have this Keypad + trackball and 2 others Keypad, and they are not working.

The trackpad "GlidePoint" make nothing on the logs.

And for the NeXT mouse, it's very weird : with this firmware, the mouse is not working (i have tried with the 470 ohm and the 4,7K ohm). It works with the precedent firmware (i join a log with the precedent firmware), but only with cold plug.

And finally, a things : the correction with the second button seems to break my Apple Pippin pad : there is a second button who send right clic, and now, it's disabled (i join the log)
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 30 March 2022, 10:10:40
Fix for Device 4, 5 and 7, these pointing devices will affect properly implemented devices like NeXT mosue and Pippin.
This fix makes second button disabled on NeXT and Pippin while some broken devices usable. This is tradeoff and I don't think we can take both. I think NeXT and Pippin can't register second button on Mac OS9. This Fix emulates behaviour of classic Mac OS9.

As for keypad, I don't have idea now. They don't seem to appear as a keyboard in the log. What if cold-plug with new firmware?

NeXT mouse fails to startup several times before it starts working.

Some device may require power voltage. Can you try shorter USB cable or powered hub for GlidPoint and NeXT?
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 30 March 2022, 11:21:51
Added code for Logitech device support.

Can you try attached firmware with these devices and take debug log?
- TrackMan: https://www.journaldulapin.com/2017/09/23/le-trackball-adb-de-logitech/
- MouseMan: https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/

Not supported yet but can you post debug log of Contour Mouse also?
- Contour Mouse: https://www.journaldulapin.com/2020/10/27/contour-mouse/

[attachurl=1]
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Wed, 30 March 2022, 16:48:36
For the NeXT mouse, it's weird : it works... after a few second. When i connect it, nothing appear, and after movements and clic, the mouse is working.

I'm not at home until monday, i will test all the things at that moment. Thank you !
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 30 March 2022, 21:55:59
In new firmware I added 5 second wait at startup temporarily to make sure the beginning of debug log shows up.
2.5 second wait works for Linux and Windows, but MacOS seems to require longer wait.

This 5 second wait may affect NexT mouse.


For the NeXT mouse, it's weird : it works... after a few second. When i connect it, nothing appear, and after movements and clic, the mouse is working.

I'm not at home until monday, i will test all the things at that moment. Thank you !

Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Fri, 01 April 2022, 15:31:34
Sorry if this is a silly question, I'm still trying to assimilate all the excellent information and resources here, but haven't read every one of the 1,148 posts in this thread. Does this converter work both ways, also allowing the use of USB keyboards (and mice?) with old ADB Macs? Thanks for any info!
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Fri, 01 April 2022, 16:13:56
@jzw95 the TMK ADB to USB adapter does just that ADB -> USB (using old mac peripherals on new usb computers)

if you want to go the other direction USB -> ADB, the wombat is what you're looking for. (using new peripherals on old macs)
https://www.bigmessowires.com/usb-wombat/
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 05 April 2022, 12:02:51
Added code for Logitech device support.

Can you try attached firmware with these devices and take debug log?
- TrackMan: https://www.journaldulapin.com/2017/09/23/le-trackball-adb-de-logitech/
- MouseMan: https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/

Not supported yet but can you post debug log of Contour Mouse also?
- Contour Mouse: https://www.journaldulapin.com/2020/10/27/contour-mouse/

(Attachment Link)

Hi, i'm back !

So :

- I have tried the TrackMan : the ball act as a mouse wheel for macOS, but when i press the button, i have now three time the button 1 (with the precedent firmware, the two right button act as keyboard key).

- I have tried the %ouse%an (three button) and it seems OK. I have the three button. Actually, the second button (middle) act as button 2 (seems logic) but it's weird for user : it's the right clic (aka the menu).

- For the Contour Mouse, it works. Actually, it seems to be hardware : the lef clic is a left clic, the middle clic is a "forced clic" (first press lock clic, second press release clic). The third button seems to reduce mouse sensitivity.

And i have tried another time the NeXT mouse. It works... but not all the time (and without the right clic). Is this possible to add a flag at compilation to have the choice (right clic or not) ? Or a white list with "right clic" enabled mouse ?



Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 06 April 2022, 01:08:02
- I have tried the TrackMan : the ball act as a mouse wheel for macOS, but when i press the button, i have now three time the button 1 (with the precedent firmware, the two right button act as keyboard key).
I think I could fix code for Logitech TrackMan in new attached firmware.


Quote
- I have tried the %ouse%an (three button) and it seems OK. I have the three button. Actually, the second button (middle) act as button 2 (seems logic) but it's weird for user : it's the right clic (aka the menu).
Interesting. This MouseMan speaks different protocol from the TrackMan. It seems Logitch used two different protocol for MouseMan(TrackMan) in those days. This  MouseMan is completely compatible with Apple Extended Mouse protocol.


As for its buttons I'll look into later.
Second(right) button of Macally mouse works as right button(context menu) currently, right?
Can you try the MouseMan on Windows or Linux to see how the buttons work?
Can you check if button configuration on MouseKey affects with the converter?
 https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/



Quote
- For the Contour Mouse, it works. Actually, it seems to be hardware : the lef clic is a left clic, the middle clic is a "forced clic" (first press lock clic, second press release clic). The third button seems to reduce mouse sensitivity.
It appears to be right behaviour  when the mouse works without driver.
I added Coutour support in new attached firmware, with this their buttons should work as normal 3-button mouse.


Quote
And i have tried another time the NeXT mouse. It works... but not all the time (and without the right clic). Is this possible to add a flag at compilation to have the choice (right clic or not) ? Or a white list with "right clic" enabled mouse ?

Yes, it is exactly what I plan. I'll add compile option in config.h.

Added delay to wait for changing address for NeXT mouse.



Can you try attached firmware with TrackMan, Contour and NeXT?

[attachurl=1]
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Thu, 07 April 2022, 12:31:58
I think I could fix code for Logitech TrackMan in new attached firmware.

Yep, it works. The Trackman works like a charm.

Quote
Interesting. This MouseMan speaks different protocol from the TrackMan. It seems Logitch used two different protocol for MouseMan(TrackMan) in those days. This  MouseMan is completely compatible with Apple Extended Mouse protocol.

As for its buttons I'll look into later.
Second(right) button of Macally mouse works as right button(context menu) currently, right?
Can you try the MouseMan on Windows or Linux to see how the buttons work?
Can you check if button configuration on MouseKey affects with the converter?
 https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/

Logitech use the classic protocol with many mouse (i have a wireless mouse with the same things).
The Macally right button act as right clic under macOS, yes.

I will try under Windows next week (actually, i have only Mac machine at home, and with virtual machine, i cannot use the adapter directly).

For the MouseKey driver, i do not understand : it will work only with the mouse connected with ADB. I cannot use it with the converter. I can try with a Mac, i must boot a Mac with USB to do that, i mean.

Quote
It appears to be right behaviour  when the mouse works without driver.
I added Coutour support in new attached firmware, with this their buttons should work as normal 3-button mouse.

It works. I have the three button and not the weird function.

Quote
Yes, it is exactly what I plan. I'll add compile option in config.h.

Added delay to wait for changing address for NeXT mouse.

It works with the NeXT mouse. With this firmware, i have connected the mouse and it works (hot plug).


Thank you for your work.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Thu, 07 April 2022, 13:40:02
About Mouse, too :

I have tested all my one button mice, and i have for mouse who will not work.

- A black M2706 will not work (my two other beige are working). But the logs see a mouse.
- A trackball from Elecom. It's recognised on the log, but with a "fail" message. (https://www.journaldulapin.com/2021/03/26/trackball-adb/)
- A very weird mouse. https://www.journaldulapin.com/2017/04/12/optical-usb-adb/ It's an optical USB mouse from Kensington with a USB (female) to ADB male adapter. It's a passive adapter, like PS/2 to USB. The mouse will not work (and the LED is off).
- An OEM mouse (from a StarMax clone) : nothing appear. The mouse is broken

The three first mouse are working with my iMate. The last one is different : it seems there is a problem with mouse, it will not work every time, even with iMate.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Fri, 08 April 2022, 11:13:56

Quote
Interesting. This MouseMan speaks different protocol from the TrackMan. It seems Logitch used two different protocol for MouseMan(TrackMan) in those days. This  MouseMan is completely compatible with Apple Extended Mouse protocol.

As for its buttons I'll look into later.
Second(right) button of Macally mouse works as right button(context menu) currently, right?
Can you try the MouseMan on Windows or Linux to see how the buttons work?
Can you check if button configuration on MouseKey affects with the converter?
 https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/

Logitech use the classic protocol with many mouse (i have a wireless mouse with the same things).
The Macally right button act as right clic under macOS, yes.

I will try under Windows next week (actually, i have only Mac machine at home, and with virtual machine, i cannot use the adapter directly).

For the MouseKey driver, i do not understand : it will work only with the mouse connected with ADB. I cannot use it with the converter. I can try with a Mac, i must boot a Mac with USB to do that, i mean.

Right, I meant button configuration with Mousekey on old Mac and wanted to know whether the button configuration is stored on device or not. But this is not related probably, disregard this.

Does this wireless MouseMan register middle and right button correctly?
I want to check debug log for this too.
https://www.journaldulapin.com/2015/12/11/souris-logitech-sans-fil/




Quote
Quote
Yes, it is exactly what I plan. I'll add compile option in config.h.

Added delay to wait for changing address for NeXT mouse.

It works with the NeXT mouse. With this firmware, i have connected the mouse and it works (hot plug).

hmm, it looks better than before, but NeXT mouse still needs more delay.
It takes longer to process commands than other devices, perhaps.



Fixed button mapping for TrackMan and added delay for NeXT Mouse.
Can you try TrackMan, wireless MouseMan and NeXT with attached firmware?

[attachurl=1] (TMK:d477af/LUFA:d6a7df)

Thanks
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Fri, 08 April 2022, 11:25:14
About Mouse, too :

I have tested all my one button mice, and i have for mouse who will not work.

- A black M2706 will not work (my two other beige are working). But the logs see a mouse.
- A trackball from Elecom. It's recognised on the log, but with a "fail" message. (https://www.journaldulapin.com/2021/03/26/trackball-adb/)
- A very weird mouse. https://www.journaldulapin.com/2017/04/12/optical-usb-adb/ It's an optical USB mouse from Kensington with a USB (female) to ADB male adapter. It's a passive adapter, like PS/2 to USB. The mouse will not work (and the LED is off).
- An OEM mouse (from a StarMax clone) : nothing appear. The mouse is broken

The three first mouse are working with my iMate. The last one is different : it seems there is a problem with mouse, it will not work every time, even with iMate.

Try new firmware.
Elecom one seems to fail just like NeXT. New firmware may work with it.

Optical mouse doesn't get enough power, perhaps?
Try powered hub and short USB cable.
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Fri, 08 April 2022, 15:51:15
@jzw95 the TMK ADB to USB adapter does just that ADB -> USB (using old mac peripherals on new usb computers)

if you want to go the other direction USB -> ADB, the wombat is what you're looking for. (using new peripherals on old macs)
https://www.bigmessowires.com/usb-wombat/

@nevin, thanks for the confirmation, this is what I suspected. I think I might still go for the TMK ADB to USB adapter, as currently I only need to use old ADB keyboards with a modern Mac. But good to know the limitations in the future as I can see wanting to do the reverse at some point too.  :)
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sat, 09 April 2022, 12:39:07

Try new firmware.
Elecom one seems to fail just like NeXT. New firmware may work with it.

Optical mouse doesn't get enough power, perhaps?
Try powered hub and short USB cable.

-> The optical mouse will not work. Sometimes, the LED is on, but not all the time. And i have nothing on the log. I test on a Thunderbolt dock with a short cable.

-> The Elecom trackball fail every time.

-> The NeXT Mouse seems to work.

-> The Logitech wireless mouse is working like the wired. The three button are working.

-> The Trackman trackball is working with this firmware, and the right button is on the right.

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sat, 09 April 2022, 12:45:08
And today, i have tried a thing : I have connected many two button ADB mouse on a Power Mac G3 under Mac OS X (the Blue G3 has a native ADB port).

And the result is interessant : the mouse with native right clic (NeXT and Pippin) don't make a right clic (i have only the left clic).
But the three mouse with the extended protocol (the two Logitech and the Kensington) are making a right clic. It seems that Mac OS X (Tiger, here) can handle the extended protocol. And it's like with your adapter : the right clic is on the "button 2", aka middle button on the Logitech mouse.

The code for the driver seems to be open source, on Tiger : https://opensource.apple.com/releases/ (AppleADBMouse)
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Sat, 09 April 2022, 13:56:16
yeah, all of the adb mice were from the Classic Mac OS era (up to OS 9).
might be able to run them under OSX, but would probably require an extension (version of extension may change depending on what version of OSX because there were a lot of code language changes through OSX's evolution).

you might be able to find old OSX extensions of those particular mice online (there are a couple sites for old 68k software)
i have a ton of old mac addict cd's from that era that had old software, etc. on them. i could probably search through them if i knew brand - model of the mice in question.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sat, 09 April 2022, 23:04:16

Try new firmware.
Elecom one seems to fail just like NeXT. New firmware may work with it.

Optical mouse doesn't get enough power, perhaps?
Try powered hub and short USB cable.

-> The optical mouse will not work. Sometimes, the LED is on, but not all the time. And i have nothing on the log. I test on a Thunderbolt dock with a short cable.


You still have 470(or 1k) ohm pull-up resistor on the converter, right?
Try it on other Windows or Linux computer to see if there is diferrence.

Seeing behaviour of the LED I would still suspect voltage of power line.
Check voltage between VCC and GND at ADB connector with Multimeter.

But converter firmware can still causes this problem.
We probably need to look into low level things. If you have oscilloscope or logic analzyer see singals on data line.

Concerns:
* hardware: power line(votage drop)
* hardware: data line drive capability
  I found that iMate connects four I/O ports of MCU to data line. I think they are intended to augment line drive(sink) capability(12mA * 4). TMK converter sink capability may be weak(20mA) in some situations.
* firmware: low level signal processing code
  current implementation may be too optimistic to support irregular or severe timing signals.




Quote
-> The Elecom trackball fail every time.

This doesn't seem to support second address change for some reason. Current converter implementation require 2-time address change to support hot-plug. The conveter can't work with this device probably.



Quote
-> The NeXT Mouse seems to work.
hmm, it still fails. It may require more time.


Quote
-> The Logitech wireless mouse is working like the wired. The three button are working.
You mean middle and right button work correctly?



Quote
-> The Trackman trackball is working with this firmware, and the right button is on the right.
So, middle and right button work correctly now?
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 10 April 2022, 01:00:42
And today, i have tried a thing : I have connected many two button ADB mouse on a Power Mac G3 under Mac OS X (the Blue G3 has a native ADB port).

And the result is interessant : the mouse with native right clic (NeXT and Pippin) don't make a right clic (i have only the left clic).
But the three mouse with the extended protocol (the two Logitech and the Kensington) are making a right clic. It seems that Mac OS X (Tiger, here) can handle the extended protocol. And it's like with your adapter : the right clic is on the "button 2", aka middle button on the Logitech mouse.

OSX just ignore second(right) button with 'Classic' mouses for some reason. Weird 2-buttons mouses could work on the old Mac due to this.

With 'Extended' mouses OSX seems to map second button to right click and third button to middle click by default according to source codes.
I guess this should work for most mouses but right and middle button swap can happen for some, perhaps.

The converter should/can emulate this behaviour at expense of NeXT mouse and Pippin right click.


Did the Logitech devices(MouseMan and MouseMan Cordless) register middle and right button correctly on PowerMac?

And how four buttons of Kensington thinking mouse are mapped? which one is middle click in perticular?


 
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 10 April 2022, 04:47:39
You still have 470(or 1k) ohm pull-up resistor on the converter, right?
Try it on other Windows or Linux computer to see if there is diferrence.

Seeing behaviour of the LED I would still suspect voltage of power line.
Check voltage between VCC and GND at ADB connector with Multimeter.

But converter firmware can still causes this problem.
We probably need to look into low level things. If you have oscilloscope or logic analzyer see singals on data line.

Concerns:
* hardware: power line(votage drop)
* hardware: data line drive capability
  I found that iMate connects four I/O ports of MCU to data line. I think they are intended to augment line drive(sink) capability(12mA * 4). TMK converter sink capability may be weak(20mA) in some situations.
* firmware: low level signal processing code
  current implementation may be too optimistic to support irregular or severe timing signals.

I have not an analyzer, sorry. But yes, i have the resistor (4,7K actually).

Quote
This doesn't seem to support second address change for some reason. Current converter implementation require 2-time address change to support hot-plug. The conveter can't work with this device probably.

OK.

Quote
-> The Logitech wireless mouse is working like the wired. The three button are working.

So, middle and right button work correctly now?

Yep. To be exact :

left clic (on the mouse) is left clic (button 1). middle clic (on the mouse) is right clic (button 2). right clic (on the mouse) is button 3.

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 10 April 2022, 04:51:11

OSX just ignore second(right) button with 'Classic' mouses for some reason. Weird 2-buttons mouses could work on the old Mac due to this.

With 'Extended' mouses OSX seems to map second button to right click and third button to middle click by default according to source codes.
I guess this should work for most mouses but right and middle button swap can happen for some, perhaps.

The converter should/can emulate this behaviour at expense of NeXT mouse and Pippin right click.


Did the Logitech devices(MouseMan and MouseMan Cordless) register middle and right button correctly on PowerMac?

And how four buttons of Kensington thinking mouse are mapped? which one is middle click in perticular?

I don't know how to check middle clic on old Mac OS X, but i suppose it works, because right clic is working (i have the contextual menu).

For the Kensington mouse, there is two row of mouse button. Upper left is button 1 (left), upper right is button (right), bottom left is button 3 and bottom right is button 4 (the button you have mapped to emulate a mouse wheel).
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 10 April 2022, 07:14:07
You still have 470(or 1k) ohm pull-up resistor on the converter, right?
Try it on other Windows or Linux computer to see if there is diferrence.

Seeing behaviour of the LED I would still suspect voltage of power line.
Check voltage between VCC and GND at ADB connector with Multimeter.

But converter firmware can still causes this problem.
We probably need to look into low level things. If you have oscilloscope or logic analzyer see singals on data line.

Concerns:
* hardware: power line(votage drop)
* hardware: data line drive capability
  I found that iMate connects four I/O ports of MCU to data line. I think they are intended to augment line drive(sink) capability(12mA * 4). TMK converter sink capability may be weak(20mA) in some situations.
* firmware: low level signal processing code
  current implementation may be too optimistic to support irregular or severe timing signals.

I have not an analyzer, sorry. But yes, i have the resistor (4,7K actually).

iMate uses 470 ohm pull-up register as said before. And my TMK ADB-USB converter uses 1K.
This is different from your converter. 1K or 470 ohm pull-up resistor is preferable.



Quote
Quote
-> The Logitech wireless mouse is working like the wired. The three button are working.

So, middle and right button work correctly now?

Yep. To be exact :

left clic (on the mouse) is left clic (button 1). middle clic (on the mouse) is right clic (button 2). right clic (on the mouse) is button 3.

I see. This is not useful for users. Now I will fix button maping for Logitech Mouseman in new firmware.




OSX just ignore second(right) button with 'Classic' mouses for some reason. Weird 2-buttons mouses could work on the old Mac due to this.

With 'Extended' mouses OSX seems to map second button to right click and third button to middle click by default according to source codes.
I guess this should work for most mouses but right and middle button swap can happen for some, perhaps.

The converter should/can emulate this behaviour at expense of NeXT mouse and Pippin right click.


Did the Logitech devices(MouseMan and MouseMan Cordless) register middle and right button correctly on PowerMac?

And how four buttons of Kensington thinking mouse are mapped? which one is middle click in perticular?

I don't know how to check middle clic on old Mac OS X, but i suppose it works, because right clic is working (i have the contextual menu).

For the Kensington mouse, there is two row of mouse button. Upper left is button 1 (left), upper right is button (right), bottom left is button 3 and bottom right is button 4 (the button you have mapped to emulate a mouse wheel).

Kinsington mouse buttons seem to work correctly.




Please test Logitech MouseMan(Wired), MouseMan Cordless and TrackMan with attached firmware.
Middle button should work as middle button, and right button should work as right button now.


[attachurl=1]
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Sun, 10 April 2022, 11:22:20
So with the last firmware :

The right button is a right clic with the three Logitech mouse, and the middle clic is a button 3 clic (middle clic, i mean). It seems OK.

I have replaced the 4,7K ohm resistor with a 470 ohm resistor, and the NeXT mouse will not work every time with that (i will try tomorrow with a 1K ohm). When i "hot" plug the mouse (i connect USB, and afer that, i insert ADB), it will not work. When i cold plug (connect ADB, and then connect USB), it will work, but not all the time.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Sun, 10 April 2022, 12:12:20
also, if we are starting to look at possible hardware issues. first thing i would check in the mice that are dead/unresponsive is the capacitors. they are usually the first thing to go in old electronics. there have been a lot of old model-m keyboards that have been brought back to life by replacing the bad capacitors.

here's some ways to test
https://smtinsight.com/how-to-test-a-capacitor-with-a-multimeter/
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Sun, 10 April 2022, 14:59:59
Regarding the 1k ohm resistor when building the converter: what power rating does it need to support? I gather that the version of USB being used supports up to 2.5W (500mA * 5V), but I don't think the pull-up resistor needs to support that much. But maybe I'm misunderstanding things and it does? I want to make sure I don't buy a resistor with insufficient power rating.

Also, I see that in the Wiring instructions (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb#wiring) for the converter, it states:

Quote
This is not needed but you can connect PSW to PD1 optionally.

Does connecting PSW to PD1 enable any extra functionality or make any difference?

Thanks!
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Sun, 10 April 2022, 17:21:06
resistor... common 1/4 watt are fine and what you'll find most everywhere.

Quote
Does connecting PSW to PD1 enable any extra functionality or make any difference?
not sure. @hasu?
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 10 April 2022, 18:27:22
resistor... common 1/4 watt are fine and what you'll find most everywhere.

Quote
Does connecting PSW to PD1 enable any extra functionality or make any difference?
not sure. @hasu?

Yes 1/4 watt is enough.
We can use simple application Ohm's law here.

Current flow of pull-up resistor is:
5V/1K ohm = 5mA
5V/470 ohm = 0.010638297872340425A

Power dissipation:
5V * 5mA = 25mW for 1K
0.010638297872340425*5 = 0.05319148936170213W = 53mW for 470

So I think 1/10, 1/8 and 1/6W even work.
I'm not an expert and this calculation may be too naive for actual world.



As for PSW  it works for nothing with the current converter firmware actually. No difference even if you connect the pin.
The pin is drived to low when pressing Power key and it was used to power-up computer in classic Mac era.

Power key can be recognized with only DATA pin as long as keyboard gets powered.
Also note that you can wake-up computer from USB sleep by any key(including Power key) without PSW pin.

In the result you don't have to connect PSW pin. I don't have any idea/plan on use of the pin at this time.


EDIT: I updated the first post for pull-up and PSW.
Check this also for details. https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#pull-up-resistor
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sun, 10 April 2022, 20:46:42
So with the last firmware :

The right button is a right clic with the three Logitech mouse, and the middle clic is a button 3 clic (middle clic, i mean). It seems OK.

I have replaced the 4,7K ohm resistor with a 470 ohm resistor, and the NeXT mouse will not work every time with that (i will try tomorrow with a 1K ohm). When i "hot" plug the mouse (i connect USB, and afer that, i insert ADB), it will not work. When i cold plug (connect ADB, and then connect USB), it will work, but not all the time.

Great! Thanks for the test.

I added specific driver code to converter firmware for the two MouseMan, they are not completely compatible with Apple Extended Mouse protocol for some reason.
Without Logitech driver users would get swapped middle and right button on old OSX,  this was not useful. (This is what you observed on Tiger and apple source code indicates.)



I'll clean the code and make new release of firmware soon.
Let me know if you find incorrect button mapping on other 3-button mouses.




Multi-button pointing devices below are supported now.
https://github.com/tmk/tmk_keyboard/issues/725

Confirmed device/protocols:
- Kensington Turbo Mouse 5   
- Kensington Thinking Mouse   
- Macally 2-button Mouse   
- Logitech TrackMan/MouseMan(Prorietary)   
- Logitech TrackMan/MouseMan(Extended)   
- Contour Design Countour Mouse   

Not confirmed yet. We need to work on especially button mapping.
- Microspeed MacTrac   
- Mouse Systems A3 Mouse/Trackball   
- CH Products Trackball Pro/DT225   


2-button mouse should work as it works on OSX now.
Left button should work as leftt click while right button depneds on specific device.
Some will work as click-lock(drag), other duble-click or triple-click. Even right button may do nothing like NeXT Mouse.
https://github.com/tmk/tmk_keyboard/issues/724
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Mon, 11 April 2022, 05:11:04
I was just saying 1/4w are probably the most common / easiest to find.

Thanks for the explanation on PSW to PD1. I didn't know that's what that was supposed to do but i do know what you're talking about.
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Mon, 11 April 2022, 08:08:53
Thanks @nevin & @hasu for the details and confirmation regarding the resistor. I was hoping I could get away with 1/4W.  ;D

Interesting, also, about the PSW pin. I suppose it's only useful if doing a converter the other way (allowing USB keyboards to be used with old ADB Macs – the early Apple USB keyboards had a power button). I'm still debating whether I connect it just to be a "completionist", but we'll see…

Thanks all, this is a great project.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Mon, 11 April 2022, 08:22:05
the old PPC iMacs, and a bunch of the towers from that time that were usb also worked that way with a power button on the keyboard. (graphite, blue & white, etc.) it more depended on the keyboard you were using than the tower.

the power button was removed on the apple pro keyboard and has been missing since then. (year: 2000-ish)

[attach=1]
from: https://en.wikipedia.org/wiki/Apple_keyboards#Apple_USB_Keyboard_(M2452)
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 12 April 2022, 20:23:23
[FIRMWARE UPDATE]
Updated converter firmware and you can get it from Keymap Editor or github repo.

http://www.tmk-kbd.com/tmk_keyboard/editor/
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/binary


* Change default setting for mouse
- Disable mouse scroll wheel emulation by default
- Disable mouse acceleration by default
- Disable 16-bit USB HID mouse report by default
You can still re-enable these features by editing in config.h or Makefile.


* Multi-button pointing devices below are supported now
https://github.com/tmk/tmk_keyboard/issues/725

Confirmed:
- Kensington Turbo Mouse 5   
- Kensington Thinking Mouse   
- Macally 2-button Mouse   
- Logitech TrackMan/MouseMan(Prorietary)   
- Logitech TrackMan/MouseMan(Extended)   
- Contour Design Countour Mouse   

Not confirmed yet:
- Microspeed MacTrac   
- Mouse Systems A3 Mouse/Trackball   
- CH Products Trackball Pro/DT225   


* 2-button mouse should work as it works on Mac OS9/OSX now
Left button should work as leftt click while right button depneds on specific device.
Some will work as click-lock(drag), other duble-click or triple-click. Even right button may do nothing like NeXT Mouse.
https://github.com/tmk/tmk_keyboard/issues/724


Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Tue, 12 April 2022, 23:14:01
thank you both for all your work on this.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Wed, 13 April 2022, 11:28:24
Thank you Hasu !
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Wed, 13 April 2022, 11:46:19
I have tested a second batch of peripherals : keyboard

• First, Keypad. I have four keypad and none of them will work. I have light (like num. key LED), but nothing on the logs. I suppose that there is a trick or a specific things for that.


• I have tried many keyboard without problem, and five with different problems.

-> The Pioneer KB2 (https://www.journaldulapin.com/2019/03/07/un-clavier-de-pioneer-mpc-pour-mac/) from a Pioneer clone. I have a fail into the logs, and that's all.
-> A Macally MK105X, used with many clone from Motorola, Power Computing, etc. Same thing.

-> An Apple Keyboard II, japanese layout. I'm not sure if i have a problem or if it's a feature : many key are not working on my Mac. The adapter receive a code, but i have nothing on my Mac Is this a problem with the layout ? There is a ₯ key, the enter key at the right of space, etc. And on this keyboard, the left alt key is "altRight". But i have a french Mac, with european french layout used.

-> The NeXT ADB Keyboard. All the key are working except the 5 media key. There is key for sound (nothing appear on log), a power key (nothing on log) and two brightness key. The brightness "up" do nothing, but the "down" send PageDown.

-> An AlphaSmart 2000. It's a word processor with ADB, who can act like a keyboard. https://www.journaldulapin.com/2018/03/07/alphasmart-adb/ Actually, the AlphaSmart detect the Mac but the logs don't see it. When the word processor is connected, i can use it as a Keyboard, and press a key to send the text i have written to the Mac. When i have write about it in 2018, it has work with your adapter (but it was an old firmware).

And i have two questions. Why is there many keyboard who send "leftShift" for the two shift key, and other keyboard who send left and right (different). Is there a logic, a specific thing ?
And i have tested the Adjustable Keyboard. The "mic" key send a thing, but what ? When i press the key, it cut the audio.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Wed, 13 April 2022, 13:26:02
media keys... it's a known thing. same with apple adjustable keyboard. (send different codes/etc. then what's part of the matrix? is this correct hasu?)

left/right.... at least a lot of apple boards did not differentiate electronically between left & right... shift, command, option, etc. (they were physically two switches in the same spot in the key matrix)
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Wed, 13 April 2022, 13:32:23
also, can we see a pile of all your peripherals?
it has to be almost a mountain.

to be honest... little jealous about the next keyboard.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 13 April 2022, 19:00:29
I have tested a second batch of peripherals : keyboard

• First, Keypad. I have four keypad and none of them will work. I have light (like num. key LED), but nothing on the logs. I suppose that there is a trick or a specific things for that.
You  see 'R' , 'S', 's', or other charactors on hid_listen when hot-plug the keypads *several times*? Or really nothing? They work with iMate, right?

I think keypad  consists of usual 'keyboard' and 'mouse' in terms of ADB protocol, I guess no 'trick' is required.

First try 1k ohm pull-up and then 470 ohm if 1k doesn't work.
Also try on Windows or Linux.

Let me know more info about the keypads like product name or FCC ID. It would be helpful if you can find manual or other documents in the net.


Quote
• I have tried many keyboard without problem, and five with different problems.

-> The Pioneer KB2 (https://www.journaldulapin.com/2019/03/07/un-clavier-de-pioneer-mpc-pour-mac/) from a Pioneer clone. I have a fail into the logs, and that's all.
-> A Macally MK105X, used with many clone from Motorola, Power Computing, etc. Same thing.
I'll look into this problem later.


Quote
-> An Apple Keyboard II, japanese layout. I'm not sure if i have a problem or if it's a feature : many key are not working on my Mac. The adapter receive a code, but i have nothing on my Mac Is this a problem with the layout ? There is a ₯ key, the enter key at the right of space, etc. And on this keyboard, the left alt key is "altRight". But i have a french Mac, with european french layout used.
Japanese specific keys will be recognzied if you select Japanese layout on your OS, or you can remap the keys on Keymap Editor.
How do the keys work with iMate?



Quote
-> The NeXT ADB Keyboard. All the key are working except the 5 media key. There is key for sound (nothing appear on log), a power key (nothing on log) and two brightness key. The brightness "up" do nothing, but the "down" send PageDown.
Log is needed for the keys and startup.
Media keys on Apple Adjustable Keyboard are supported but NeXT may require other code.



Quote
-> An AlphaSmart 2000. It's a word processor with ADB, who can act like a keyboard. https://www.journaldulapin.com/2018/03/07/alphasmart-adb/ Actually, the AlphaSmart detect the Mac but the logs don't see it. When the word processor is connected, i can use it as a Keyboard, and press a key to send the text i have written to the Mac. When i have write about it in 2018, it has work with your adapter (but it was an old firmware).
Try and see if this firmware from Jan, 2018 works if the firmware worked before.
https://github.com/tmk/tmk_keyboard/tree/14e9a84c9c3b571cc932fcaaedbdb9354dbc2697/converter/adb_usb/binary



Quote
And i have two questions. Why is there many keyboard who send "leftShift" for the two shift key, and other keyboard who send left and right (different). Is there a logic, a specific thing ?
And i have tested the Adjustable Keyboard. The "mic" key send a thing, but what ? When i press the key, it cut the audio.
You mean Left shift key both left and right shift at same time? That is weird and interesting. The converter doesn't anything like that for shift keys.
I guess keyboards do that. What are name of the keyboards exactly?

Extended keyboard(M0115/M3501) and compatibles can send correct left and right shift respectively.  While standard keyboard(M0116) sends only Left shift.See the first post.

Mic key sends 'Play/Pause' on Adjustable Keyboard.

Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Wed, 13 April 2022, 22:34:46
Quote
Mic key sends 'Play/Pause' on Adjustable Keyboard.

apologies, been a LONG time since i updated what's running on the converter.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Mon, 18 April 2022, 10:42:29
also, can we see a pile of all your peripherals?
it has to be almost a mountain.

to be honest... little jealous about the next keyboard.

I have many photos on my website : https://www.journaldulapin.com/tag/adb/
 
I have collected a lot if things since ~10 years.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Mon, 18 April 2022, 11:28:34
You  see 'R' , 'S', 's', or other charactors on hid_listen when hot-plug the keypads *several times*? Or really nothing? They work with iMate, right?

I think keypad  consists of usual 'keyboard' and 'mouse' in terms of ADB protocol, I guess no 'trick' is required.

First try 1k ohm pull-up and then 470 ohm if 1k doesn't work.
Also try on Windows or Linux.

Let me know more info about the keypads like product name or FCC ID. It would be helpful if you can find manual or other documents in the net.

I have tried with the 470 ohm resistor.

I have nothing on the logs. The first one turn on (there is LED), the second is working, but only the trackball side, the last is turning on, and that's all.
And yep, they are working with iMate.

First one : NT-MAC2ST by Sanwa Supply. A basic keypad, with an female ADB to chain.
Second : Scorpius 19ADB, FCCID : F2QKPT19ADB. This one contain a trackball and ADB female.
Three : Model 9602, FCCID : FTR9602. This one is a keypad and a calculator, with a little display. And a cool things : it's possible to make a operation and paste the result to the Mac.

Quote
Japanese specific keys will be recognzied if you select Japanese layout on your OS, or you can remap the keys on Keymap Editor.
How do the keys work with iMate?

I have tried with the layout (with macOS) and i have nothing (event with the iMate). The keyboard send the code, but i have nothing on screen (and nothing on my HID software).

For the "RightAlt", it's very weird : with your adapter, the left option key (it's the only option key on this keyboard) send "RightAlt". And with the iMate, it sends "LeftAlt".

Actually, i join the logs with the 4 keys who are "not working".

Quote
Log is needed for the keys and startup.
Media keys on Apple Adjustable Keyboard are supported but NeXT may require other code.

The power key are not on the log (nothing appear).

The Down Brightness send 79FF F9FF
The Up Brightness send 74FF F4FF (but i must press very strong, i think i must clean the keyboard)
The Up Volume send 73FF F3FF (Home), like the precedent (i must press very strong).

Actually, it will be a hardware problem, i will try to clean the keyboard.
 
Quote
Try and see if this firmware from Jan, 2018 works if the firmware worked before.
https://github.com/tmk/tmk_keyboard/tree/14e9a84c9c3b571cc932fcaaedbdb9354dbc2697/converter/adb_usb/binary

I have tried with the old firmware, it works. I have used the AlphaSmart as a keyboard, and i can send text for the word processor to the Mac.

Quote
You mean Left shift key both left and right shift at same time? That is weird and interesting. The converter doesn't anything like that for shift keys.
I guess keyboards do that. What are name of the keyboards exactly?

Extended keyboard(M0115/M3501) and compatibles can send correct left and right shift respectively.  While standard keyboard(M0116) sends only Left shift.See the first post.

Mic key sends 'Play/Pause' on Adjustable Keyboard.

No, i mean that the keyboard send leftshift for the lef shift, and rightshift for the right key. 
OK, its the problem in the first post : i suppose the NeXT keyboard is extended and send the correct key.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Mon, 18 April 2022, 13:09:57
on the apple adjustable keyboard
- if you have to press the media keys hard to get them to register, the little tact switches are shot & need replaced.
what happens is the tiny dome that's in the switch gets squashed and no longer makes contact like it's supposed to.
see attached pic form the deskthority wiki
[attach=1]

Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Mon, 18 April 2022, 19:57:54
You  see 'R' , 'S', 's', or other charactors on hid_listen when hot-plug the keypads *several times*? Or really nothing? They work with iMate, right?

I think keypad  consists of usual 'keyboard' and 'mouse' in terms of ADB protocol, I guess no 'trick' is required.

First try 1k ohm pull-up and then 470 ohm if 1k doesn't work.
Also try on Windows or Linux.

Let me know more info about the keypads like product name or FCC ID. It would be helpful if you can find manual or other documents in the net.

I have tried with the 470 ohm resistor.

I have nothing on the logs. The first one turn on (there is LED), the second is working, but only the trackball side, the last is turning on, and that's all.
And yep, they are working with iMate.

First one : NT-MAC2ST by Sanwa Supply. A basic keypad, with an female ADB to chain.
Second : Scorpius 19ADB, FCCID : F2QKPT19ADB. This one contain a trackball and ADB female.
Three : Model 9602, FCCID : FTR9602. This one is a keypad and a calculator, with a little display. And a cool things : it's possible to make a operation and paste the result to the Mac.

I couldn't find info much about those keypads in the net. I think you said you have four keypads, is there any info of fourth one?

I've never found documentation or code that indicates keypads require special handling, but I may miss something.

Can you try old firmware as AlphaSmart to see difference?





Quote
Quote
Japanese specific keys will be recognzied if you select Japanese layout on your OS, or you can remap the keys on Keymap Editor.
How do the keys work with iMate?

I have tried with the layout (with macOS) and i have nothing (event with the iMate). The keyboard send the code, but i have nothing on screen (and nothing on my HID software).

For the "RightAlt", it's very weird : with your adapter, the left option key (it's the only option key on this keyboard) send "RightAlt". And with the iMate, it sends "LeftAlt".

Actually, i join the logs with the 4 keys who are "not working".

I found that those Japanese keys are recognized by converter firmware but not completely supported in current implementation. I'll update firmware to support the Japanese keys. It seems that anyone including me didn't test with Japanese keyboard so far.

Can you share model name and pic of your keyboard to check its key layout?

As for the Left option key,
That keyboard is an Extended keyboard(the log indicates) and iMate doesn't support Extended mode(only Classic mode), the difference comes from there. I think the keyboard sends the key like that in Extended mode for some reason.

hmm,
The keyboard expects to be handled as a Classic keyboard, though it supports Extended mode?
OSX seems to handle third parties in Classic mode. I will try to emulate the OSX way.

https://github.com/apple-oss-distributions/AppleADBKeyboard/blob/AppleADBKeyboard-239.1/AppleADBKeyboard.cpp#L464-L480



Quote
Quote
Log is needed for the keys and startup.
Media keys on Apple Adjustable Keyboard are supported but NeXT may require other code.

The power key are not on the log (nothing appear).

The Down Brightness send 79FF F9FF
The Up Brightness send 74FF F4FF (but i must press very strong, i think i must clean the keyboard)
The Up Volume send 73FF F3FF (Home), like the precedent (i must press very strong).

Actually, it will be a hardware problem, i will try to clean the keyboard.

NeXT ADB keyboard was designed for NeXT computer and not for Apple Mac, so not compatible completely for Apple ADB. Those scan codes are PageDown, PageUp and Home respectively, but somewhat reasonable for position of the keys.

The converter works as expected there. You can remap the keys if you want.

Let me know if Power key sends nothing after cleaning.
EDIT: NeXT Power key doesn't register scan code. https://geekhack.org/index.php?topic=14290.msg2998949#msg2998949

In that case it will need firmware chage to see PSW pin directly on ADB signal. But your converter hardware(ADBUSB-0x1) doesn't have connection for PSW unfortunately, you will need to solder.

On Apple ADB keyboards Power key sends scan code '7F' and it doesn't require PSW.



Quote

Quote
Try and see if this firmware from Jan, 2018 works if the firmware worked before.
https://github.com/tmk/tmk_keyboard/tree/14e9a84c9c3b571cc932fcaaedbdb9354dbc2697/converter/adb_usb/binary

I have tried with the old firmware, it works. I have used the AlphaSmart as a keyboard, and i can send text for the word processor to the Mac.

Interesting. I'll look into difference between current implementation and old one.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 19 April 2022, 12:01:35
I couldn't find info much about those keypads in the net. I think you said you have four keypads, is there any info of fourth one?

I've never found documentation or code that indicates keypads require special handling, but I may miss something.

Can you try old firmware as AlphaSmart to see difference?

The fourth one is a KeyPad for Pippin, i will try to test it this week.
I have tried with the old firmware, and i have nothing (but they turn on).

I have tested on my Mac (G3) with an ADB parser soft, and i don't see a specific things.

Quote
I found that those Japanese keys are recognized by converter firmware but not completely supported in current implementation. I'll update firmware to support the Japanese keys. It seems that anyone including me didn't test with Japanese keyboard so far.

Can you share model name and pic of your keyboard to check its key layout?

As for the Left option key,
That keyboard is an Extended keyboard(the log indicates) and iMate doesn't support Extended mode(only Classic mode), the difference comes from there. I think the keyboard sends the key like that in Extended mode for some reason.

hmm,
The keyboard expects to be handled as a Classic keyboard, though it supports Extended mode?
OSX seems to handle third parties in Classic mode. I will try to emulate the OSX way.

https://github.com/apple-oss-distributions/AppleADBKeyboard/blob/AppleADBKeyboard-239.1/AppleADBKeyboard.cpp#L464-L480

It's a Apple Keyboard II, M0487 (FCCID : BCGM0487)
I join a photo.

Quote
NeXT ADB keyboard was designed for NeXT computer and not for Apple Mac, so not compatible completely for Apple ADB. Those scan codes are PageDown, PageUp and Home respectively, but somewhat reasonable for position of the keys.

The converter works as expected there. You can remap the keys if you want.

Let me know if Power key sends nothing after cleaning.
EDIT: NeXT Power key doesn't register scan code. https://geekhack.org/index.php?topic=14290.msg2998949#msg2998949

In that case it will need firmware chage to see PSW pin directly on ADB signal. But your converter hardware(ADBUSB-0x1) doesn't have connection for PSW unfortunately, you will need to solder.

On Apple ADB keyboards Power key sends scan code '7F' and it doesn't require PSW.

OK, i will try to clean up the inside, first.

Quote

Interesting. I'll look into difference between current implementation and old one.

It's a very weird keyboard, by the way. But it works with a real Mac, as a keyboard.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 19 April 2022, 22:25:37
I couldn't find info much about those keypads in the net. I think you said you have four keypads, is there any info of fourth one?

I've never found documentation or code that indicates keypads require special handling, but I may miss something.

Can you try old firmware as AlphaSmart to see difference?

The fourth one is a KeyPad for Pippin, i will try to test it this week.
I have tried with the old firmware, and i have nothing (but they turn on).

I have tested on my Mac (G3) with an ADB parser soft, and i don't see a specific things.

I'll have to get one of keypads to check in hand if we can't find any clue.
It is not so difficult to find cheap ADB keypad.


Quote
Quote
I found that those Japanese keys are recognized by converter firmware but not completely supported in current implementation. I'll update firmware to support the Japanese keys. It seems that anyone including me didn't test with Japanese keyboard so far.

Can you share model name and pic of your keyboard to check its key layout?

As for the Left option key,
That keyboard is an Extended keyboard(the log indicates) and iMate doesn't support Extended mode(only Classic mode), the difference comes from there. I think the keyboard sends the key like that in Extended mode for some reason.

hmm,
The keyboard expects to be handled as a Classic keyboard, though it supports Extended mode?
OSX seems to handle third parties in Classic mode. I will try to emulate the OSX way.

https://github.com/apple-oss-distributions/AppleADBKeyboard/blob/AppleADBKeyboard-239.1/AppleADBKeyboard.cpp#L464-L480

It's a Apple Keyboard II, M0487 (FCCID : BCGM0487)
I join a photo.

Can you check if these scan codes are correct for M0487?  Especially Japanese keys( JPY, RO, EIS, KAN).
Also let me know scan code for ](left to Return) and , (on keypad).


Quote

                   ,--------.
                   |  Power |
                   `--------'
,-----------------------------------------------------------.  ,---------------.
|Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Del|  |Clr|  =|  /|  *|
|-----------------------------------------------------------|  |---------------|
|Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [|     |  |  7|  8|  9|  +|
|------------------------------------------------------`    |  |---------------|
|Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|Retn|  |  4|  5|  6|  -|
|-----------------------------------------------------------|  |---------------|
|Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /| RO| Shift|  |  1|  2|  3|   |
|-----------------------------------------------------------|  |-----------|Ent|
|Cap| Opt | Cmd  |EIS|    Space         |KAN|Lef|Rig|Dow|Up |  |  0|  ,|  .|   |
`-----------------------------------------------------------'  `---------------'
           
                   ,--------.       
                   |   7F7F |       
                   `--------'       
,-----------------------------------------------------------.  ,---------------.
| 35| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 5D| 33|  | 47| 51| 4B| 43|
|-----------------------------------------------------------|  |---------------|
|  30 | 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E|     |  | 59| 5B| 5C| 45|
|------------------------------------------------------`    |  |---------------|
|  36  | 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27|   | 24 |  | 56| 57| 58| 4E|
|-----------------------------------------------------------|  |---------------|
|   38   | 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 6A| 7B   |  | 53| 54| 55|   |
|-----------------------------------------------------------|  |-----------| 4C|
| 39|  3A |  37  | 66|      31      | 68| 2A| 3B| 3C| 3D| 3E|  | 52|   | 41|   |
`-----------------------------------------------------------'  `---------------'








Quote
Quote
NeXT ADB keyboard was designed for NeXT computer and not for Apple Mac, so not compatible completely for Apple ADB. Those scan codes are PageDown, PageUp and Home respectively, but somewhat reasonable for position of the keys.

The converter works as expected there. You can remap the keys if you want.

Let me know if Power key sends nothing after cleaning.
EDIT: NeXT Power key doesn't register scan code. https://geekhack.org/index.php?topic=14290.msg2998949#msg2998949

In that case it will need firmware chage to see PSW pin directly on ADB signal. But your converter hardware(ADBUSB-0x1) doesn't have connection for PSW unfortunately, you will need to solder.

On Apple ADB keyboards Power key sends scan code '7F' and it doesn't require PSW.

OK, i will try to clean up the inside, first.

I found that the user already reported that NeXT Power key doesn't send scan code.
So you don't have to clean up for this anymore.

It is clear that firmware fix is required to check PSW now. I'll do that later.
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Mon, 25 April 2022, 11:07:09
I have a SparkFun Pro Micro which I've wired up as required for the ADB to USB converter (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb#wiring) (including the pull-up resistor). However, I can't figure out how to load the TMK firmware to test it out. I know the Pro Micro is working, because the Arduino IDE can see it and upload code to it which runs (e.g. I can make the RX and TX lights flash). I can get the Pro Micro into DFU mode by double-tapping the reset button, and have confirmed this is working by using the Arduino Serial Monitor. However, when I put the Pro Micro in DFU mode and try to erase the memory contents so I can upload a TMK .hex file using dfu-programmer (https://github.com/tmk/tmk_keyboard/wiki#dfu-programmer-for-windows-mac-and-linux), I get the following error (immediately):

Code: [Select]
1005 ~ » dfu-programmer atmega32u4 erase --force
dfu-programmer: no device present.

It appears that dfu-programmer doesn't know where to find the device, because it's clearly present as seen by the Arduino software, and by the presence of /dev/cu.usbmodem2101 and /dev/tty.usbmodem2101 (and it appears in System Profiler as being attached to the USB bus). Does anyone know how I can instruct dfu-programmer to find the Pro Micro? Or some other way I can erase the memory and flash the TMK firmware? I'm using MacOS 12.3.1. Any help would be greatly appreciated!
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Mon, 25 April 2022, 11:20:53
promicros typically have a caterina bootloader. you have to be quick to catch it (8 seconds)
- after you have your hex file ready
- open your flasher of choice, QMK toolbox, or other.
- select your file to flash
- reset the board twice quickly
- watch for the port to open up
- then hit flash in the utility.

here's a screenshot of the port opening up in qmk toolbox.
[attach=1]

some other controllers that use 32u4 use regular DFU and once in bootloader will stay there until they receive instructions. promicros are not like this.
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Mon, 25 April 2022, 12:15:47
Sorry, i'm late to respond, but the week was complicated in France.

I'll have to get one of keypads to check in hand if we can't find any clue.
It is not so difficult to find cheap ADB keypad.

Yep, i have find many keypad in Japan, it's common. I have not seen any information about a specific protocol, but's its weird to have 4 keypad with the same problem.

Quote
Can you check if these scan codes are correct for M0487?  Especially Japanese keys( JPY, RO, EIS, KAN).
Also let me know scan code for ](left to Return) and , (on keypad).

Quote

                   ,--------.
                   |  Power |
                   `--------'
,-----------------------------------------------------------.  ,---------------.
|Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Del|  |Clr|  =|  /|  *|
|-----------------------------------------------------------|  |---------------|
|Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [|     |  |  7|  8|  9|  +|
|------------------------------------------------------`    |  |---------------|
|Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|Retn|  |  4|  5|  6|  -|
|-----------------------------------------------------------|  |---------------|
|Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /| RO| Shift|  |  1|  2|  3|   |
|-----------------------------------------------------------|  |-----------|Ent|
|Cap| Opt | Cmd  |EIS|    Space         |KAN|Lef|Rig|Dow|Up |  |  0|  ,|  .|   |
`-----------------------------------------------------------'  `---------------'
           
                   ,--------.       
                   |   7F7F |       
                   `--------'       
,-----------------------------------------------------------.  ,---------------.
| 35| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 5D| 33|  | 47| 51| 4B| 43|
|-----------------------------------------------------------|  |---------------|
|  30 | 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E|     |  | 59| 5B| 5C| 45|
|------------------------------------------------------`    |  |---------------|
|  36  | 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27|   | 24 |  | 56| 57| 58| 4E|
|-----------------------------------------------------------|  |---------------|
|   38   | 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 6A| 7B   |  | 53| 54| 55|   |
|-----------------------------------------------------------|  |-----------| 4C|
| 39|  3A |  37  | 66|      31      | 68| 2A| 3B| 3C| 3D| 3E|  | 52|   | 41|   |
`-----------------------------------------------------------'  `---------------'

So :
• On the right, the + and the - are inverted on your graph, but the value are good (- is top, + bottom)
• T is 11 and Y is 10
• I have a key right to : (and before Return) : ] (scan code 2A)
• The key with a kanji (i mean) between / and shift is scan code 5E (not 6A)
• At bottom left, the option key is 7C, not 3A
• The enter key between the kanji key (68) and the left key (3B) is scan code 6A (not 2A)
• On the keypad : i have 0 (code 52), a ' key (code 5F), a . key (code 41).


Quote

I found that the user already reported that NeXT Power key doesn't send scan code.
So you don't have to clean up for this anymore.

It is clear that firmware fix is required to check PSW now. I'll do that later.

 I have undertand for the Power key, but i have a problem with the other key too when i press it.

And i have received many new mouse and a joystick, too ;)
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Mon, 25 April 2022, 23:49:43
Sorry, i'm late to respond, but the week was complicated in France.

I'll have to get one of keypads to check in hand if we can't find any clue.
It is not so difficult to find cheap ADB keypad.

Yep, i have find many keypad in Japan, it's common. I have not seen any information about a specific protocol, but's its weird to have 4 keypad with the same problem.

I got this keypad similar to your Sanwa NT-MAC2ST and confirmed the issue.
https://imgur.com/a/AQqM7Yv

I found that the keypad is 'dumb' and can't reply any command except for reading keys. Fixed firmware for 'dumb' keyboards/mouses like this keypad.
https://github.com/tmk/tmk_keyboard/issues/733

Test your keypads and AlphaSmart with new firmware. I think some of them woluld work.


Quote
So :
• On the right, the + and the - are inverted on your graph, but the value are good (- is top, + bottom)
• T is 11 and Y is 10
• I have a key right to : (and before Return) : ] (scan code 2A)
• The key with a kanji (i mean) between / and shift is scan code 5E (not 6A)
• At bottom left, the option key is 7C, not 3A
• The enter key between the kanji key (68) and the left key (3B) is scan code 6A (not 2A)
• On the keypad : i have 0 (code 52), a ' key (code 5F), a . key (code 41).

Thank you for the correcting. Updated scan code table here.
https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#apple-m0487-jis


I updated firmware for the Japanese keys and they are configured as below for test.

Please confirm the keys register A-F respectively.

JPY(5D)  -  A
RO(5E)  - B
EIS(66) - C
KAN(68) - D
Ent(6A) - E
KP,(5F) - F

I'll update Keymap Editor later so that you can remap the Japanese keys.



Quote
Quote
I found that the user already reported that NeXT Power key doesn't send scan code.
So you don't have to clean up for this anymore.

It is clear that firmware fix is required to check PSW now. I'll do that later.

 I have undertand for the Power key, but i have a problem with the other key too when i press it.

And i have received many new mouse and a joystick, too ;)

Added  PSW pin support and NeXT power keys should work now.
You need to wire as red line in pic to test this function.

[attach=1]

[attachurl=2]
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Tue, 26 April 2022, 06:29:39
@nevin, thanks very much for the details and help. The problem I have is that I never get the message:

Code: [Select]
*** Caterina device connected
Found port: /dev/cu.usbmodem4101

The Pro Micro sits in the bootloader for 8 seconds, but nothing changes on the screen in QMK Toolbox. This is why I think that somehow dfu-programmer (and QMK Toolbox) aren't 'looking for' or 'seeing' the device.

As a side note, System Profiler differentiates between bootloader and normal mode. When the Pro Micro is in bootloader mode, it shows up as:

Code: [Select]
Pro Micro 5V  :

  Product ID: 0x9205
  Vendor ID: 0x1b4f
  Version: 0.01
  Speed: Up to 12 Mb/s
  Manufacturer: SparkFun Electronics
  Location ID: 0x02100000 / 1
  Current Available (mA): 500
  Current Required (mA): 100
  Extra Operating Current (mA): 0

But when it's running normally (when I plug it in or after the 8 seconds bootloader timeout), it shows up as:

Code: [Select]
SparkFun Pro Micro:

  Product ID: 0x9206
  Vendor ID: 0x1b4f
  Version: 1.00
  Speed: Up to 12 Mb/s
  Manufacturer: SparkFun
  Location ID: 0x02100000 / 1
  Current Available (mA): 500
  Current Required (mA): 500
  Extra Operating Current (mA): 0

Any ideas as to how I can get dfu-programmer or QMK Toolbox to notice when the Pro Micro is in bootloader mode and upload the hex file?

Thanks again!
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Tue, 26 April 2022, 07:15:57
- download & install latest version of qmk toolbox (you will probably have to go into security & privacy settings to allow the installation. i used 0.2.0 not the latest beta)
https://github.com/qmk/qmk_toolbox/releases
- screenshot i previously posed was from an older version. the new dialog looks a little different, but you are looking for the yellow notice, "caterina device connected...... [dev/cu.usbmodem143201]" (it no longer says "found port")
- here's a screenshot of current 0.2.0 version (i'm still running catalina)
[attachimg=1]
- are you getting these yellow messages at all when resetting the board?

- and if all else fails, restart. you know how these macs can get temperamental.
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Tue, 26 April 2022, 09:33:00
Thanks for the follow-up. I am running the latest version of QMK Toolbox (0.2.0), but I never get any yellow text. In fact, the text never changes from what is displayed upon launching the app, regardless of how many times I resent the Pro Micro:

[attach=1]

I hadn't thought to restart my Mac, but I've just done that and sadly it didn't change anything.  :(

I'm starting to think I need to run avrdude manually, since it presumably works as that is how the Arduino software uploads code from the IDE. I'd just prefer to use dfu-programmer or QMK Toolbox if possible.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Tue, 26 April 2022, 11:27:07
have you gone through the full process to setup your build environment? you could be missing a tool.
https://github.com/tmk/tmk_keyboard/wiki#build-on-mac
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 26 April 2022, 13:42:15

I got this keypad similar to your Sanwa NT-MAC2ST and confirmed the issue.
https://imgur.com/a/AQqM7Yv

I found that the keypad is 'dumb' and can't reply any command except for reading keys. Fixed firmware for 'dumb' keyboards/mouses like this keypad.
https://github.com/tmk/tmk_keyboard/issues/733

Test your keypads and AlphaSmart with new firmware. I think some of them woluld work.

• The first keypad is working great.
• The second keypad is OK too (the one with a trackball), there is just a weird things :
• The last one is this combo "calculator/keypad" (https://www.journaldulapin.com/2020/01/08/un-pave-numerique-qui-fait-office-de-calculatrice-en-adb/). And it will not work. When i plug the keypad, it turn on (seems OK) and there is timer. And whith the adpeter, after a few second, the timer is freezing. And nothing happen. I suppose the keypad need more energy, but even with battery, i have the same thing.

The AlphaSmart is working great. I can send text from the word processor to my mac. The only weird thing is the Caps Lock key : the key send only "B9FF" on the log.

Quote
Thank you for the correcting. Updated scan code table here.
https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#apple-m0487-jis

I updated firmware for the Japanese keys and they are configured as below for test.

Please confirm the keys register A-F respectively.

JPY(5D)  -  A
RO(5E)  - B
EIS(66) - C
KAN(68) - D
Ent(6A) - E
KP,(5F) - F

I'll update Keymap Editor later so that you can remap the Japanese keys.

I have compared, its seems OK for me, the layout is OK and the scan code too.

Quote
Added  PSW pin support and NeXT power keys should work now.
You need to wire as red line in pic to test this function.

I will try that this week (and my last keypad).

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 26 April 2022, 14:02:44
And with the new firmware, i have a good news.

The infamous trackpad "GlidePoint" is working. There is a weird things on the logs, by the way : the line "M:found: reg3:6C01" is repeating, with incrementation.

I have try too with the optical ADB/Mouse, and the mouse is not working... but i have the same things on the logs.
And i have tried on a "real" Mac : the mouse seems to go to adress 10 (and not 3). Is this normal ? (i join a capture)

And the last one is my new mouse, an Elecom branded mouse, with the same switch than the Elecom trackball. And the same problem : a "fail" in the logs.

I have tried an optical weird ADB mouse (no problem), a mouse with two button (no problem) and a Minolta trackpad (no problem). The two mouses use the same way for the second button : a press to activate, a second press to release. The trackpad sens the same button for the two buttons.

Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Tue, 26 April 2022, 16:02:40
@nevin, yes, I successfully ran all three brew commands and to install the necessary tools. I've just confirmed this as well:

Code: [Select]
1011 ~ » brew tap                                                                                              21:59:17
homebrew/cask
homebrew/core
homebrew/services
josh-/qlscpt
osx-cross/avr
shivammathur/php
1012 ~ » brew info avr-gcc                                                                                     21:59:21
osx-cross/avr/avr-gcc@9: stable 9.3.0, HEAD
GNU compiler collection for AVR 8-bit and 32-bit Microcontrollers
https://www.gnu.org/software/gcc/gcc.html
/opt/homebrew/Cellar/avr-gcc@9/9.3.0_3 (1,749 files, 224.4MB) *
  Built from source on 2022-04-23 at 18:42:18
From: https://github.com/osx-cross/homebrew-avr/blob/HEAD/Formula/avr-gcc@9.rb
==> Dependencies
Build: autoconf ✔, automake ✔
Required: avr-binutils ✔, gmp ✔, isl ✔, libmpc ✔, mpfr ✔
==> Options
--with-ATMega168pbSupport
Add ATMega168pb Support to avr-gcc
--HEAD
Install HEAD version
1013 ~ » brew info dfu-programmer                                                                              21:59:32
dfu-programmer: stable 0.7.2 (bottled), HEAD
Device firmware update based USB programmer for Atmel chips
https://dfu-programmer.sourceforge.io/
/opt/homebrew/Cellar/dfu-programmer/0.7.2 (9 files, 162.3KB) *
  Poured from bottle on 2022-04-23 at 20:03:55
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/dfu-programmer.rb
License: GPL-2.0
==> Dependencies
Required: libusb-compat ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 940 (30 days), 2,870 (90 days), 12,039 (365 days)
install-on-request: 158 (30 days), 471 (90 days), 1,953 (365 days)
build-error: 0 (30 days)

I'm using an M1-based Mac, could this be causing the issue?
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Tue, 26 April 2022, 17:05:23
Quote
I'm using an M1-based Mac, could this be causing the issue?

i don't know. i don't have any M1 stuff to test with. do some searching in the brew or tools to see if there's an incompatibility.
do you have any other computers? build the file on your mac & flash on a different computer/laptop?

i have a friend with an M1, let me ask him if he's been able to flash anything since getting it.
edit... my friend is going to test when he can & chime in.
Title: Re: TMK ADB to USB keyboard converter
Post by: ScarletSwordfish on Tue, 26 April 2022, 17:36:04
I just tried flashing my Pro Micro with QMK Toolbox on my M1 Mac mini, and I am getting the same results as jzw95. My window looks exactly the same, with "No HID console devices connected" at the bottom, and I get no yellow text when I reset the Pro Micro. It may very well be an M1 issue.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Tue, 26 April 2022, 17:47:04
... little further digging....

looks like it is a known issue
https://github.com/osx-cross/homebrew-avr/issues/220

but it looks like the issue has been resolved in GCC11 and supposedly patched in all versions...
https://github.com/osx-cross/homebrew-avr/pull/249

might have to pull GCC 11 specifically
https://github.com/osx-cross/homebrew-avr
scroll down to current versions
GCC 11.1.0 - provided as
Code: [Select]
avr-gcc@11
....not positive which you need, but give it a shot. update avr-gcc by itself.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 26 April 2022, 19:16:43
• The first keypad is working great.
• The second keypad is OK too (the one with a trackball), there is just a weird things :

What's the weird things actually?


Quote
• The last one is this combo "calculator/keypad" (https://www.journaldulapin.com/2020/01/08/un-pave-numerique-qui-fait-office-de-calculatrice-en-adb/). And it will not work. When i plug the keypad, it turn on (seems OK) and there is timer. And whith the adpeter, after a few second, the timer is freezing. And nothing happen. I suppose the keypad need more energy, but even with battery, i have the same thing.

If hid_listen log doesn't show useful info what 'ADB Parser' shows would be useful.


Quote
The AlphaSmart is working great. I can send text from the word processor to my mac. The only weird thing is the Caps Lock key : the key send only "B9FF" on the log.

With iMate/OS9(OSX) the CapsLock key work well, right?

Can you get log with hot-plugging the AlphaSmart? The log doesn't show useful info much.
Please hot-plug a device basically when you get log if possible. This will show more info.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 26 April 2022, 20:17:10
And with the new firmware, i have a good news.

The infamous trackpad "GlidePoint" is working. There is a weird things on the logs, by the way : the line "M:found: reg3:6C01" is repeating, with incrementation.


To support hot-plugging the converter checks mouse and keyboard per 1sec, but this is not useful for dumb devices. I think the converter can stop this once dumb device is found. I'll fix.



Quote
I have try too with the optical ADB/Mouse, and the mouse is not working... but i have the same things on the logs.
And i have tried on a "real" Mac : the mouse seems to go to adress 10 (and not 3). Is this normal ? (i join a capture)

I didn't know ADB Parser tool, it looks great for debug!

Yes, it is what expected according to OSX source code. I think classic OS9 does same thing probably.

1. OSX checks address 3 if it finds a mouse move the mosue to empty address(F in this case).
2. The mouse is configured there(after moved) if driver is avaialble.
3. OSX check address 3 again.
        If it doesn't find mouse anymore, the last mouse is moved back to address 3.
        if it find another mouse it is moved to next empty address(probably E). and go to 2.

Keyboards are also handled in same way.

https://github.com/apple-oss-distributions/IOADBFamily/blob/IOADBFamily-6/IOADBBus/IOADBController.cpp#L278

One mouse is located at 3 and another at F in the result.
This can happen when you have physically two mouses or  a complex mouse like Kensignton.

Mouse at 3 has hadler ID:32 and this indicates that you had Kensington mouse?.



Quote
And the last one is my new mouse, an Elecom branded mouse, with the same switch than the Elecom trackball. And the same problem : a "fail" in the logs.

The Elecom mouse fails at second moving for some reason.
This is similar to NeXT mouse issue.

I'll have to revisit this issue later.
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Wed, 27 April 2022, 07:11:36
@nevin, thanks for digging further into this. I'm not sure that it is an issue with avr-gcc since I've not tried to compile any keyboard firmware – simply access the Pro Micro with the programmer, but maybe there is some related library that is causing issues with dfu-programmer. My avr-gcc (GCC9) seems to be an ARM binary:

Code: [Select]
1017 ~ » file /opt/homebrew/Cellar/avr-gcc@9/9.3.0_3/bin/avr-gcc
/opt/homebrew/Cellar/avr-gcc@9/9.3.0_3/bin/avr-gcc: Mach-O 64-bit executable arm64

but it's a good idea to be sure, so when I have some time later I'll install avr-gcc@11 specifically and see if that makes a difference.

@ScarletSwordfish I really appreciate your testing this and confirming you see the same (lack of) behaviour. I'm wondering if this has to do with the tightened security model of the M1 Macs and somehow the dfu-programmer is not being allowed access to the tty devices (or /dev at all??). I've got an old Intel-based MacBook Air and when I have a chance I'll fire it up, install the toolchain, and see if the results are any different.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Wed, 27 April 2022, 07:40:52
the promicro's use caterina bootloader, avrdude flash utility to flash, not dfu util. that's what i mean, the flashing utility sounds like it was updated in those versions of avr-gcc

not sure which version of avrdude is pulled in TMK dependencies during install, avrdude might not be pulled at all during TMK install.
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Wed, 27 April 2022, 10:06:03
Oh, does the caterina boot loader not support dfu-programmer? I will try avrdude, which should work since that's what the Arduino IDE is using (and the Arduino IDE was able to flash my Pro Micro). But what does QMK Toolbox use to flash? It's strange that it works for your caterina device but not my Pro Micro. That's why I thought it was maybe the M1 causing an issue.

Thanks for all the info. I'll do some testing with my Intel Mac and avrdude and post my results.
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Wed, 27 April 2022, 12:46:15
promicro's are caterina bootloaders. and promicro, at least the original is a Arduino device. if you have a hex file ready, you can probably use the Arduino flasher.

qmk toolbox can flash a bunch of different devices, processors, bootloaders, etc. just depends on what tools are installed that qmk toolbox can utilize.
Title: Re: TMK ADB to USB keyboard converter
Post by: jzw95 on Fri, 29 April 2022, 10:14:20
I've finally had some time to play around a bit more, and the end result is… success! I've got QMK Toolbox to recognise my Pro Micro on my M1 MacBook Pro.

I first got my 2013 Intel-based MacBook Air fired up and downloaded QMK Toolbox to it. I had to use an older version (v0.1.1) as my MacBook Air is running MacOS 10.14.6 which isn't supported by v0.2.0. But as soon as I put my Pro Micro in DFU mode, the magical yellow text appeared:

[attach=1]

I then installed dfu-programmer on the MacBook Air and confirmed that it doesn't work.

With the knowledge that my Pro Micro should work with QMK Toolbox, I went back to my M1 MacBook Pro. I tried a few things (removing quarantine xattrs from QMK Toolbox, running it under Rosetta) that didn't work. Then I thought I'd download the latest beta and see if that somehow had a fix, and… it worked! I've had a look through the GitHub issues for QMK Toolbox, and I can't see anything that specifically addresses the problem I was having, but possibly it is this one: [macOS] Add libhidapi #357 (https://github.com/qmk/qmk_toolbox/pull/357).

In any case, the lesson for anyone who is having similar problems getting QMK Toolbox to recognise a Caterina bootloader device on an M1 Mac running MacOS 12 Monterey: download the latest beta, and it should work.

Thanks again, @nevin, for your help. Without knowing what the expected behaviour was I was struggling to figure out what to do to debug this.

Next up… I am going to try actually flashing the TMK firmware. 🥳
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Fri, 29 April 2022, 11:35:11
glad you got it working and have fun with your boards!
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 03 May 2022, 11:09:48
What's the weird things actually?

I was tired, sorry.

The keypad use a "shift" key for a second use of the key. The "shift" key has no scan code, but when i press the "5" key, i have FFFF FFFF scan code : the "5" key is the only key without an alternate function (i have join a photo).

Quote
If hid_listen log doesn't show useful info what 'ADB Parser' shows would be useful.

UI will try that this week with my old Mac.

Quote
With iMate/OS9(OSX) the CapsLock key work well, right?

Can you get log with hot-plugging the AlphaSmart? The log doesn't show useful info much.
Please hot-plug a device basically when you get log if possible. This will show more info.

So, with iMate, my HID app say "Keyboard Caps Lock (0x0039)" up and down, but it will not work : even if i press the key, i have nos CAPS.

I have join two logs. The first one, i have hot plug the AlphaSmart and after that, i have powered the keyboard. In the second, i have powered the keyboard, and after that, i have plugged in. The result is the same, by the way, no information.

Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Tue, 03 May 2022, 11:12:27
Quote
I didn't know ADB Parser tool, it looks great for debug!

Yes, it is what expected according to OSX source code. I think classic OS9 does same thing probably.

1. OSX checks address 3 if it finds a mouse move the mosue to empty address(F in this case).
2. The mouse is configured there(after moved) if driver is avaialble.
3. OSX check address 3 again.
        If it doesn't find mouse anymore, the last mouse is moved back to address 3.
        if it find another mouse it is moved to next empty address(probably E). and go to 2.

Keyboards are also handled in same way.

https://github.com/apple-oss-distributions/IOADBFamily/blob/IOADBFamily-6/IOADBBus/IOADBController.cpp#L278

One mouse is located at 3 and another at F in the result.
This can happen when you have physically two mouses or  a complex mouse like Kensignton.

Mouse at 3 has hadler ID:32 and this indicates that you had Kensington mouse?.

I will try this week too, but on the capture, i have connected only the optical USB/ADB mouse.

Quote
The Elecom mouse fails at second moving for some reason.
This is similar to NeXT mouse issue.

I'll have to revisit this issue later.

OK, thank you !
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 04 May 2022, 09:24:11
What's the weird things actually?

I was tired, sorry.

The keypad use a "shift" key for a second use of the key. The "shift" key has no scan code, but when i press the "5" key, i have FFFF FFFF scan code : the "5" key is the only key without an alternate function (i have join a photo).

Confirmed that my keypad also behaves exactly as you described. My keypads was manufactured by Qtronix too.
'FFFF' is not proper scan code but not harmful.



Quote
Quote
With iMate/OS9(OSX) the CapsLock key work well, right?

Can you get log with hot-plugging the AlphaSmart? The log doesn't show useful info much.
Please hot-plug a device basically when you get log if possible. This will show more info.

So, with iMate, my HID app say "Keyboard Caps Lock (0x0039)" up and down, but it will not work : even if i press the key, i have nos CAPS.

I have join two logs. The first one, i have hot plug the AlphaSmart and after that, i have powered the keyboard. In the second, i have powered the keyboard, and after that, i have plugged in. The result is the same, by the way, no information.



Hmm,  no device info in the logs indicattes that AlphaSmart is dumb device that can't reply ADB commands.


And in the log two capslock release events(B9) happened in a row without press event(39).  This is weird and reason why it fails with iMate too. I guess AlphaSmart firmware does something tricky.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Fri, 06 May 2022, 02:21:39
Try attached firmware with :
- Pioneer and Macally keyboard
- Elecom, NeXT,  M2706 black mouse

Changed initialization of keyboard and mouse setup.


[attachurl=1]
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sat, 21 May 2022, 00:49:33
I wrote ADB protocol decoder for sigrok for debug.


Sigrok ADB decoder
Cheap $10-20 Logic Analyzer (https://sigrok.org/wiki/Fx2lafw#Logic_Analyzers_/_mixed-signal_devices) that is compatible with sigrok (https://geekhack.org/https://sigrok.org/wiki/Main_Page) 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#sigrok
(https://user-images.githubusercontent.com/424590/169636730-023f5f22-813d-4fe3-977e-885af3a91444.png)
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Mon, 30 May 2022, 09:13:00
Updated firmware

- Address Resolution (https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#address-resolution) was implemented
- Improved hot-plug support

These offers better support for multiple devices on daisy chain.
You can use ANSI and ISO keyboard at same time, for example.

https://github.com/tmk/tmk_keyboard/commit/4923f09377371723c767ab884454571de0740094
Title: Re: TMK ADB to USB keyboard converter
Post by: nevin on Mon, 30 May 2022, 09:54:29
NICE!
great work as always hasu!
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 08 June 2022, 23:00:15
Dandu,

Can you try attached firmware with devices that 'failed to move'?
    - Pioneer MPC-KB2
    - Kensington Optical mouse


With updated firmware Address Resoution was implemented and command timging is changed, so that the converter behaves as what Mac OSX does as possible now.
This can get better result with devices that fails to move to new address, perhaps.

[attachurl=1] @8dee557
Title: Re: TMK ADB to USB keyboard converter
Post by: Dandu on Thu, 09 June 2022, 02:36:30
Hi

I'm sorry, i'm late, i had a lot of work.

I will try the keyboard this week
Title: Re: TMK ADB to USB keyboard converter
Post by: wujack on Tue, 19 July 2022, 12:35:43
Hi, I've just received my controller I'm wondering if I wanted to convert the controller to type-c can I solder wires from the G, +, -, V through-hole to a c3-unified usb-c daughter board? Thanks!
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Tue, 19 July 2022, 19:31:21
I think so. Let us know your result.

Hi, I've just received my controller I'm wondering if I wanted to convert the controller to type-c can I solder wires from the G, +, -, V through-hole to a c3-unified usb-c daughter board? Thanks!

EDIT: Assuming what you are referring to is this: https://github.com/ai03-2725/Unified-Daughterboard
Title: Re: TMK ADB to USB keyboard converter
Post by: wujack on Wed, 20 July 2022, 00:06:41
I think so. Let us know your result.

Hi, I've just received my controller I'm wondering if I wanted to convert the controller to type-c can I solder wires from the G, +, -, V through-hole to a c3-unified usb-c daughter board? Thanks!

EDIT: Assuming what you are referring to is this: https://github.com/ai03-2725/Unified-Daughterboard

Yup, precisely. I'll let you guys know the results!
Title: Re: TMK ADB to USB keyboard converter
Post by: fabiobelmondo on Fri, 26 August 2022, 08:31:06
Hello, just wired up the converter for my M0118 using a pro micro and when i plug in th s-video cable i get this message in QMK Toolbox. Needless to say that the keyboard doesn't work.. Any indeas?
https://imgur.com/a/GX4KoaQ
Title: Re: TMK ADB to USB keyboard converter
Post by: emrebag on Wed, 07 December 2022, 08:16:23
Is there any way to add M0118 ISO layout to TMK Keymap Editor?
Right now the closest available option is using the M0110 layout on TMK keymap editor, but there is no newbie-friendly way to add the few missing keys or any guide detailing how one might do so without creating a keymap from scratch.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 07 December 2022, 08:37:51
Is there any way to add M0118 ISO layout to TMK Keymap Editor?
Right now the closest available option is using the M0110 layout on TMK keymap editor, but there is no newbie-friendly way to add the few missing keys or any guide detailing how one might do so without creating a keymap from scratch.


You can use default keyboard layout of ADB-USB, which should have enough keys to edit keymap for M0118.
I think there is no missing key on the ADB-USB editor.
Title: Re: TMK ADB to USB keyboard converter
Post by: emrebag on Wed, 07 December 2022, 11:07:00
Thank you for the super fast reply!
So, I'm just gonna go left to right and fill the keymap in order correct?
One problem I am running into is that the lgui and rgui seem to be paired in the default positions.
They do not correspond to the gui keys in my keymap, and I am not able to customize them separately.
Any way around this?
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 07 December 2022, 17:12:50
No, space on keymap edtor still should indicate sapce on M0118, and same for other keys.
Basically default keymap should work on M0118.

As the first post says:
On ADB Standard keyboards(M0116) left and right corresponding modifiers are logically indentical and can not be discriminated one another

I think this is your problem and limitation of the keyboard, then no solution.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Sat, 11 March 2023, 10:48:32
New firmware is available on github repo and Keymap Editor now.
Fixed Remote Wakeup bug. https://github.com/tmk/tmk_keyboard/issues/756
Title: Re: TMK ADB to USB keyboard converter
Post by: Maigonis on Wed, 14 June 2023, 09:25:20
Hello!

I have an AEK (M0115).
I am trying to get an ADB to USB converter working using a ProMicro and a PCB board that holds the Mini Din 4 socket. The details of the PCB I used are here: https://68kmla.org/bb/index.php?threads/cheap-and-simple-adb-to-usb-converter.39402/.

My converter does not work. When I connect the keyboard to a PC either Windows or Linux, I have the same behavior, the lock lights flash and turn off after which the keyboard does work.

I successfully uploaded the adb-usb converter precompiled binary from the TMK firmware repository to my ProMicro. I did not change the bootloader, so the Pro Micro still contains the Caterina bootloader. I triple-checked my wiring and did continuity tests on all the pins. They are connected correctly. I also have a 1k Ohm pull-up on the data line and solder-bridged J1 to get 5.01V on VCC.

Windows and Linux both detect the Pro Micro as an HID device and show the correct Vendor ID, Manufacturer, etc. (QMK Toolbox also shows the hid-device connection).

Since the firmware seems to have been flashed correctly and the wiring seems correct, Do I assume that the keyboard is faulty? I just recently received it, the seller claimed 100% functional.
I don't have other ways to test since I don't have another keyboard or converter.

I would very much appreciate any help that anyone can provide.

Thank you!
Title: Re: TMK ADB to USB keyboard converter
Post by: Maigonis on Wed, 14 June 2023, 14:19:44
Hello Again!

I have fixed the issue and now the converter works flawlessly! The issue was the pull-up resistor. I misread the markings and soldered in a 100k ohm resistor instead of 1k. Changing this solved the issue.
Title: Re: TMK ADB to USB keyboard converter
Post by: xxhellfirexx on Mon, 25 September 2023, 22:44:04
I purchased a TMK ADB-USB converter rev2 (ATMega32u2) from Hasu a few years ago and am using it in my keyboard rotation. When using the keyboard on Mac OS 12.6, I notice it occasionally stops registering keypresses in the middle of my typing. The only way to get it working again is to reconnect the USB cable.

I tried to use Hasu's online keymap editor to generate the hex firmware file and then flash it using the Atmel Flip program. However, it did not stop this problem from happening. I used the keymap editor to remove all keyboard layers and it did not fix the problem either.

I also tried to build the firmware by following the TMK keyboard wiki instructions. However, when the firmware is flashed, the keyboard stops registering all keypresses even when the USB has been reconnected. I need to use the Atmel Flip program to flash the hex file from the online keymap editor to get it working again.

Has anyone else experienced this problem? Is there anything I can do to troubleshoot this problem? The hid_listen program for Windows and Mac does not detect the keyboard even when in bootloader mode.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Mon, 25 September 2023, 23:21:35
I don't have Mac and didn't test on the platform. It doesn't sounds like a firmware issue at this point.

I would suspect unstable connection and hardware problem.

First, you can try other USB cable and ADB cable. Also cleaning connectors may help.

Narrow down point of the problem with further tests.

- The problem happen only on Mac and never on Windows?
- The problem happen only with specific ADB keyboard? Try another keyboard if you have.


Download hid_listen here. It should work. And use firmware downloaded from Keymap Editor.
https://github.com/tmk/tmk_keyboard/wiki#debug-console

You may need to replug a few times when hid_listen doesn't recognize the converter.


Title: Re: TMK ADB to USB keyboard converter
Post by: xxhellfirexx on Tue, 26 September 2023, 00:54:33
Thanks for the quick response Hasu. I will try swapping cables one at a time first.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Wed, 25 October 2023, 22:06:02
Updated firmware to add support for Microspeed MacTrac 2.0(old firmware/before Dec 1995).

https://github.com/tmk/tmk_keyboard/commit/bd6e208d55a62added0df658f54ffaa0256fbd59
Title: Re: TMK ADB to USB keyboard converter
Post by: xxhellfirexx on Thu, 26 October 2023, 02:49:44
The keyboard still randomly stops accepting keypresses from Windows and Mac OS and does not work until I reconnect the USB or restart my computer.
I tried swapping the micro USB and s-video cables and also changing between USB 3.0 and USB 2.0 ports. However, these changes made no difference.

While the keyboard is not working, if I press the bootloader button, the ATmega32U2 DFU device appears in the device manager.
This means the connection is still good, but the firmware is bugged.

Is there anything else I can do to troubleshoot this? I don't have another ADB keyboard.
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Thu, 26 October 2023, 07:48:38
xxhellfirexx,
your keyboard hardware or converer hardware may have a problem?
Of course, its firmware can have issue, but it is less likely, methink, because it has been tested by many users.

Are you sure the keyboard is healthy? What model no is the keyboard actually?
If you have another ADB keyboard try it so that you can know whether the covnerter works correctly.


And  check this again.

> Download hid_listen here. It should work. And use firmware downloaded from Keymap Editor.
> https://github.com/tmk/tmk_keyboard/wiki#debug-console

Checking log outputs during the problem occurs would be helpful.

Title: Re: TMK ADB to USB keyboard converter
Post by: xxhellfirexx on Thu, 26 October 2023, 13:52:49
Hi Hasu,
I used the Web HID Listen website to record the keyboard keystrokes.
https://sekigon-gonnoc.github.io/web-hid-listen/

Every time the keyboard stops responding, the output says:
Table:
A:H  a:h
---------

I have experienced this problem two more times in Mac OS 12.6.3 and the logs are linked below.
The keyboard is an Apple Extended Keyboard 1 (M0115)
https://pastebin.com/zqcVvf7D
https://pastebin.com/itYLRmN4
Title: Re: TMK ADB to USB keyboard converter
Post by: hasu on Thu, 26 October 2023, 18:16:36
This outputs means the keyboard disconnected.

Quote
A:H  a:h
---------


Assuming ADB cable is ok it can be unstable connection problem between keyboard and converter.
around sockets on keyboard or converter.

Try wiggling plug at keyboard or converter to find problem point when this happens. You don't need to replug USB side.
You will see like below when keyboard is recognized.

Quote
Table:
A:H  a:h
---------

RRRRRRRRRRRRRRR:$2:Found. R3:6301
R:$2:Move to $F. R3:6801
K:$F:Setup. R3:6E01
K:$F:Layout: ANSI

Table:
A:H  a:h
---------
F:01 2:01


I would suspect solder joints around ADB socket in keyboard first.

AEK1 has two sockets, try another socket if not yet.
Did you have the problem on both?