XT to USB project [OPEN SOURCE]

Manak1n

11 Jan 2016, 22:12

Manak1n's Open Source Converter (XT)
About a week ago I found an IBM Model F and began to search how I could get it working with my computer. To my disappointment, Soarer's solution didn't work with the Teensy 3.1 that I had on hand. It took several hours of work over the course of three days for me to get the keyboard all up and working, and a few more days to clean up the code.
Porting Soarer's code to the Teensy 3.1 would have saved me quite a bit of time, but unfortunately he hasn't released the source. This is my attempt at creating an open source "branch" from what he started. Theoretically, this is compatible with all Teensy boards other than the Teensy 1.0/1.0++ (need to change the LED pin for Teensy 2.0/2.0++).
Currently, the code is as optimized and documented as I can do without feedback. This branch is limited to XT, but if there is enough demand I may start a separate open source AT branch.

RIGHT NOW ONLY THE FIRST 83 KEYS ARE SUPPORTED. I need volunteers to test with larger keyboards!

Keyboards currently supported:
  • IBM Model F "XT" (83 key) [verified]
  • Other XT-set 1 keyboards
Microcontrollers currently supported:
  • Teensy 3.2
  • Teensy 3.1 [verified]
  • Teensy 3.0
  • Teensy++ 2.0
  • Teensy 2.0
Features:
  • 6 Key rollover minimum (10 max)
  • Dual-layered function keys (toggle with NumLock)
  • Bypassing of keyboard's built-in key repeat
  • Porting to other Arduino boards is not too difficult
Known bugs:
  • If you hold down both shift keys and then release them, shift stays on until you press and release it again.
  • Both shift keys map to left shift.
To do:
Please inform me of any feature requests you may have, or bugs you find.
  • Add generic Arduino code version for wider microcontoller support.
  • Change Teensy from mouse+keyboard+joystick to Keyboard only
  • Add extended XT keyboard support (volunteers needed)
I don't play to implement full NKRO because it isn't worth the pain. 6 keys is fine for mouse+keyboard gaming, and I don't know anyone who presses more than 6 keys simultaneously while typing. Really, it will break more than it will help.

Setup
Choose either the MAIN or ALTERNATE builds. Main is standard key layout, alternate swaps the control and alt keys to better resemble modern keyboards.

Currently, only XT is supported:
Image
Note: DOUBLE CHECK! Bad wiring is baaaad!
Teensy ------ Keyboard
Vin ---------- Vcc +5v
PD2 --------- Clock
PD3 --------- Data
GND -------- GND

Note: I'm trying to keep TX and RX open for development purposes.

Set up Teensyduino so you know how to compile and upload to controller.
Follow these settings in the Arduino IDE:
(Make sure you set the board to YOUR version of Teensy)
Image

Finally, load up the .ino and then simply upload to the board if you have a Teensy 3.1.
If you have a Teensy 2.0 or 2.0++, change LED_Pin in the sketch to 11 or 6, respectively.
You will probably get a warning saying that the Teensy didn't reset. Ignore it, this happens often when you are in USB HID mode.
If everything went smoothly, you should now have it up and running!
Attachments
MOSC_XT_Version_0.1.zip
v0.1 - Initial release.
(21.94 KiB) Downloaded 182 times
Last edited by Manak1n on 11 Feb 2016, 05:03, edited 3 times in total.

idollar
i$

11 Jan 2016, 23:28

What a nice surprise !!!

Thanks !

User avatar
Muirium
µ

12 Jan 2016, 00:24

96 MHz??
Spoiler:
Image

User avatar
scottc

12 Jan 2016, 00:33

Great work, Manak1n! Unfortunately I don't have any XT boards to hand that I can test with or else I'd be all over it. I really appreciate that it's open source too. That's where Soarer's converter fell over, unfortunately. I had a quick scan of the code and it's fairly simple (at least when defining the layout) which is very nice. Can't wait to see how this develops.

User avatar
seebart
Offtopicthority Instigator

12 Jan 2016, 00:45

Impressive first post, welcome to DT. Great work, keep it up.

Manak1n

