QMK Powered Equivalent to Soarer’s Converter?

User avatar
Muirium
µ

24 Jul 2022, 12:35

So, thanks to Pandrew I’ve gotten quite into QMK on my IBMs. QMK’s web configurator is quite elegant for defining layouts and many layers. Mouse keys in particular are a nice feature I’d like to bring to all my keyboards, for use in a pinch.

But so how to run QMK on a Teensy as a AT/PS2 to USB converter? Where’s the support for it in the QMK configurator? And where’s the hex file? ;)

I’ve had a look around the QMK website, GitHub etc. and can’t find a straight up AT to USB converter in the project. ADB to USB is there, among other converters, but where is the equivalent to Soarer’s converter? Can I run QMK on a Teensy to convert from AT to USB?

I’ve been running Hasu’s TMK on my Teensy driven ADB converter for a while and like it a lot. Mind, I prefer QMK’s web configurator to TMK’s Unimap so I will try flashing my ADB Teensy with QMK as well.

Image

But what about all those AT boards? Besides the PS/2 converter Teensy above, I’ve internal Teensy converters in some which could really use full QMK configurator goodness. Is this not a thing? I’m perplexed it’s not just right there among the converters. Surely AT is the most popular of all?

User avatar
soyuz

24 Jul 2022, 14:11

My favorite thing about the AEK II is how it has letters on the keycaps.

kelvinhall05

24 Jul 2022, 14:31

I'm not sure why you'd want to use a teensy, the 32u4 it has is quite slow and only has a measly 2.5k of ram. quite unfit for a keyboard controller! I suppose you could bit-bang a clock-divided (7/16ths) bus speed dual-duplex serial port on an stm32 though that could potentially bottleneck the internal ram channel. with optimized firmware it's very likely to be far more efficient than qmk (or, as I like to call it, "poo mk") and use less than 100 BITES of ram, or one "glizzy" as some modern compsci students have taken to calling it. I suggest downloading a recent textbook and giving it a read, it could provide some fascinating information!

kelvinhall05

24 Jul 2022, 14:38

by the way, you could also try rewriting the original firmware on the original controller. assembly is not that hard, you can just watch a 12 minute and 33 second youtube video and it'll tell you all you need to know. for reference, here's the instruction set for the intel 8051, a derivative of which is probably used in the aek:

ACALL - Absolute Call
ADD, ADDC - Add Accumulator (With Carry)
AJMP - Absolute Jump
ANL - Bitwise AND
CJNE - Compare and Jump if Not Equal
CLR - Clear Register
CPL - Complement Register
DA - Decimal Adjust
DEC - Decrement Register
DIV - Divide Accumulator by B
DJNZ - Decrement Register and Jump if Not Zero
INC - Increment Register
JB - Jump if Bit Set
JBC - Jump if Bit Set and Clear Bit
JC - Jump if Carry Set
JMP - Jump to Address
JNB - Jump if Bit Not Set
JNC - Jump if Carry Not Set
JNZ - Jump if Accumulator Not Zero
JZ - Jump if Accumulator Zero
LCALL - Long Call
LJMP - Long Jump
MOV - Move Memory
MOVC - Move Code Memory
MOVX - Move Extended Memory
MUL - Multiply Accumulator by B
NOP - No Operation
ORL - Bitwise OR
POP - Pop Value From Stack
PUSH - Push Value Onto Stack
RET - Return From Subroutine
RETI - Return From Interrupt
RL - Rotate Accumulator Left
RLC - Rotate Accumulator Left Through Carry
RR - Rotate Accumulator Right
RRC - Rotate Accumulator Right Through Carry
SETB - Set Bit
SJMP - Short Jump
SUBB - Subtract From Accumulator With Borrow
SWAP - Swap Accumulator Nibbles
XCH - Exchange Bytes
XCHD - Exchange Digits
XRL - Bitwise Exclusive OR

User avatar
soyuz

24 Jul 2022, 14:59

The AEK II uses this NEC chip that appears to be custom for Apple, I imagine it's probably quite similar to other NEC keyboard controller chips though (which IIRC are based on Intel ones)
Attachments
IMG_2804.jpeg
IMG_2804.jpeg (1.76 MiB) Viewed 78734 times

nobatron

24 Jul 2022, 15:04

Have you considered the Griffin iMate? You can usually pick them up pretty cheap used (around £100 plus shipping).

User avatar
fohat
Elder Messenger

24 Jul 2022, 15:26

I think that somebody here started making something much better and cheaper than the iMate.

User avatar
Muirium
µ

24 Jul 2022, 16:09

