Author Topic: TMK ADB to USB keyboard converter  (Read 675882 times)

0 Members and 2 Guests are viewing this topic.

Offline mougrim

  • Posts: 768
  • Location: Ukraine
Re: ADB to USB keyboard converter
« Reply #400 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?
IBM AT Model F, Vortexgear Race 3, AEKII (Alps Cream Damped), Metoo Zero (modded to Kailh Box Navy)

Offline neex

  • Posts: 14
Re: ADB to USB keyboard converter
« Reply #401 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:

« Last Edit: Sun, 15 March 2015, 09:55:47 by neex »

Offline mougrim

  • Posts: 768
  • Location: Ukraine
Re: ADB to USB keyboard converter
« Reply #402 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 +.
IBM AT Model F, Vortexgear Race 3, AEKII (Alps Cream Damped), Metoo Zero (modded to Kailh Box Navy)

Offline mougrim

  • Posts: 768
  • Location: Ukraine
Re: ADB to USB keyboard converter
« Reply #403 on: Tue, 17 March 2015, 05:03:17 »

EDIT: Pics of the AlphaSmart:
Show Image

Show Image


Oh, nice one. You can solder inside Teensy or Arduino, and get your own universal ADB adapter.
IBM AT Model F, Vortexgear Race 3, AEKII (Alps Cream Damped), Metoo Zero (modded to Kailh Box Navy)

Offline Papkee

  • Posts: 2
Re: ADB to USB keyboard converter
« Reply #404 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.
« Last Edit: Sun, 29 March 2015, 20:56:01 by Papkee »

Offline ch3wt0ys

  • Posts: 1
  • Location: ???,???
Re: ADB to USB keyboard converter
« Reply #405 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.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #406 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.

Offline Papkee

  • Posts: 2
Re: ADB to USB keyboard converter
« Reply #407 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.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #408 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?

Offline mougrim

  • Posts: 768
  • Location: Ukraine
Re: ADB to USB keyboard converter
« Reply #409 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.
IBM AT Model F, Vortexgear Race 3, AEKII (Alps Cream Damped), Metoo Zero (modded to Kailh Box Navy)

Offline doodersbrother

  • Posts: 197
Re: ADB to USB keyboard converter
« Reply #410 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??

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #411 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.


Offline mougrim

  • Posts: 768
  • Location: Ukraine
Re: ADB to USB keyboard converter
« Reply #412 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.
IBM AT Model F, Vortexgear Race 3, AEKII (Alps Cream Damped), Metoo Zero (modded to Kailh Box Navy)

Offline Yoe

  • Posts: 273
  • Location: Skellefteå, Sweden
  • Alps & ISO <3
Re: ADB to USB keyboard converter
« Reply #413 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.

96500-096502-1

Offline mougrim

  • Posts: 768
  • Location: Ukraine
Re: ADB to USB keyboard converter
« Reply #414 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!
IBM AT Model F, Vortexgear Race 3, AEKII (Alps Cream Damped), Metoo Zero (modded to Kailh Box Navy)

Offline doodersbrother

  • Posts: 197
Re: ADB to USB keyboard converter
« Reply #415 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!

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #416 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.

Offline doodersbrother

  • Posts: 197
Re: ADB to USB keyboard converter
« Reply #417 on: Tue, 07 April 2015, 16:06:58 »
What ohm resistor are you using?

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #418 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!

Offline doodersbrother

  • Posts: 197
Re: ADB to USB keyboard converter
« Reply #419 on: Tue, 07 April 2015, 18:17:08 »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #420 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.


Offline doodersbrother

  • Posts: 197
Re: ADB to USB keyboard converter
« Reply #421 on: Tue, 07 April 2015, 18:40:03 »
That sounds like it's it! Thanks tons! Any idea why that made daisy chaining work??

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #422 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.

Offline XMIT

  • formerly jsoltren
  • Posts: 421
  • Location: Austin, TX area
Re: ADB to USB keyboard converter
« Reply #423 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.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #424 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.

Offline NoahBC

  • Posts: 7
Re: ADB to USB keyboard converter
« Reply #425 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!!

« Last Edit: Mon, 20 April 2015, 18:46:42 by NoahBC »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #426 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.

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #427 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:



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?

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #428 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.

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #429 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:



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?

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #430 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.
« Last Edit: Mon, 27 April 2015, 20:53:38 by hasu »

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #431 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.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #432 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.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #433 on: Mon, 27 April 2015, 21:52:19 »
Mouse is supported by mek-apelsin NOW





Enjoy!
« Last Edit: Mon, 27 April 2015, 21:56:17 by hasu »

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #434 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:



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

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #435 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.

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #436 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.

Offline Red_dino

  • Posts: 8
  • Location: Georgia, U.S.A.
  • #FREEGUCCI
Re: ADB to USB keyboard converter
« Reply #437 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.
« Last Edit: Tue, 05 May 2015, 21:55:15 by Red_dino »
I don't sleep, because sleep is the cousin of death.

Offline Red_dino

  • Posts: 8
  • Location: Georgia, U.S.A.
  • #FREEGUCCI
Re: ADB to USB keyboard converter
« Reply #438 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!
I don't sleep, because sleep is the cousin of death.

Offline afischer

  • Posts: 6
Re: ADB to USB keyboard converter
« Reply #439 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!

Offline Blaise170

  • * Esteemed Elder
  • Posts: 1332
  • Location: Boston, MA
  • ALPS キーボード
    • XYZ
Re: ADB to USB keyboard converter
« Reply #440 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.
I proxy anything including keyboards (キーボード / 鍵盤), from both Japan (日本) and China (中國). For more information, you may visit my dedicated webpage here: https://www.keyboards.es/proxying.html

View my current and past keyboards here: https://deskthority.net/wiki/User:Blaise170

Offline afischer

  • Posts: 6
Re: ADB to USB keyboard converter
« Reply #441 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.




Running hid_listen.mac, I get the following:

adb_host_kbd_recv: ERROR(-30)


Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #442 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

Offline afischer

  • Posts: 6
Re: ADB to USB keyboard converter
« Reply #443 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!

Offline afischer

  • Posts: 6
Re: ADB to USB keyboard converter
« Reply #444 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.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #445 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

Offline afischer

  • Posts: 6
Re: ADB to USB keyboard converter
« Reply #446 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.

Offline afischer

  • Posts: 6
Re: ADB to USB keyboard converter
« Reply #447 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.... :(

Offline taiwanesekid05

  • Posts: 5
Re: ADB to USB keyboard converter
« Reply #448 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?
« Last Edit: Thu, 21 May 2015, 06:14:53 by taiwanesekid05 »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #449 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.