ARM-based IBM Model M USB controller
-
- Location: Serbia
- Main keyboard: IBM Model M
- Main mouse: Logitech M575
- Favorite switch: Matias Quiet Click
Hello there.
I was looking for a replacement controller for my '91 Model M for quite some time and, after some consideration and experimenting, I ended up doing my own project.
I'll keep it short here: it does the job, you can enter or exit bootloader mode with a single button next to the USB connector, it can also be configured to replace all common variations of the original controller. At this time, it's limited to 101/102 key (ANSI and ISO) and SSK keyboards, since they all share the same PCB and membrane configuration. It runs a fork of QMK, which should be a convenient solution.
At this point, I'm waiting for my pull request to be reviewed and (hopefully) merged into QMK repo. Guys maintaining the project seem to be pretty busy (there is ~300 open PRs), so it may take some time. Also I haven't dealt with git before so let's hope I've done everything right. I only occasionally do stuff in Java and Matlab (no, I'm not 90 years old).
I'm planning to open-source the project since it's pretty simple, but not before the firmware is sorted out. That will need a bit of work too, because I haven't documented every change as I went through revisions, schematics need some tidying up, BOM needs to be consolidated etc. I'd also like to write a manual on how to open your keyboard, see what type of controller you need and how to replace it.
And just a disclaimer: I don't want to be a direct competition to the existing Blusb project. This one has less features, and it will be accordingly cheaper to buy or make yourself. If you need BT connectivity, check that one out, it seems great, and it also supports more different types of the Model M.
So, I'm here for any kind of opinions or suggestions, e.g. is this piece of hardware even feasible for selling, are there any ways to make it more useful, is there anything I'm overlooking etc.
Here's the project repo. I definitely have to write a better documentation, but this should do for now.
I'm new here, sorry if I should have introduced myself somewhere beforehand.
I was looking for a replacement controller for my '91 Model M for quite some time and, after some consideration and experimenting, I ended up doing my own project.
I'll keep it short here: it does the job, you can enter or exit bootloader mode with a single button next to the USB connector, it can also be configured to replace all common variations of the original controller. At this time, it's limited to 101/102 key (ANSI and ISO) and SSK keyboards, since they all share the same PCB and membrane configuration. It runs a fork of QMK, which should be a convenient solution.
At this point, I'm waiting for my pull request to be reviewed and (hopefully) merged into QMK repo. Guys maintaining the project seem to be pretty busy (there is ~300 open PRs), so it may take some time. Also I haven't dealt with git before so let's hope I've done everything right. I only occasionally do stuff in Java and Matlab (no, I'm not 90 years old).
I'm planning to open-source the project since it's pretty simple, but not before the firmware is sorted out. That will need a bit of work too, because I haven't documented every change as I went through revisions, schematics need some tidying up, BOM needs to be consolidated etc. I'd also like to write a manual on how to open your keyboard, see what type of controller you need and how to replace it.
And just a disclaimer: I don't want to be a direct competition to the existing Blusb project. This one has less features, and it will be accordingly cheaper to buy or make yourself. If you need BT connectivity, check that one out, it seems great, and it also supports more different types of the Model M.
So, I'm here for any kind of opinions or suggestions, e.g. is this piece of hardware even feasible for selling, are there any ways to make it more useful, is there anything I'm overlooking etc.
Here's the project repo. I definitely have to write a better documentation, but this should do for now.
I'm new here, sorry if I should have introduced myself somewhere beforehand.
- Redmaus
- Gotta start somewhere
- Location: Near Dallas, Texas
- Main keyboard: Unsaver | 3276 | Kingsaver
- Main mouse: Kensington Slimblade
- Favorite switch: Capacitative Buckling Spring
- DT Pro Member: -
- Contact:
Awesome project indeed! Will the kicad files be available for public?
-
- Location: Serbia
- Main keyboard: IBM Model M
- Main mouse: Logitech M575
- Favorite switch: Matias Quiet Click
Thanks!
Sure, I'll probably just zip them and upload them to github. I honestly don't think I can be bothered setting up git on a Windows machine (I'm doing most of my work on a PC, but I use Linux for git and MCU flashing). Again, no point in doing that before the QMK Configurator is set up. And I'll first have to assemble a couple of boards to see if the layout needs any tweaking. For example, default SOT23 footprint in KiCAD has tiny pads which are unnecessarily hard to solder, so I stretched them a bit.
- Redmaus
- Gotta start somewhere
- Location: Near Dallas, Texas
- Main keyboard: Unsaver | 3276 | Kingsaver
- Main mouse: Kensington Slimblade
- Favorite switch: Capacitative Buckling Spring
- DT Pro Member: -
- Contact:
Awesome! I love the USB-B connector, perfect replacement for an SDL cable. Any estimate on cost of materials?poyovimenakafudraga wrote: ↑22 Sep 2020, 23:32Thanks!
Sure, I'll probably just zip them and upload them to github. I honestly don't think I can be bothered setting up git on a Windows machine (I'm doing most of my work on a PC, but I use Linux for git and MCU flashing). Again, no point in doing that before the QMK Configurator is set up. And I'll first have to assemble a couple of boards to see if the layout needs any tweaking. For example, default SOT23 footprint in KiCAD has tiny pads which are unnecessarily hard to solder, so I stretched them a bit.
-
- Location: Serbia
- Main keyboard: IBM Model M
- Main mouse: Logitech M575
- Favorite switch: Matias Quiet Click
Well, it's hard for me to estimate because I've used components from variuos sources, which were bought in different amounts, some parts I already had etc. I should make a nice BOM with multiple sources and prices listed. Also the important factor are the outrageous shipping prices to my country (they went up during the pandemic).
Anyway it shouldn't be too much, even with small amounts and locally bought parts it shouldn't be over 10€ a piece.
To give you an idea, the most expensive part is the PCB itself (if I go to the local manufacturer it would be 5-6€ a board plus some initial tooling fees. Prototype PCBs from China are much cheaper but the shipping is expensive for me).
Only other "expensive" part is the STM32 MCU, it usually goes from 2 to 3€. Other components are under 1€, but they add up a bit.
Anyway it shouldn't be too much, even with small amounts and locally bought parts it shouldn't be over 10€ a piece.
To give you an idea, the most expensive part is the PCB itself (if I go to the local manufacturer it would be 5-6€ a board plus some initial tooling fees. Prototype PCBs from China are much cheaper but the shipping is expensive for me).
Only other "expensive" part is the STM32 MCU, it usually goes from 2 to 3€. Other components are under 1€, but they add up a bit.
-
- Location: Germany
- Main keyboard: Model F77
- Main mouse: Logitech MX Master 3S
- Favorite switch: Alpaca V2
Have you checked JLCPCB.com, individual PCBs with them cost a few cents a piece. They also offer an assembly service which is basically as good as free...poyovimenakafudraga wrote: ↑23 Sep 2020, 00:14Well, it's hard for me to estimate because I've used components from variuos sources, which were bought in different amounts, some parts I already had etc. I should make a nice BOM with multiple sources and prices listed. Also the important factor are the outrageous shipping prices to my country (they went up during the pandemic).
Anyway it shouldn't be too much, even with small amounts and locally bought parts it shouldn't be over 10€ a piece.
To give you an idea, the most expensive part is the PCB itself (if I go to the local manufacturer it would be 5-6€ a board plus some initial tooling fees. Prototype PCBs from China are much cheaper but the shipping is expensive for me).
Only other "expensive" part is the STM32 MCU, it usually goes from 2 to 3€. Other components are under 1€, but they add up a bit.
-
- Location: Serbia
- Main keyboard: IBM Model M
- Main mouse: Logitech M575
- Favorite switch: Matias Quiet Click
Yup, but this board exceeds 100x100mm limit for $2 / 5pcs. And the cheapest shipping option I have is Fedex IP which is $23 if I remember correctly. Anyway, JLC is great for the price, I got the prototype batch from them.Have you checked JLCPCB.com, individual PCBs with them cost a few cents a piece. They also offer an assembly service which is basically as good as free...
- Redmaus
- Gotta start somewhere
- Location: Near Dallas, Texas
- Main keyboard: Unsaver | 3276 | Kingsaver
- Main mouse: Kensington Slimblade
- Favorite switch: Capacitative Buckling Spring
- DT Pro Member: -
- Contact:
Hey! Any update on this project?
-
- Location: Serbia
- Main keyboard: IBM Model M
- Main mouse: Logitech M575
- Favorite switch: Matias Quiet Click
Hey. I'm just gonna throw some photos in.
I got the PCBs just a couple of days ago and the only thing left to do is to finally assemble a whole board and test it out. And, as a bonus task, to figure out how to implement a cheaper secondary MCU (the one that handles resetting the STM32) instead of the Attiny.
I'm glad that anyone finds this interesting, it'll make me finish it after several months of stalling.
I got the PCBs just a couple of days ago and the only thing left to do is to finally assemble a whole board and test it out. And, as a bonus task, to figure out how to implement a cheaper secondary MCU (the one that handles resetting the STM32) instead of the Attiny.
I'm glad that anyone finds this interesting, it'll make me finish it after several months of stalling.
- an_achronism
- Location: Scotland
- Main keyboard: IBM 5150 Personal Computer keyboard (1981)
- Main mouse: Gigabyte GM-M6880X
- Favorite switch: Capacitive buckling spring (IBM F models)
- Contact:
How's this going as of now? Still struggling to source STM32F303s?
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Thought you weren't into USB. I have one of these lying spare, as you know. Runs TMK/QMK as it's Teensy compatible. I used to run Soarer's Controller on it myself.an_achronism wrote: ↑28 May 2021, 07:51How's this going as of now? Still struggling to source STM32F303s?
- an_achronism
- Location: Scotland
- Main keyboard: IBM 5150 Personal Computer keyboard (1981)
- Main mouse: Gigabyte GM-M6880X
- Favorite switch: Capacitive buckling spring (IBM F models)
- Contact:
I'm generally not, but for some reason I fancy sticking a controller replacement into an M just to fiddle with remaps etc. I'll message you, hahah...Muirium wrote: ↑28 May 2021, 10:14Thought you weren't into USB. I have one of these lying spare, as you know. Runs TMK/QMK as it's Teensy compatible. I used to run Soarer's Controller on it myself.an_achronism wrote: ↑28 May 2021, 07:51How's this going as of now? Still struggling to source STM32F303s?
-
- Location: Serbia
- Main keyboard: IBM Model M
- Main mouse: Logitech M575
- Favorite switch: Matias Quiet Click
Yes, there are literally none to be found. All the work was finished ages ago and I have 3 or 4 assembled and working boards, that's how many MCUs I had on hand. I've been lazy about writing the documentation but that's obviously not the biggest problem of this project.an_achronism wrote: ↑28 May 2021, 07:51How's this going as of now? Still struggling to source STM32F303s?
I was thinking about redoing the project around a different MCU but STM32F seemed like such a perfect choice. I coud have chosen F072 instead of F303 but they now have the same availability problem. Also my initial intention was to just retrofit my own keyboard(s), and now that it's done there isn't much of a motivation left to do everything over again. If nothing else, making prototypes isn't cheap at all (although much cheaper than just a couple of years back).
-
- Main keyboard: IBM Model M
I'm reviving this thread. I have about 5 Model Ms, which I would like to give a new lease on life, by giving them an USB interface. (I'll maybe sell some extras - I don't need all 5 of them.) Of course, QMK comes to mind. Starting there, I have found a few candidates, which, unfortunately, use chips or boards that are no longer available. This is what I found (leaving out bluetooth / battery powered solutions):
Model M 101 Teensy2 is based on a Teensy 2 (there is another, which used Teensy++2), which are no longer in production. The current Teensy 4.0 is not (yet) supported by QMK, but as Teensy evolves, so did the price. This platform may no longer be suitable as a keyboard controller.
Model M Type C is based on an AT90USB1286-AU. Nice design, but the PCB is laid out 'wrongly': the USB C connector faces toward the inside and will need an extension cable and something to attach the connector to the opening available. USB C receptacles are generally SMD mounted - not something for a 2 kilogram keyboard. There is no elegant support for the boards that have 12 pin ribbon cables (instead of 8+4 in two connectors).
USB interface for IBM Model M keyboard is based on an ATmega32U4-MU. It eliminates the drawbacks like extra cables and no SMD for the USB connector, but does need two multiplexer 74HC165 chips (which, as I understand, make it impossible to put QMK in programming/flashing mode by using keystrokes).
Model H (with an informative blog entry.) Version 0.2 uses an ATMEGA32U4-AU and a 74HC595 to compensate for the low number of I/O pins on the microcontroller. No support of the 'newer' Model Ms with the 8 and 4 pin leads grouped together in a 20 pin connector.
Yacobo: based on a development board "Blue Pill" with an STM32F103C8T6. The board was developed by LeafLabs, but copied (in China) by numerous others. There are fake ones sold by the usual suspects (eBay, Amazon, AliExpress) but there are also good ones to be had for under € 10. A separate USB programmer to flash a bootloader is needed once (about € 8). This could be built on a piece of development board without needing to order PCBs.
Lastly, there is the one by Nidzo Tomic (aka poyovimenakafudraga on this forum and OP for this thread):
Yugo-M-controller-project which uses a STM32F303. It combines the advantages of the ones listed above, coupled with simplicity (and reliability?). BUT: it seemed dead. I added a comment on an already raised issue on github and Nidzo responded:
I need to re-figure out the PADAUK chip flashing. I made a custom programmer for them, but haven't used it since 2021. That's one of the reasons why compiling the documentation will take some work. That chip is used to switch STM32 into bootloader mode. 'Unconventional' to say the least, but it's cheap and it works.
There could be more work to get it to 'production' state than I hoped. He also had a change of plans: I definitely don't indent to sell the PCBs as I did before. Let's hope he does get around to documenting or at least put the gerber files for the PCB on github. I'm not sure the larger design (the PCB seems higher than most others) will fit most Model Ms.
I went ahead and spent some time on finding parts (in Europe). The 16 pin flexible print connector (6-520415-6 by TE Connectivity) is out of stock with Mouser. Buying stuff from DigiKey is expensive due to import regulations. Buying from TE directly did not work immediately. The rest, including the STMs or Atmels, does not seem to be problem (anymore).
Who else has an Model M sitting on a shelf and would like to upgrade to USB? (And join me to select one of the solutions above and share costs?)
BTW - I'm new here. When it comes to keyboards this explains my love for Model Ms and what I did to extend their lives.
Model M 101 Teensy2 is based on a Teensy 2 (there is another, which used Teensy++2), which are no longer in production. The current Teensy 4.0 is not (yet) supported by QMK, but as Teensy evolves, so did the price. This platform may no longer be suitable as a keyboard controller.
Model M Type C is based on an AT90USB1286-AU. Nice design, but the PCB is laid out 'wrongly': the USB C connector faces toward the inside and will need an extension cable and something to attach the connector to the opening available. USB C receptacles are generally SMD mounted - not something for a 2 kilogram keyboard. There is no elegant support for the boards that have 12 pin ribbon cables (instead of 8+4 in two connectors).
USB interface for IBM Model M keyboard is based on an ATmega32U4-MU. It eliminates the drawbacks like extra cables and no SMD for the USB connector, but does need two multiplexer 74HC165 chips (which, as I understand, make it impossible to put QMK in programming/flashing mode by using keystrokes).
Model H (with an informative blog entry.) Version 0.2 uses an ATMEGA32U4-AU and a 74HC595 to compensate for the low number of I/O pins on the microcontroller. No support of the 'newer' Model Ms with the 8 and 4 pin leads grouped together in a 20 pin connector.
Yacobo: based on a development board "Blue Pill" with an STM32F103C8T6. The board was developed by LeafLabs, but copied (in China) by numerous others. There are fake ones sold by the usual suspects (eBay, Amazon, AliExpress) but there are also good ones to be had for under € 10. A separate USB programmer to flash a bootloader is needed once (about € 8). This could be built on a piece of development board without needing to order PCBs.
Lastly, there is the one by Nidzo Tomic (aka poyovimenakafudraga on this forum and OP for this thread):
Yugo-M-controller-project which uses a STM32F303. It combines the advantages of the ones listed above, coupled with simplicity (and reliability?). BUT: it seemed dead. I added a comment on an already raised issue on github and Nidzo responded:
I need to re-figure out the PADAUK chip flashing. I made a custom programmer for them, but haven't used it since 2021. That's one of the reasons why compiling the documentation will take some work. That chip is used to switch STM32 into bootloader mode. 'Unconventional' to say the least, but it's cheap and it works.
There could be more work to get it to 'production' state than I hoped. He also had a change of plans: I definitely don't indent to sell the PCBs as I did before. Let's hope he does get around to documenting or at least put the gerber files for the PCB on github. I'm not sure the larger design (the PCB seems higher than most others) will fit most Model Ms.
I went ahead and spent some time on finding parts (in Europe). The 16 pin flexible print connector (6-520415-6 by TE Connectivity) is out of stock with Mouser. Buying stuff from DigiKey is expensive due to import regulations. Buying from TE directly did not work immediately. The rest, including the STMs or Atmels, does not seem to be problem (anymore).
Who else has an Model M sitting on a shelf and would like to upgrade to USB? (And join me to select one of the solutions above and share costs?)
BTW - I'm new here. When it comes to keyboards this explains my love for Model Ms and what I did to extend their lives.
-
- Location: Serbia
- Main keyboard: IBM Model M
- Main mouse: Logitech M575
- Favorite switch: Matias Quiet Click
Alrighty, let's get back to work!
I just managed (after some hassle) to fire up the virtual machine from which I did QMK forking and chip programming. That's good news. PADAUK programming won't be a problem. An ATTiny chip can be used instead (see those two jumpers by the SOP8?). The PADAUK is just way cheaper. This secondary chip just sends low/high on the appropriate STM32 pins when the button is pressed. Nothing more than an LED blinker program.
To summarize the current situation:
Let me know what you think – what would be the best course of action?
I just managed (after some hassle) to fire up the virtual machine from which I did QMK forking and chip programming. That's good news. PADAUK programming won't be a problem. An ATTiny chip can be used instead (see those two jumpers by the SOP8?). The PADAUK is just way cheaper. This secondary chip just sends low/high on the appropriate STM32 pins when the button is pressed. Nothing more than an LED blinker program.
To summarize the current situation:
- I have 3 assembled boards (connectors need to be soldered on, but the electronics are functional). I can sell two of them – third one would be a backup for my own Model M.
- I've got a surplus of 5 STM32s. That's how many more boards I can assemble relatively quickly.
- I've got a bunch of all other supplies, including connectors, buttons, PADAUKs etc. as well as 25-ish manufactured PCBs.
Let me know what you think – what would be the best course of action?
- Attachments
-
- 20240422_184643.jpg (145.85 KiB) Viewed 17228 times
-
- Main keyboard: IBM Model M
With the 25 PCBs in stock, I think you're in a good position to sell them. I'd offer them on github first - for people that just need the PCB but can source the rest (in their own countries - thinking of the USA, where there are many many Model Ms for sale today).
Depending on price, I'd like two assembled ones, but I'm not sure what to do about the capability to replace the bootloader (ie have a copy of your PADAUK or use ATTiny, I'm not even sure what you mean by that).
The thing I really need to do first is open all my keyboards and see what's inside. If I wanted to offer complete USB Model M keyboards for sale, I will need to provide customers with a 'standard' option to replace any or all code on the microcontroller.
The thing is: your design will fit the pre-1991 boards with their larger PCBs and split 8 and 4 flexible print (instead of 20 pin on later models). It will not fit the later boards that have a different mould. It's unfortunate your PCB is not universal (like mschwingen tried to achieve (but he went for a microcontroller that needs extra circuitry). Since you own already 25 PCBs, it's economically not feasible to revise the design, I guess.
Please let me know (in private if you'd like) how much you want for the 1 or 2 you're willing to sell now. I'll let you know once I've opened my keyboards how to proceed.
Depending on price, I'd like two assembled ones, but I'm not sure what to do about the capability to replace the bootloader (ie have a copy of your PADAUK or use ATTiny, I'm not even sure what you mean by that).
The thing I really need to do first is open all my keyboards and see what's inside. If I wanted to offer complete USB Model M keyboards for sale, I will need to provide customers with a 'standard' option to replace any or all code on the microcontroller.
The thing is: your design will fit the pre-1991 boards with their larger PCBs and split 8 and 4 flexible print (instead of 20 pin on later models). It will not fit the later boards that have a different mould. It's unfortunate your PCB is not universal (like mschwingen tried to achieve (but he went for a microcontroller that needs extra circuitry). Since you own already 25 PCBs, it's economically not feasible to revise the design, I guess.
Please let me know (in private if you'd like) how much you want for the 1 or 2 you're willing to sell now. I'll let you know once I've opened my keyboards how to proceed.