I shouldn’t have confused things with the AEK pic. I picked that photo for the line of Teensy converters I’d just made, lined up on top of it, but it’s gotten the topic crossed. :P

What I’m talking about is an AT / PS/2 converter for my many non-Apple keyboards. Straight up Soarer’s Converter equivalent in QMK?

The AEK is already a QMK target. That’s a solved problem. What I’m scratching my head about is where is the AT converter target for QMK configurator? Has no one tried something this obvious before? I hope so. Because if it lands on me to do it, I’ll fuck it up. :lol:

User avatar
snacksthecat
✶✶✶✶

24 Jul 2022, 16:51

I know you’re looking for a QMK solution but when you said you prefer its configurator to TMK unimap are you talking about editing the raw keymap file or using Hasu’s web editor. I might be pointing out the obvious but TMK has a pretty capable web editor that I think might serve your needs.

http://www.tmk-kbd.com/tmk_keyboard/editor/

User avatar
Muirium
µ

24 Jul 2022, 17:23

Yeah, I know TMK’s editor all right. ;)
Muirium wrote:
16 Jul 2022, 14:18
A finicky layer-logic question here! :roll:
Image
I like it. But I prefer QMK’s approach: better icons, deeper layer functions exposed, and much wider hardware support. I can only configure my HHKBs with Unimap. Even those ADB and NeXT converters I built with Teensies running TMK weren’t supported; I had to map them by compiling firmware from source.

User avatar
snacksthecat
✶✶✶✶

24 Jul 2022, 18:47

OK take what I say with a grain of salt, because I haven't tried it myself and I'm just jamming puzzle pieces together in my head...

Someone made a port of Hasu's IBMPC_USB converter to QMK:
https://github.com/marfrit/qmk_firmware ... c_usb_port

There exists a configurator from Keebio called VIA, which allows you to change your keymap without reflashing.
It seems to have some support for vanilla QMK firmware (?), if the firmware is built with the "VIA_ENABLE" parameter enabled.
https://docs.keeb.io/via-technical
Parts of VIA
VIA consists of two parts: Firmware and VIA Configurator.

The firmware is for the most part QMK with the VIA_ENABLE feature enabled. Note that by default, most keyboards do not have the VIA_ENABLE feature enabled. See below for a list of supported keyboards and the firmware files to use.

VIA Configurator is a desktop app that talks to your VIA-enabled keyboard and allows you to remap keys on-the-fly, as well as toggling layout options, programming macros, and controlling lighting.
So that leaves a few questions:
  • Does the port of Hasu's IBMPC converter actually work?
  • Does VIA meet your needs?
  • Is it possible to build the QMK port of Hasu's IBMPC firmware with VIA_ENABLE?
  • If so, will VIA recognize the keyboard?
Someone wiser than I can probably help answer some of these questions.

Edit: Reading more, it sounds conceptually possible but not at all simple :(

User avatar
Muirium
µ

24 Jul 2022, 21:21

I like your inventive line of thought! I’ve only ever dabbled with VIA though so those questions are definitely far beyond me. I didn’t like the big local app approach of VIA. Prefer a lightweight flasher like QMK Toolbox, myself.

Hasu has a PS/2 converter, as well as ADB and the other converters on QMK Configurator’s menu. I’m really surprised it’s not there on QMK. Who doesn’t have an AT board (or twenty) to convert? Expected it to be the top choice! :D

User avatar
snacksthecat
✶✶✶✶

24 Jul 2022, 21:49

Show me a round hole and I'll hand you a square peg any day of the week :lol:

+1 on a basic AT converter in QMK. That really is a weird gap.

User avatar
Muirium
µ

24 Jul 2022, 22:34

Here’s my feature request for this on GitHub. Feel free to +1 that, y’all. ;)

User avatar
mmm

24 Jul 2022, 22:41

snacksthecat wrote:
24 Jul 2022, 18:47
OK take what I say with a grain of salt, because I haven't tried it myself and I'm just jamming puzzle pieces together in my head...

Someone made a port of Hasu's IBMPC_USB converter to QMK:
https://github.com/marfrit/qmk_firmware ... c_usb_port

There exists a configurator from Keebio called VIA, which allows you to change your keymap without reflashing.
It seems to have some support for vanilla QMK firmware (?), if the firmware is built with the "VIA_ENABLE" parameter enabled.
https://docs.keeb.io/via-technical
Parts of VIA
VIA consists of two parts: Firmware and VIA Configurator.

The firmware is for the most part QMK with the VIA_ENABLE feature enabled. Note that by default, most keyboards do not have the VIA_ENABLE feature enabled. See below for a list of supported keyboards and the firmware files to use.

