Macally MK96

njm

12 Nov 2018, 12:54

Hey guys, I picked up a cheap Macally MK96 last month, and have been working on restoring it. The plate was pretty rusty, so after doing a basic cleanup, I desoldered all the switches, removed the rust, and repainted the plate.

I built an ADB to USB converter using a pro micro and Hasu's firmware. I haven't yet soldered the switches back on to the board, but when I test it by shorting two pads together, hid_listen logs errors (and the keypress doesn't register):

Code: Select all

$ hid_listen
Waiting for device:
Listening:
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.
Keyboard start.
adb_host_kbd_recv: ERROR(-217)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.
adb_host_kbd_recv: ERROR(-89)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.
I've tested my converter with another ADB keyboard and it works, so I think the issue is with the Macally board. Unfortunately I didn't have an ADB converter to test it with before taking it apart, so not sure if it was working originally, but I wonder if I might have damaged the board when I removed the switches.

I'm starting to run out of ideas, and was wondering if anyone had any tips? I was thinking that if all else fails I could try to figure out the matrix layout and hook up a Soarer's controller.

Here are a couple of photos of the board:
Spoiler:
IMG_4077.jpeg
IMG_4077.jpeg (734.4 KiB) Viewed 5104 times
IMG_4076.jpeg
IMG_4076.jpeg (508.69 KiB) Viewed 5104 times

User avatar
Muirium
µ

12 Nov 2018, 13:44

Strange. I don’t know what would do that to a controller. But I do know that ADB is an oddball protocol that’s too half by smart (thanks Woz!) saving one pin at the cost of a great deal more complexity.

Soarer’s controller is definitely an option. You likely know the drill: map the matrix and remove one or both of those chips, then hook up your Pro Micro (if it has enough pins to map to the required rows and columns) and use Soarer’s tools to describe the matrix.

njm

12 Nov 2018, 23:48

Thanks Muirium. Sounds like Soarer's controller might be the go. I haven't done this before, but keen to give it a try. How do you normally go about mapping the matrix? I was thinking I'd remove the ICs and then use a multimeter to check connectivity between the switch pads and the IC pads - or is there a better way?

User avatar
scottc

13 Nov 2018, 00:48

Mapping out the matrix for a controller replacement really seems like overkill here. I'd try to check continuity in the matrix first, and look for pins that you might've lifted when desoldering things.

User avatar
snacksthecat
✶✶✶✶

13 Nov 2018, 01:42

Do you have a photo of the wiring for your converter? I know that this converter requires an external pullup resistor on the data line and I'm wondering if that might have something to do with it. Maybe, by chance, it works fine with some boards but others require the pullup?

It also might be worth posting something in one of Hasu's threads, either here or on GH. Whenever I've had a question, he has been super helpful in figuring out the issue. I'm convinced the guy is some sort of wizard.

edit: also it might be worthwhile to try out the adb to usb Arduino sketch from adafruit. I had a NExT keyboard with power issues that didn't work with TMK but produced some output with the sketch.

User avatar
hasu

13 Nov 2018, 01:53

which key did you short circuit when the error occured? quote, perhaps?
The keyboard seems to send scancode in wrong format from the aspect of what documented protocol expects.

njm

13 Nov 2018, 11:46

Thanks for taking a look guys. Here are a couple of photos of my wiring:
IMG_4079.jpeg
IMG_4079.jpeg (777.53 KiB) Viewed 4962 times
IMG_4080.jpeg
IMG_4080.jpeg (814.44 KiB) Viewed 4962 times
I'm using a hacked up svideo cable, and the pins for it are as follows:

ADB pin 1 - Outer blue - connected to Pro Micro pin 3 (DATA)
ADB pin 2 - Outer white
ADB pin 3 - Inner blue - connected to Pro Micro VCC
ADB pin 4 - Inner white - connected to Pro Micro GND

I also wired a 1K resistor on the back, between DATA and VCC. The orange wire is just for shorting RST to GND to reset the Pro Micro.

Hasu, I'm not sure which key I pressed in that log yesterday, so I've repeated the test a bit more carefully. Here's an annotated log where I press the 1, 2, and 3 keys:

Code: Select all

# Pressed 1 key

adb_host_kbd_recv: ERROR(-238)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.

# Released 1 key

adb_host_kbd_recv: ERROR(-110)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.

# Pressed 2 key

adb_host_kbd_recv: ERROR(-237)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.

# Released 2 key

adb_host_kbd_recv: ERROR(-109)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.

# Pressed 3 key

adb_host_kbd_recv: ERROR(-236)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.

# Released 3 key

adb_host_kbd_recv: ERROR(-108)
Before init:
Scan: addr:2, reg3:6102
After init:
Scan: addr:2, reg3:6102
debug enabled.
It's interesting that the error codes are consecutive. They are consistent too (e.g. I always receive -238 when pressing the 1 key, and -110 when releasing it).

User avatar
Muirium
µ

13 Nov 2018, 12:43

Hopefully Hasu can figure out what’s up. You’ve got the right man on this, for sure!

Snacks has a good point: you could try another ADB converter firmware on the Pro Micro to see how it handles this keyboard. Hasu’s is way more powerful, but it’s good to have an alternate entry point for troubleshooting.

Scott’s right that a full on controller tearout and replacement may be overkill! (I just went straight for what I know.) But if you’re interested in how to map a matrix, you can do it without removing any ICs. It’s a little tedious, but all you need is a multimeter and to follow the traces to the controller pins. Every keyswitch is hooked up to one row and one column, by definition. You figure out where those are on the controller, and then you follow them out along the PCB, filling in the grid until you’ve got every key mapped. No need to press any keys while doing this. A beeper is enough, as a lot of the work is your eyes.

njm

13 Nov 2018, 12:51

Thanks Muirium! If I don't end up mapping the matrix on this board, I'm sure I'll do it on another one in the future :)

User avatar
hasu

14 Nov 2018, 04:01

Thanks for the test, njm.
Hmm, oddly, the Macally keyboard sends scancode in illegal ADB 16-bit data format against the protocol.

Just ad-hoc patched for this keyboard.
https://github.com/tmk/tmk_keyboard/com ... 1474216044

Try this hex file, test with the keys and post log output again.
https://github.com/tmk/tmk_keyboard/blo ... unimap.hex

Also can you try repluging the keyboard keeping converter connected to USB port? I like to see log output like below to ensure it is still hot-pluggable.

Code: Select all

error: -30
Before init:
Scan: addr:2, reg3:6A01
hadler_id: 01, is_iso_layout: no
After init:
Scan: addr:2, reg3:6801
debug enabled.

User avatar
snacksthecat
✶✶✶✶

14 Nov 2018, 04:04

^ evidence of keyboard wizardry.

njm

14 Nov 2018, 04:17

Wow thanks Hasu! Snacks is right about the keyboard wizardry. I’ll give this a go when I get home and let you know how it goes.

njm

14 Nov 2018, 05:03

It works! Thanks so much Hasu. Here's a new log. I pressed the 1,2,3 keys, unplugged the ADB cable (leaving the USB cable plugged in), plugged the ADB cable back in, and then typed the 4,5,6 keys. I didn't see any log messages when disconnecting/reconnecting the ADB cable, but it did log the 4,5,6 scan codes after I reconnected.

Code: Select all

$ hid_listen
Waiting for device:
Listening:
Keyboard init.
[C]Before init:
Scan: addr:2, reg3:6102
hadler_id: 02, is_iso_layout: no
After init:
Scan: addr:2, reg3:6102
debug enabled.
Keyboard start.
FF12 FF92 FF13 FF93 FF14 FF94 FF15 FF95 FF17 FF97 FF16 FF96

User avatar
hasu

14 Nov 2018, 06:46

Great! Thanks for the log.
I'll merge the patch into master repository later after some further tests.

As for keyboard replug it seems that the converter can detect plugin for some keyboards(M0116, AEK, AEKII, IIGS) but not for others(Apple adjustable keyboard) with current firmware at least. The Macally is one of the latter group probably.

User avatar
Muirium
µ

14 Nov 2018, 09:30

hasu wrote: Hmm, oddly, the Macally keyboard sends scancode in illegal ADB 16-bit data format against the protocol.
That is very weird. Apple actually supported third party peripheral makers wandering off spec? I know they were goofy in the 90s but this is quite something!

njm

14 Nov 2018, 23:55

I reassembled the keyboard last night, and tested it a bit more thoroughly. Everything is working well, but I noticed an issue with a couple of keys: ` and \

If I press and release the ` key, I can see the scan codes logged in hid_listen with no latency (FF32 for the press and FFB2 for the release). However, the key doesn't seem to register (e.g. the character doesn't appear on my terminal) until the key is released. Also, if I hold down the key for any length of time (more than a few hundred milliseconds), the key press is ignored entirely (although hid_listen still logs the FF32 and FFB2 codes). Hope that makes sense!

