OK, I finished my replacement controller for the battleship. Hooray! The Blackpill-based setup works. There are some hurdles, but they can be overcome.
If using GPIO A10 for the matrix, it needs an additional external pull-up resistor. This has already been planned into the schematics for the replacement controller I based this on (
), so no problem. Just put 4.7 kΩ between A10 and +3V, for example.
For the indicator LEDs, some non-optimal GPIOs must be used. I finally chose A9, A13, and A14. A13/A14 would be used for debugging, but are not required at all. A9 has an internal pull-down resistor, forcing me to connect the LEDs between the GPIOs and ground, lighting them with a high signal. No problem, except that the original LEDs are connected to +5V and light on a low signal. They are thus installed the wrong way around. This means that the original LEDs are not usable with this new controller. That meant installing my own replacement LEDs (pictures below, it looks like a hack when the keyboard is open, but when it’s closed no one’s the wiser).
I decided to hand solder onto one of those epoxy boards with premade hole grids and copper contacts (no idea what they are called in English). Here’s the rough plan:
I also fixed a short male USB C to female A cable on the controller board and thus had to rearrange the parts for the LEDs on the right side. Improvised it a bit:
I did install potentiometers for the LEDs to be able to control the brightness to my liking. I also used 100 Ω resistors as fail-safes to avoid burning out the LEDs if turning the potentiometers too far (that did happen to me more than once on different projects).
Since I had to use replacement LEDs anyway, I went with red for the novelty. I also made daughterboards with green, yellow, and blue LEDs so I can change this if I feel like it later.
It also turns out that the matrix of my keyboard (which is the PC compatible one, called PS/2 Host Connected Keyboard by IBM, and Type IV by sharktastica) is different than the one used in the model that’s upstream in QMK. I assume that those are for the more common terminal models. I attached the modified info.json if anybody has a similar keyboard.
Code: Select all
{
"usb": {
"device_version": "0.0.2"
},
"matrix_pins": {
"cols": ["B9", "B8", "B7", "B6", "B5", "B4", "B3", "A15", "A5", "A6", "A10", "A7", "A8", "B15", "B14", "B13", "B12", "B10", "B1", "B0"],
"rows": ["C13", "C14", "C15", "A0", "A1", "A2", "A3", "A4"]
},
"indicators": {
"on_state": 1,
"num_lock": "A13",
"caps_lock": "A9",
"scroll_lock": "A14"
},
"diode_direction": "ROW2COL",
"processor": "STM32F401",
"bootloader": "stm32-dfu",
"board": "BLACKPILL_STM32_F401",
"layouts": {
"LAYOUT_type4": {
"layout": [
{"matrix": [7, 9], "x": 3.25, "y": 0},
{"matrix": [6, 9], "x": 4.25, "y": 0},
{"matrix": [6, 8], "x": 5.25, "y": 0},
{"matrix": [5, 9], "x": 6.25, "y": 0},
{"matrix": [4, 9], "x": 7.25, "y": 0},
{"matrix": [4, 8], "x": 8.25, "y": 0},
{"matrix": [3, 9], "x": 9.25, "y": 0},
{"matrix": [2, 9], "x": 10.25, "y": 0},
{"matrix": [2, 8], "x": 11.25, "y": 0},
{"matrix": [1, 9], "x": 12.25, "y": 0},
{"matrix": [0, 9], "x": 13.25, "y": 0},
{"matrix": [0, 8], "x": 14.25, "y": 0},
{"matrix": [7, 8], "x": 3.25, "y": 1},
{"matrix": [7, 10], "x": 4.25, "y": 1},
{"matrix": [6, 10], "x": 5.25, "y": 1},
{"matrix": [5, 8], "x": 6.25, "y": 1},
{"matrix": [5, 10], "x": 7.25, "y": 1},
{"matrix": [4, 10], "x": 8.25, "y": 1},
{"matrix": [3, 8], "x": 9.25, "y": 1},
{"matrix": [3, 10], "x": 10.25, "y": 1},
{"matrix": [2, 10], "x": 11.25, "y": 1},
{"matrix": [1, 8], "x": 12.25, "y": 1},
{"matrix": [1, 10], "x": 13.25, "y": 1},
{"matrix": [0, 10], "x": 14.25, "y": 1},
{"matrix": [4, 1], "x": 0, "y": 3},
{"matrix": [3, 14], "x": 1, "y": 3},
{"matrix": [4, 2], "x": 2.25, "y": 3},
{"matrix": [5, 2], "x": 3.25, "y": 3},
{"matrix": [5, 3], "x": 4.25, "y": 3},
{"matrix": [5, 4], "x": 5.25, "y": 3},
{"matrix": [5, 6], "x": 6.25, "y": 3},
{"matrix": [4, 6], "x": 7.25, "y": 3},
{"matrix": [4, 7], "x": 8.25, "y": 3},
{"matrix": [5, 7], "x": 9.25, "y": 3},
{"matrix": [5, 13], "x": 10.25, "y": 3},
{"matrix": [5, 11], "x": 11.25, "y": 3},
{"matrix": [5, 12], "x": 12.25, "y": 3},
{"matrix": [4, 12], "x": 13.25, "y": 3},
{"matrix": [4, 13], "x": 14.25, "y": 3},
{"matrix": [5, 14], "x": 15.25, "y": 3, "w": 2},
{"matrix": [4, 16], "x": 17.5, "y": 3},
{"matrix": [4, 18], "x": 18.5, "y": 3},
{"matrix": [4, 19], "x": 19.5, "y": 3},
{"matrix": [1, 17], "x": 20.75, "y": 3},
{"matrix": [1, 16], "x": 21.75, "y": 3},
{"matrix": [1, 19], "x": 22.75, "y": 3},
{"matrix": [0, 19], "x": 23.75, "y": 3},
{"matrix": [4, 3], "x": 0, "y": 4},
{"matrix": [3, 1], "x": 1, "y": 4},
{"matrix": [2, 2], "x": 2.25, "y": 4, "w": 1.5},
{"matrix": [3, 2], "x": 3.75, "y": 4},
{"matrix": [3, 3], "x": 4.75, "y": 4},
{"matrix": [3, 4], "x": 5.75, "y": 4},
{"matrix": [3, 6], "x": 6.75, "y": 4},
{"matrix": [2, 6], "x": 7.75, "y": 4},
{"matrix": [2, 7], "x": 8.75, "y": 4},
{"matrix": [3, 7], "x": 9.75, "y": 4},
{"matrix": [3, 13], "x": 10.75, "y": 4},
{"matrix": [3, 11], "x": 11.75, "y": 4},
{"matrix": [3, 12], "x": 12.75, "y": 4},
{"matrix": [2, 12], "x": 13.75, "y": 4},
{"matrix": [2, 13], "x": 14.75, "y": 4},
{"matrix": [5, 17], "x": 16, "y": 4, "w": 1.25, "h": 2},
{"matrix": [4, 17], "x": 17.5, "y": 4},
{"matrix": [5, 18], "x": 18.5, "y": 4},
{"matrix": [5, 19], "x": 19.5, "y": 4},
{"matrix": [3, 17], "x": 20.75, "y": 4},
{"matrix": [3, 16], "x": 21.75, "y": 4},
{"matrix": [3, 19], "x": 22.75, "y": 4},
{"matrix": [3, 18], "x": 23.75, "y": 4},
{"matrix": [2, 1], "x": 0, "y": 5},
{"matrix": [2, 14], "x": 1, "y": 5},
{"matrix": [2, 3], "x": 2.25, "y": 5, "w": 1.75},
{"matrix": [6, 2], "x": 4, "y": 5},
{"matrix": [6, 3], "x": 5, "y": 5},
{"matrix": [6, 4], "x": 6, "y": 5},
{"matrix": [6, 6], "x": 7, "y": 5},
{"matrix": [7, 6], "x": 8, "y": 5},
{"matrix": [7, 7], "x": 9, "y": 5},
{"matrix": [6, 7], "x": 10, "y": 5},
{"matrix": [6, 13], "x": 11, "y": 5},
{"matrix": [6, 11], "x": 12, "y": 5},
{"matrix": [6, 12], "x": 13, "y": 5},
{"matrix": [7, 12], "x": 14, "y": 5},
{"matrix": [1, 12], "x": 15, "y": 5},
{"matrix": [5, 15], "x": 18.5, "y": 5},
{"matrix": [2, 17], "x": 20.75, "y": 5},
{"matrix": [2, 16], "x": 21.75, "y": 5},
{"matrix": [2, 19], "x": 22.75, "y": 5},
{"matrix": [2, 18], "x": 23.75, "y": 5},
{"matrix": [6, 1], "x": 0, "y": 6},
{"matrix": [6, 14], "x": 1, "y": 6},
{"matrix": [2, 5], "x": 2.25, "y": 6, "w": 1.25},
{"matrix": [7, 3], "x": 3.5, "y": 6},
{"matrix": [1, 2], "x": 4.5, "y": 6},
{"matrix": [1, 3], "x": 5.5, "y": 6},
{"matrix": [1, 4], "x": 6.5, "y": 6},
{"matrix": [1, 6], "x": 7.5, "y": 6},
{"matrix": [0, 6], "x": 8.5, "y": 6},
{"matrix": [0, 7], "x": 9.5, "y": 6},
{"matrix": [1, 7], "x": 10.5, "y": 6},
{"matrix": [1, 13], "x": 11.5, "y": 6},
{"matrix": [1, 11], "x": 12.5, "y": 6},
{"matrix": [0, 12], "x": 13.5, "y": 6},
{"matrix": [1, 5], "x": 14.5, "y": 6, "w": 2.75},
{"matrix": [0, 18], "x": 17.5, "y": 6},
{"matrix": [7, 18], "x": 18.5, "y": 6},
{"matrix": [0, 16], "x": 19.5, "y": 6},
{"matrix": [6, 17], "x": 20.75, "y": 6},
{"matrix": [6, 16], "x": 21.75, "y": 6},
{"matrix": [6, 19], "x": 22.75, "y": 6},
{"matrix": [6, 18], "x": 23.75, "y": 6, "h": 2},
{"matrix": [7, 14], "x": 0, "y": 7},
{"matrix": [7, 1], "x": 1, "y": 7},
{"matrix": [3, 0], "x": 2.25, "y": 7, "w": 1.5},
{"matrix": [7, 15], "x": 4.75, "y": 7, "w": 1.5},
{"matrix": [0, 1], "x": 6.25, "y": 7, "w": 7},
{"matrix": [0, 15], "x": 13.25, "y": 7, "w": 1.5},
{"matrix": [1, 0], "x": 15.75, "y": 7, "w": 1.5},
{"matrix": [0, 17], "x": 18.5, "y": 7},
{"matrix": [7, 16], "x": 20.75, "y": 7, "w": 2},
{"matrix": [7, 19], "x": 22.75, "y": 7}
]
}
}
}
That was fun. I will probably also do something similar for my 102 key Model M at some point. I have to disassemble it anyway, the left Ctrl flipper jumped out of its position somehow. I am thinking of getting a speaker and installing it in the speaker hole (because why not, it clearly was meant like this at some point in the 80s
). The matrix is smaller, so I have more GPIOs left over. QMK does support playing some sounds, so it might be nice for annoying people at least.
Edit: BTW, the connectors for the membrane are TE Connectivity / AMP Nos. 5-520315-4 (4 pin), 5-520315-8 (8 pin), 6-520315-6 (16 pin), and 7-520315-0 (20 pin). Maybe that saves someone some time, I didn’t know what they were called and spent some hours searching.