VIA Configurator is a desktop app that talks to your VIA-enabled keyboard and allows you to remap keys on-the-fly, as well as toggling layout options, programming macros, and controlling lighting.
So that leaves a few questions:
  • Does the port of Hasu's IBMPC converter actually work?
  • Does VIA meet your needs?
  • Is it possible to build the QMK port of Hasu's IBMPC firmware with VIA_ENABLE?
  • If so, will VIA recognize the keyboard?
Someone wiser than I can probably help answer some of these questions.

Edit: Reading more, it sounds conceptually possible but not at all simple :(
Okay I can provide you with a bit more info on that fork. It used for a PR on QMK, but was never merged to the mainline, as it required quite a bit of additional work before being ready. (link)

Sometime over a year ago I used the fork to get an F XT up and running. As I remember, I had to do some work to get it working, but I don't think it was a lot (copy some keymap from TMK maybe?). It worked nicely. I haven't tested it with ps2, but my initial guess is that it would be slightly the same.

Slightly irrelevant: What didn't work however was adding a solenoid, as the keycode scanner essentially replaces the loop that QMK uses to process keypresses and run the Quantum part. And the solenoid stuff is part of the quantum part, and adding that in with a bit of dodgy code created issues with the keycode scanning (the solenoid signal would somehow put the original code in an error state).
Muirium wrote:
24 Jul 2022, 22:34
Here’s my feature request for this on GitHub. Feel free to +1 that, y’all. ;)
Now we can just cross our fingers that someone with the resources and time is motivated to do this :D

User avatar
Muirium
µ

25 Jul 2022, 22:50

The weird thing is TMK already has a PS/2 converter right in the same /converter directory as the ADB and other converters QMK and QMK Configurator currently support:

https://github.com/tmk/tmk_keyboard/tre ... er/ps2_usb

Why did they skip over that one? The one with a hundred users for every ADB, hp46010a and M0110 user out there! They’ve even got XT. C’mon: this is what the Configurator was made for!

User avatar
dotdash

26 Jul 2022, 15:34

One of the reasons I haven't paid that much attention to QMK is that it's focus seems to be replacing the controller firmware for modern custom keyboards. The project page doesn't mention using it as a converter for vintage boards, so I expect this is not something the developers have much interest in.

User avatar
Muirium
µ

27 Jul 2022, 22:57

Yeah. QMK Configurator does already support a few converters though, which is why I’m asking. Regular old AT / PS/2 is surely dominant!

I could do what I want to do with TMK, but Hasu’s Unimap doesn’t support Teensies running TMK.
TMK wrote:• PS/2-USB Converter [ info | code | buy ]
TMK Converter rev.2(ATmega32U2): [ Full-key ]
TMK Converter rev.1(ATmega32U4): [ Full-key ] (This is not compatible to DIY Conveter.)
Use newer IBMPC-USB converter firmware instead.
TMK wrote:• IBMPC-USB Converter [ info | code | buy ]
TMK Converter[PS/2](ATmega32U2): [ Full-key | 83-key XT | 84-key AT | 122-key Terminal ]
TMK Converter[AT/XT, Terminal](ATmega32U4): [ Full-key | 83-key XT | 84-key AT | 122-key Terminal ]
DIY Converter(AT90USB1286): [ Full-key | 83-key XT | 84-key AT | 122-key Terminal ]
You have to hard code your layouts and build from source if you’re using your own 32u4 hardware (aka Teensy 2 and Pro Micro). Unimap only supports his own converters. (Unless I’m reading it wrong and maybe this is the one I need? I’ll give it a shot.)

I’ve already all the hardware in place (running Soarer for years) but want a GUI instead of redefining everything in source. Been there with my AEK and don’t much like it.

User avatar
Muirium
µ

28 Jul 2022, 00:30

Nah, TMK Unimap's not working with my plain Teensy 2. I made this provisional layout here: note the mouse keys on the numpad. Unimap gave me a hex file, which I tried to flash onto the keyboard (an AT protocol NMB RT8255C+ with black space invaders and a Teensy running Soarer's Converter installed inside) using QMK Toolbox. Here's the log as I ran scboot to put the Teensy into bootloader:

Code: Select all

