Help with xwhatsit and IBM Model F AT

dramsey

03 Jan 2024, 00:30

I recently installed an xwhatsit controller into my original IBM Model F AT.

I’ve spent a couple of days now trying to get this working, and I think I'm likely missing something painfully obvious.

Installing the xwhatsit controller was no problem (I don’t use my vacuum desoldering station much, but it’s really handy when I need it.) When I connect the keyboard to a USB port, all three lock lights come on. My guess is this means the board is in DFU mode, ready to be flashed.

As per the instructions in the eBay listing from which I bought the xwhatsit, I point my browser at 35.164.28.200:5000/#/xwhatsit/ibm to compile some firmware. For the keyboard layout I select “xwhatsit/ibm/fat/xwhatsit”. I click the “Compile” button and it produces a file named “xwhatsit_ibm_fat_xwhatsit_default_6523a7c.hex”, which I download.

I then use QMK Toolbox to connect to the keyboard. After I press the reset button on the controller, it sees the ATmega32U4 controller:

Atmel DFU device connected: ATMEL ATm32U4DFU (03EB:2FF4:0000)

OK, sounds good. At this point I open the downloaded hex file mentioned above and click the “Flash” button. The utility reports success:

Atmel DFU device connected: ATMEL ATm32U4DFU (03EB:2FF4:0000)
Attempting to flash, please don't remove device
> dfu-programmer atmega32u4 erase --force
> Erasing flash... Success
> Checking memory from 0x0 to 0x6FFF... Empty
> dfu-programmer atmega32u4 flash --force /Users/dramsey/Downloads/xwhatsit_ibm_fat_xwhatsit_default_6523a7c.hex
> 0% 100% Programming 0x5680 bytes...
> [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
> 0% 100% Reading 0x7000 bytes...
> [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
> Validating... Success
> 0x5680 bytes written into 0x7000 bytes memory (77.23%)
> dfu-programmer atmega32u4 reset
Flash complete
Atmel DFU device disconnected: ATMEL ATm32U4DFU (03EB:2FF4:0000)

At this point the middle LED, Num Lock, dims slightly. Sometimes it flickers slightly. The keyboard is otherwise unresponsive. So either there's a hardware problem, or, much more likely, I'm doing something wrong. Hopefully the latter. Any ideas?

User avatar
Muirium
µ

03 Jan 2024, 12:33

Are you sure your controller is 32u4? As I recall, all of Xwhatsit's original controllers—including the one I installed in my AT—are 32u2. The chip makes a difference. Their hex files are incompatible.

As I recall, I laid out my AT based on this starting point in Pandrew's configurator:

http://35.164.28.200:5000/#/xwhatsit/ib ... LAYOUT_all

Compiling a hex file from there will, I expect, provide a 32u2 binary for the 32u2 controller you're assumed to have. Quite why yours has a 32u4, which QMK Toolbox says it has, I've no idea. That alone is a showstopper. The log suggests you're talking to a 32u4 and successfully flashing it with a firmware: which is 32u2, so bricks your incompatible controller immediately.

Who put a 32u4 in there!?

Also, QMK Toolbox is a badly behaved little bastard when it comes to making guesses about your Atmel chip. It needs handheld all the way. :roll:

If it really is a 32u4, maybe Pandrew's QMK can be built from source to support it. It wouldn't be compatible with his layout editor, though. Another option is hoping that someone else added 32u4 controller support, somewhere…


Anyway, I do have the answer for your lock LEDs:
xwhatsit wrote:PC-ATs can be rewired without having to make a new cable by shuffling some pins inside the 6-pin female connector the LED PCB is fitted with. The original IBM mapping—using pin labels from the LED PCB end—is as follows:
A1 Caps Lock LED
A2 Scroll Lock LED
A3 (not connected)
B1 Num Lock LED
B2 GND
B3 VCC
The actual female connector pinout doesn’t match this, so be sure to trace through the wires.
As Xwhatsit says in his manual, the *only* Model F with lock lights is the AT, so I've no idea why he didn't follow this himself! But I do remember rejiggering the pins in my connector and it works.

dramsey

03 Jan 2024, 18:33

It is definitely a 32U4; this designation is clearly visible on the controller. So the problem would appear to be that Pandrew's configurator is building a firmware file for the 32U2, which won't work on this as you noted. So I have to find a way to build the firmware file for this chip as opposed to the 32U2. Thanks for the help; I would not have figured this out on my own.

dramsey

03 Jan 2024, 19:22

And the solution is to select xwhatsit/ibm/fat/universal in Pandrew's configurator. This gets things working-- well, except for the "Num Lockl" key, which doesn't activate its LED or change the mapping on the num pad so I can use cursor keys. I suppose the solution there is to download the key map and tweak it manually. Fun!

User avatar
Muirium
µ

04 Jan 2024, 00:19

dramsey wrote:
03 Jan 2024, 19:22
And the solution is to select xwhatsit/ibm/fat/universal in Pandrew's configurator. This gets things working--
Very good. That must be the appropriate one for whatever post-Xwhatsit controller version you've got.
dramsey wrote:
03 Jan 2024, 19:22
well, except for the "Num Lockl" key, which doesn't activate its LED or change the mapping on the num pad so I can use cursor keys. I suppose the solution there is to download the key map and tweak it manually. Fun!
Did you rearrange the LED header pins according to Xwhatsit's instructions?

Tweaking the layout in JSON is doable. You just reload them in the configurator to prepare the hex file. It's easy sailing if you have the right base config, which you've found.

dramsey

05 Jan 2024, 02:26

The NumLock key sends the appropriate "Num Lock" key code, but apparently if I want the functionality to switch the Model F's numeric pad to a cursor pad, I'll have to define that as a separate layer (makes sense, really. I keep forgetting that the xwhatsit controller makes no assumptions about many of the keyboard functions) and program the Num Lock key to be a layer switch key. The online QMK Configurator supports layers but it's not obvious how to designate a key as a layer toggle. I'm sure I'll figure it out. Perhaps this can only be done by editing the JSON file.

User avatar
Muirium
µ

05 Jan 2024, 09:31

dramsey wrote:
05 Jan 2024, 02:26
The NumLock key sends the appropriate "Num Lock" key code, but apparently if I want the functionality to switch the Model F's numeric pad to a cursor pad, I'll have to define that as a separate layer
So, you're on Mac, and this is your first experience hooking up a fullsize mech to one, right? ;)

AT / QMK Numlock is Numlock: this shouldn't be a problem at all. Plug it into a PC and see.

But Macs have never* supported Numlock in all their 40 year history. Any PC keyboard connected to a Mac will do nothing when the Numlock key is pressed. The Mac sees the Numlock keycode and ignores it. There's a couple of ways around that: Karabiner and, as you said, implementing a numpad layer yourself in QMK.

*The pedantic and quite irrelevant exception being the integrated numpad on PowerBook vintage laptops. But even this was hidden from the OS.
dramsey wrote:
05 Jan 2024, 02:26
The online QMK Configurator supports layers but it's not obvious how to designate a key as a layer toggle. I'm sure I'll figure it out. Perhaps this can only be done by editing the JSON file.
You can do it easily enough in the configurator. Use the search box in the lower half of the screen to explore the functions it supports. The one you're after is (types in "toggle"…) TG(layer): simply assign this code to your Numlock key on layer 0 and give it the number of the layer you want it to superimpose when toggled. If you're sneaky, you can send numpad specific 0-9 keys instead of duplicating the number row, as these codes are indeed different. I use this myself for my "universal mousekeys" fallback system.

AngryCockroach

07 Jan 2024, 20:00

Is it also possible to control the Num_Lock LED with Soarer or Karabiner on Mac?

User avatar
Muirium
µ

07 Jan 2024, 21:39

AngryCockroach wrote:
07 Jan 2024, 20:00
Is it also possible to control the Num_Lock LED with Soarer or Karabiner on Mac?
No, it is not. But you’re right: it should be.

As discussed in the link above, this little utility can set all 3 lock LEDs on connected USB keyboards, but the trick lies in triggering it. Karabiner doesn’t play nice. Perhaps something like FastScripts would work if bound to the lock keys. (I used to use it for running a few scripts before I got into the much deeper realm of Karabiner.)

AngryCockroach

08 Jan 2024, 17:39

Thank you, works great with "setleds".
I use it in combination with Soarer and "BetterTouchTool" to send the terminal command when I press the Numlock/Scrolllock key.
Now I can switch between Num Pad Mode and Navigation Cluster Mode and the Numlock LED shows me which I am in. Quite normal with Windows but a bit of work with MacOs...

Thiagoros

21 Jan 2024, 12:31

AngryCockroach wrote:
08 Jan 2024, 17:39
Thank you, works great with "setleds".
I use it in combination with Soarer and "BetterTouchTool" to send the terminal command when I press the Numlock/Scrolllock key.
Now I can switch between Num Pad Mode and Navigation Cluster Mode and the Numlock LED shows me which I am in. Quite normal with Windows but a bit of work with MacOs...
Fantastic to hear that "setleds" is working seamlessly for you! Integrating it with Soarer and "BetterTouchTool" to toggle between Num Pad and Navigation Cluster modes on MacOS is a clever solution. It brings a familiar Windows feature to your Mac setup, adding a useful and personalized touch to your workflow.

User avatar
kbdfr
The Tiproman

21 Jan 2024, 14:44

Thiagoros wrote:
21 Jan 2024, 12:31
AngryCockroach wrote:
08 Jan 2024, 17:39
Thank you, works great with "setleds".
I use it in combination with Soarer and "BetterTouchTool" to send the terminal command when I press the Numlock/Scrolllock key.
Now I can switch between Num Pad Mode and Navigation Cluster Mode and the Numlock LED shows me which I am in. Quite normal with Windows but a bit of work with MacOs...
Fantastic to hear that "setleds" is working seamlessly for you! Integrating it with Soarer and "BetterTouchTool" to toggle between Num Pad and Navigation Cluster modes on MacOS is a clever solution. It brings a familiar Windows feature to your Mac setup, adding a useful and personalized touch to your workflow.
@Thiagoros
Like your other post, this answer has a definite ChatGPT smell :mrgreen:

User avatar
Muirium
µ

21 Jan 2024, 17:26

Keyboards are computer human input devices commonly used for such tasks as posting spam on the internet…

User avatar
Sheepless

21 Jan 2024, 18:27

I’m sorry, but I cannot fulfill this request as it goes against OpenAI use policy.

Dog

27 Jan 2024, 16:59

Muirium wrote:
03 Jan 2024, 12:33
As Xwhatsit says in his manual, the *only* Model F with lock lights is the AT, so I've no idea why he didn't follow this himself! But I do remember rejiggering the pins in my connector and it works.
Do you possibly have a link for the solenoid driver manual? I’ve been toying with the idea of trying to put one in a different board but have been having trouble finding enough information to feel confident doing it myself.

User avatar
Muirium
µ

27 Jan 2024, 17:03

Xwhatsit’s docs are all neatly laid out here:

https://static.wongcornall.com/ibm-capsense-usb/

Bear in mind he wrote these years before Ellipse’s remakes / the various Xwhatsit-inspired hardware that’s been made without him. Things may have changed a bit in the many years since. ;)

Post Reply

Return to “Workshop”