12 Jan 2016, 05:52

Muirium wrote: 96 MHz??
Spoiler:
Image
Yeah, doesn't need to be that high. I imagine you can turn it down all the way to 24 Mhz and it would extend the lifespan. I'll update the image later with something more sensible.

mastermachetier

12 Jan 2016, 06:53

Hey amazing work! Is this compatible with the terminal keyboards like soarer's converter was?

User avatar
Muirium
µ

12 Jan 2016, 06:55

I doubt that, as Soarer's was explicitly an XT + AT + IBM terminal converter. They aren't the same protocol, as I understand.

andrewjoy

12 Jan 2016, 12:02

terminals are scancode set 3 not 1 so no luck with that.

and honestly as expensive as it is i would get an xwhatsit in the thing, nip that nasty old controller in the bud.

This however is an awesome project, we need a nice open source ( GPL i hope :P) converter. The beauty of that is it can be expanded by others.

Manak1n

12 Jan 2016, 18:01

mastermachetier wrote: Hey amazing work! Is this compatible with the terminal keyboards like soarer's converter was?
Not yet. I hope to extend this as much as possible, but I only have one keyboard to test with. When I get volunteers I'll start development on features/scan sets/protocols to match most of Soarer's work (minus NKRO, as mentioned before).
andrewjoy wrote: terminals are scancode set 3 not 1 so no luck with that.

and honestly as expensive as it is i would get an xwhatsit in the thing, nip that nasty old controller in the bud.

This however is an awesome project, we need a nice open source ( GPL i hope :P) converter. The beauty of that is it can be expanded by others.
Good call, I'll figure out how to drop a GPL reference in there. I'm new to coding in a public sense, though I've been doing it in school for several years. I decided it's about time to put my coding experience to some tangible use ;)

mastermachetier

12 Jan 2016, 19:48

Manak1n wrote:
mastermachetier wrote: Hey amazing work! Is this compatible with the terminal keyboards like soarer's converter was?
Not yet. I hope to extend this as much as possible, but I only have one keyboard to test with. When I get volunteers I'll start development on features/scan sets/protocols to match most of Soarer's work (minus NKRO, as mentioned before).
andrewjoy wrote: terminals are scancode set 3 not 1 so no luck with that.

and honestly as expensive as it is i would get an xwhatsit in the thing, nip that nasty old controller in the bud.

This however is an awesome project, we need a nice open source ( GPL i hope :P) converter. The beauty of that is it can be expanded by others.
Good call, I'll figure out how to drop a GPL reference in there. I'm new to coding in a public sense, though I've been doing it in school for several years. I decided it's about time to put my coding experience to some tangible use ;)


So I currently have a terminal 122k model m and an apple standard keyboard if you ever need volunteers with those. I am getting a haul next week from an iseries upgrade an old company I use to work for is doing so maybe I'll have an xt to test as well soon .

User avatar
Muirium
µ

12 Jan 2016, 20:34

Supporting Apple ADB keyboards with the same software is quite a big ask! But it would be awesome. I made this Soarer box ages ago that I've used heavily ever since:

Image

XT/AT/PS2 and IBM Terminal support, all on a single switch. But no love for my AEKs… yet.

Naturally, I could use Hasu's TMK with those. But Soarer's runs without the need to recompile for the specific protocol. I couldn't make a box like that for it.

Manak1n

13 Jan 2016, 06:07

Muirium wrote: Supporting Apple ADB keyboards with the same software is quite a big ask! But it would be awesome. I made this Soarer box ages ago that I've used heavily ever since:
Spoiler:
Image
XT/AT/PS2 and IBM Terminal support, all on a single switch. But no love for my AEKs… yet.

Naturally, I could use Hasu's TMK with those. But Soarer's runs without the need to recompile for the specific protocol. I couldn't make a box like that for it.
Yeah, with the fact that ADB doesn't have a 'clock' to follow, it's a little more difficult to read properly. I'll add it to my list of potential directions. I can't say if/when an autodetect feature would be implemented in my own code... Not sure how I would approach that.

User avatar
d33n