HID console disconnected: Soarer Soarer's Keyboard Converter (16C0:047D:0100)
HalfKay device connected: (null) (null) (16C0:0478:0120)
Attempting to flash, please don't remove device
> teensy_loader_cli -mmcu=atmega32u4 /Users/muirium/Downloads/unimap.hex -v
HalfKay device disconnected: (null) (null) (16C0:0478:0120)
> Teensy Loader, Command Line, Version 2.2
> Read "/Users/muirium/Downloads/unimap.hex": 24560 bytes, 76.1% usage
> Found HalfKay Bootloader
> Programming................................................................................................................................................................................................
> Bootin
Flash complete
HID console connected: TMK IBM PC keyboard converter (FEED:1BEE:0201)
> TMK:56e88e/LUFA:d6a7df
> SB configured.
> Loop start.
> I250A5501 wFF isr:C000 A5501 wFF R R R R R R R R R R 
> 6220 ERR:11 ISR:8000 X6721 X6722 
> 22049 ERR:20 ISR:C000 E22050 I22050 
> 22052 PRT:22 ISR:B2C0 rB2 
> 22126 ERR:20 ISR:D000 E22127 I22127 
> 22129 PRT:22 ISR:E0C0 rE0 rCB A25129 wFF isr:D400 X25630 
> 27034 ERR:20 ISR:C000 E27034 I27035 
> 27037 PRT:22 ISR:34C0 r34 
> 27123 ERR:20 ISR:9000 E27124 I27124 
> 27126 PRT:22 ISR:E0C0 rE0 rD3 
> 28018 ERR:20 ISR:8400 E28018 I28019 
> 28021 PRT:22 ISR:34C0 r34 
> 28180 ERR:20 ISR:9000 E28181 I28181 
> 28183 PRT:22 ISR:E0C0 rE0 rD3 A31183 wFF isr:8400 X31684 
> 34311 ERR:20 ISR:C000 E34311 I34312 
> 34314 PRT:22 ISR:22C0 r22 
> 34449 ERR:20 ISR:D000 E34450 I34450 
Unfortunately, the keyboard's currently inoperable. All keystrokes show up in the hid_listen log as those errors you see after the flash. Something's very wrong. Guess I'll try to get it back into the bootloader and fallback to Soarer's.

Edit:
Oh, actually, what do we have here? Quite to my surprise it's working now, after a simple disconnect/reconnect. Haha, nice one TMK! Look's like Unimap's got my back after all. 8-)

Edit Edit:
Hmm. Can't seem to make the Shift + Shift + Pause → bootloader "Magic" key combo work, which means a bunch of screws have to come out so I can press the Teensy's button for myself. Dunno what's going on there. But other than that: it's going good. :D

User avatar
snacksthecat
✶✶✶✶

28 Jul 2022, 00:40