The same thing happens for the \ key (scan codes FF2A and FFAA), but all the other keys seem fine as far as I can tell. Weird, right?

User avatar
hasu

15 Nov 2018, 00:39

Those two keys are defined as 'dual role key'(for layer change) in default keymap of my converter. You can define your keymap and comiple firmware using 'adb_fix_macally' branch.
https://github.com/tmk/tmk_keyboard/blo ... er/adb_usb

njm

15 Nov 2018, 00:46

Ah I see! Thanks Hasu.

User avatar
swampangel

15 Nov 2018, 14:34

I have an MK-96, I'll have to give this a try. Too bad I threw out all my s-video cables ...

njm

16 Nov 2018, 02:58

swampangel wrote: I have an MK-96, I'll have to give this a try. Too bad I threw out all my s-video cables ...
How do you like the MK-96? I quite like the sound of it, although the switches on mine could be a bit smoother. I find they sometimes stick a bit if I don't hit them at the right angle. Maybe they are just dirty (the board itself certainly was).

User avatar
swampangel

16 Nov 2018, 14:40

njm wrote: How do you like the MK-96? I quite like the sound of it, although the switches on mine could be a bit smoother. I find they sometimes stick a bit if I don't hit them at the right angle. Maybe they are just dirty (the board itself certainly was).
It is impressively loud. I got mine used but quite clean, and it still suffers from the binding you described -- I originally assumed it had SKBM or alps clones, but I've never actually checked.

I like the size of the board, and the layout isn't bad, but I've been using a Belkin ADB-USB adapter connected to a Windows computer, so the lack of some keys and no ability to program layers has gotten annoying. Hasu's converter will sort that right out. :D

Post Reply

Return to “Workshop”