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

0 Members and 1 Guest are viewing this topic.

Offline bibobim

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

Offline hasu

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

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline bibobim

  • Posts: 13
Re: ADB to USB keyboard converter
« Reply #952 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:(
« Last Edit: Fri, 17 April 2020, 20:59:37 by bibobim »

Offline shacintom

  • Posts: 1
Re: ADB to USB keyboard converter
« Reply #953 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 :-)
« Last Edit: Sat, 02 May 2020, 15:28:14 by shacintom »

Offline notyou

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



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 :)

Offline notyou

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

Offline notyou

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

Offline hasu

  • Thread Starter
  • Posts: 3088
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #957 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline notyou

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

Offline hasu

  • Thread Starter
  • Posts: 3088
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #959 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline notyou

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

Offline hasu

  • Thread Starter
  • Posts: 3088
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #961 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline kelvinhall05

  • Posts: 68
  • Location: London, Ontario
    • LinusTechTips
Re: ADB to USB keyboard converter
« Reply #962 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...

Offline notyou

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

Offline macDaf

  • Posts: 1
  • Location: Russia
open
« Reply #964 on: Sat, 30 May 2020, 21:19:31 »
Hello, where server will reopen?