I’ve been following your painful journey and so badly want to help :(

Here’s another one of my half baked ideas: the configurator itself is open source. Can you run it locally? and does anyone have an idea how easy hard it is to add a new keyboard? Like, would it be feasible to simply add that IBMPC_USB port I mentioned earlier to the configurator and run it locally with that one addition? Or is it non-trivial to add a new board? Help, someone!

https://github.com/qmk/qmk_configurator

User avatar
Muirium
µ

28 Jul 2022, 01:23

Hey Snacks! I've been getting somewhere with TMK after all. Shift + Shift + Pause still doesn't enter bootloader. But I've got a working kludge…

Right now, this is my layout in Unimap. Check the funky BTLD key in Layer 2 (the only function layer I'm using; L1 is pre-populated with HHKB stuff I don't need on this fullsize keyboard).

I've put a toggle on the numpad to go between mouse keys and normal numbers mode, just by pressing Num Lock of course, which also sneakily converts the Pause key to instant BOOTLOADER when I press it. Surprisingly, this works! It's not a permanent solution—a key that makes your keyboard vanish is a touch disruptive—but it's a reliable enough hack that I can screw the case back on and stop bothering my Teensy. Phew! :lol:

I think you're right about QMK. I'm not technical enough to be able to wrangle that, however, so TMK will suffice. QMK still has advantages: especially the ability to choose between physical keyboard layouts in the editor. I've had to mark all sorts of keys as blank for this converter, which is silly as it's permanently paired with this one keyboard. It should really present the same layout in the editor as I have in front of me here, Big Ass Enter and all.

User avatar
snacksthecat
✶✶✶✶

29 Jul 2022, 03:06

I'm glad you've found a happy workable medium!

For anyone wondering how to add a default keyboard to their own QMK Configurator fork, I've found the instructions:
https://docs.qmk.fm/#/reference_configurator_support

At a glance it looks like something that I would sink a ton of time into and become very frustrated by my failure.

As an exercise in insanity, I may try to build the IBMPC_USB QMK port with VIA support and get that running, since it seems more doable for me. The instructions for adding VIA support are here (mostly posting this for my own reference):
https://www.caniusevia.com/docs/configuring_qmk

On the off chance I ever try one of these things and am successful, you'll be the first person to hear about it. But it's far more likely that your pull request gets implemented before I accomplish either thing (i.e. ever).

User avatar
snacksthecat
✶✶✶✶

30 Jul 2022, 17:58

I made some progress on using the QMK IBMPC_USB port with VIA.

Here are the bullet points:
  • The ported firmware builds fine with the default keymap and promicro target
  • The ported firmware works correctly when I tested it with an AT keyboard
  • The port already includes a keymap with VIA support, so no need to do all that configuration/modification work
  • BUT, the dynamic keymap option uses more EEPROM than is available on the 32U4, so it does not build for the promicro/teensy configuration
  • Double BUT, it also has a configuration for building the firmware for the Blackpill-F401 development board
  • The firmware builds successfully with the Blackpill-F401 configuration and the VIA keymap
So I'm going to order a couple of Blackpill-F401 boards and see if I can make this thing chooch with VIA.

User avatar
Muirium
µ

30 Jul 2022, 19:13

Cool. Does this port work with QMK Configurator? Even a local copy? If that’s a thing.

User avatar
snacksthecat
✶✶✶✶

30 Jul 2022, 21:38

Muirium wrote:
30 Jul 2022, 19:13
Cool. Does this port work with QMK Configurator? Even a local copy? If that’s a thing.
Almost certain it's possible to add it as a keyboard to QMK Configurator (see my post above), but above my skill level I'm assuming.

I know you already have an arsenal of teensy built converters so the idea of using a different dev board is probably a turn off for you.

Also I realize your original goal was to use it with QMK Configurator and not VIA. Just thinking that they probably offer roughly the same functionality (except with VIA you wouldn't need to reflash every time you make a change).

User avatar
snacksthecat
✶✶✶✶

31 Jul 2022, 05:45

Update on getting getting this working with QMK Configurator...

I was able to fork the QMK Configurator web app repo and get my copy of it deployed to heroku. Next I'll see if I can add the ported version of the IBMPC_USB converter added as a keyboard to my forked repo and see if it works.

Link on how to do that again for reference:
https://docs.qmk.fm/#/reference_configurator_support

Edit: I missed the mark totally. It's not just the configurator, which is only a front end. The whole web stack project would need to be forked to point to a different repo. That includes the part that does the actual compiling of the firmware.
https://github.com/qmk/qmk_web_stack

User avatar
Muirium
µ

31 Jul 2022, 15:03

Thanks for your attempted assistance, Snacks. I know how you feel. This layer-cake upon layer-cake is a bit much for me, too. :lol:
snacksthecat wrote:
30 Jul 2022, 21:38
I know you already have an arsenal of teensy built converters so the idea of using a different dev board is probably a turn off for you.
Correct. But I do have another keyboard which may be better suited to your line of attack. How about running a QMK controller on one of these?

Image

Not a Teensy but a Colossus by Phosphorglow. (A long unsupported and quite forgotten drop-in USB replacement controller for IBM Model Ms.) I have one in my good SSK, which I've been running Soarer's Controller on for many years. I believe it's an Atmel AT90USB1286 rather than the Teensy 2's 32u4. Soarer has firmwares for both.

As Colossus is a controller, it drives the Model M matrix directly. Phosphorglow has matrix maps (and pin assignments) on his website. The relevant one being this:

Image

Now, I'm such a QMK rube (beyond Pandrew on Xwhatsit hardware) that I don't even know how to assign controller pins and such. Searching the supported keyboard list on QMK Configurator brings up this similar controller for Model Ms but it runs on the STM32 MCU which is completely different silicon as I understand. If you know your way around QMK well enough now, I'd like to run that (or comparable) on my Colossus! Bonus points if it's Configurator friendly! ;)

If there's already support for Colossus on mainline QMK Configurator, tell me all about it. That'd be ideal!

kelvinhall05

31 Jul 2022, 17:37

del
Last edited by kelvinhall05 on 31 Jul 2022, 21:16, edited 1 time in total.

User avatar
Muirium
µ

31 Jul 2022, 18:17

kelvinhall05 wrote:
31 Jul 2022, 17:37
ur mum's a colossus
She died of thyroid cancer in middle age a few years ago.

I hope yours is well.

kelvinhall05

31 Jul 2022, 21:16

Muirium wrote:
31 Jul 2022, 18:17
kelvinhall05 wrote:
31 Jul 2022, 17:37
ur mum's a colossus
She died of thyroid cancer in middle age a few years ago.

I hope yours is well.
I'm sorry to hear that. Having lost both my grandfathers to cancer (one skin, one brain) I know how much it hurts. Apologies for any hurt from my cheap jab.

Post Reply

Return to “Workshop”