13 Jan 2016, 21:37

I am typing this on my model F using your converter.
Thank you very much! :D

At first it was not working for me, but then I realised the VCC was still connected to the teensy 3.3vpin from an earlier project.

Manak1n

14 Jan 2016, 01:31

d33n wrote: I am typing this on my model F using your converter.
Thank you very much! :D

At first it was not working for me, but then I realised the VCC was still connected to the teensy 3.3vpin from an earlier project.
Good to hear! Just curious, are you using the main or alternate key layout? Teensy 3.1 or other?
Last edited by Manak1n on 14 Jan 2016, 06:39, edited 1 time in total.

Manak1n

14 Jan 2016, 04:17

Looking at the Teensy keyboard source I think I found a way to separate the left and right shift keys. However, I don't have my Model F + Teensy right now, so I can't test until Sunday or so.
EDIT: also updated the OP with GPL licensing and a lower microprocessor frequency. If anyone is used to GPL licensing, let me know if I did something wrong. ;)

User avatar
d33n

14 Jan 2016, 07:38

Manak1n wrote:
d33n wrote: I am typing this on my model F using your converter.
Thank you very much! :D

At first it was not working for me, but then I realised the VCC was still connected to the teensy 3.3vpin from an earlier project.
Good to hear! Just curious, are you using the main or alternate key layout? Teensy 3.1 or other?
I chose the main layout, because I wanted to start with the default key mapping, to customise it later. Using a teensy 3.1.
The source code is not too hard, to read so I should be able to help out with some improvements later.

terrycherry

22 Jan 2016, 17:29

Great project! I often pressed the 8-10keys simultaneously on music game.
Hope you can manage this case.
Thanks for the nice work!

User avatar
kokokoy

30 Mar 2016, 03:18

Got an IBM 5155 yesterday and tried this out. Worked great man. Thanks manakin. Just need to put this on a box.
20160330_085953.jpg
20160330_085953.jpg (256.85 KiB) Viewed 2855 times
Found out some use for those fan extensions.

User avatar
ohaimark
Kingpin

30 Mar 2016, 06:16

Muirium wrote: Supporting Apple ADB keyboards with the same software is quite a big ask! But it would be awesome. I made this Soarer box ages ago that I've used heavily ever since:

Image

XT/AT/PS2 and IBM Terminal support, all on a single switch. But no love for my AEKs… yet.

Naturally, I could use Hasu's TMK with those. But Soarer's runs without the need to recompile for the specific protocol. I couldn't make a box like that for it.
Solution: use two teensy microcontrollers and a secondary switch that moves the USB output from one to the other. Also include a power switch so that you can switch between the two converters OR multiple protocols on Soarer's without any weird transitional artifacts or USB unplugging/plugging.

mac80211

03 May 2018, 02:59

Has anyone ported the code to atmega32u4?

zool

03 May 2018, 05:05

Nice work!!!
mac80211 wrote: Has anyone ported the code to atmega32u4?
Makes me want to jam converters into an ATtiny85.

skipper024

13 Dec 2018, 02:40

For anyone with requests/problems:

Taking a look at the Git repo for this project, it hasn't been active for several years and there are 0 pull requests or issues. I'm currently renovating a Model F and will be using this project, so I'm happy to pick up stewardship of the codebase. For any issues you encounter or ideas for improvement you may have, please visit the GitHub page:

https://github.com/ktraister/mosc-xt

__red__

13 Dec 2018, 07:23

Nice work skipper, thanks for picking this up.

skipper024

21 Dec 2018, 22:02

Thanks __Red__, this is a great community and I'd like to give back.

Unfortunately I'm having some trouble getting this working on my Model F XT 83, has anyone else on here worked through problems with this firmware?

EDIT: Something screwy is going on with my board, I'm guessing the firmware for the Teensy is doing it's job correctly

EDIT2: I fixed the problem, which turned out to be the piece of plastic separating the PCB and the backing plate being dislocated, causing a grounding issue on the PCB. The converter works flawlessly, and I'm typing this on my F-83-XT!!!!

Post Reply

Return to “Workshop”