Author Topic: Converting an 83-key XT keyboard to USB  (Read 2856 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris_F

  • Thread Starter
  • Posts: 37
Converting an 83-key XT keyboard to USB
« on: Tue, 12 June 2012, 20:10:18 »
I have a keyboard from an IBM XT that I would like to convert to USB. I'm planning on getting one of these to do the job. As I understand it, USB only provides up to 100mA during a devices initialization, and only after that can it be configured to draw more. I'm worried that they keyboard controller might draw too much and prevent the AVR from fully initializing.

Does anyone have any experience with something like this?
Q: The best keyboards ever made are from the early '80s and have buckling springs.
A: True

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6533
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Converting an 83-key XT keyboard to USB
« Reply #1 on: Tue, 12 June 2012, 20:18:27 »
Looks just like the Teensy, which works great.

Everything you need is right here:

http://geekhack.org/showwiki.php?title=Island:17458

Don't forget to say "thank you" to Soarer!
"However, even though I was born in the Mesozoic, I do know what anyone who wants to reach out to young people should say: Billionaires took your money. They took your chance to buy a home. They took your chance at a good education. They stole your opportunities. Billionaires took the things you want in life. If you really want those things, you have to take them back.
That's the message. That's the whole message. Say that every day, not just to reach America's frustrated young white men, but people of every age, race, and gender.
Late-stage capitalism is a wealth-concentration engine, focused on vacuuming up every dollar and putting it in as few hands as possible. Republicans are helping that vacuum suck.
How does a tiny fraction of the population get away with this? They do it by dividing the other 99% of Americans against themselves."
- Marc Sumner 2025-05-30

Offline spolia optima

  • Posts: 580
  • Location: On the shores of the cosmic ocean...
Converting an 83-key XT keyboard to USB
« Reply #2 on: Tue, 12 June 2012, 20:26:21 »
I'm so jelly of you electromechanically-inclined types :(
keyboards!

Offline Chris_F

  • Thread Starter
  • Posts: 37
Converting an 83-key XT keyboard to USB
« Reply #3 on: Tue, 12 June 2012, 20:35:37 »
Quote from: fohat.digs;612302
Looks just like the Teensy, which works great.

Everything you need is right here:

http://geekhack.org/showwiki.php?title=Island:17458

Don't forget to say "thank you" to Soarer!

Is his firmware open source?

If it isn't (I didn't see any firmware source), it's nice that it exists, but I would probably be happier writing something myself. Also, I didn't see mentioned anything about these keyboards power requirements. I know I can configure the AVR for high-power mode (>100mW) but I'm worried that the keyboard might overload it and prevent it from getting that far.
Q: The best keyboards ever made are from the early '80s and have buckling springs.
A: True

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6533
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Converting an 83-key XT keyboard to USB
« Reply #4 on: Tue, 12 June 2012, 20:41:52 »
I have run several different Model Fs, including the behemoth 122-key terminal boards via Teensy from the USB and never had a problem.

I thought that USB could draw up to 500mA, but I may be wrong. I have been through Soarer's intialization process several times, no problems there.

After upgrading to Windows 7, and also Ubuntu 12.04, the computer did not recognize the Teensy until I booted up with a PS2 keyboard, then hot-plugged the USB, but after the first time it worked like a charm.

Don't remember about Soarer's policies, that is way over my head and I am grateful as hell that he wrote it.

If you need to re-invent the wheel, by all means, go ahead!
"However, even though I was born in the Mesozoic, I do know what anyone who wants to reach out to young people should say: Billionaires took your money. They took your chance to buy a home. They took your chance at a good education. They stole your opportunities. Billionaires took the things you want in life. If you really want those things, you have to take them back.
That's the message. That's the whole message. Say that every day, not just to reach America's frustrated young white men, but people of every age, race, and gender.
Late-stage capitalism is a wealth-concentration engine, focused on vacuuming up every dollar and putting it in as few hands as possible. Republicans are helping that vacuum suck.
How does a tiny fraction of the population get away with this? They do it by dividing the other 99% of Americans against themselves."
- Marc Sumner 2025-05-30

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Converting an 83-key XT keyboard to USB
« Reply #5 on: Tue, 12 June 2012, 22:18:22 »
Quote from: Chris_F;612289
I have a keyboard from an IBM XT that I would like to convert to USB. I'm planning on getting one of these to do the job. As I understand it, USB only provides up to 100mA during a devices initialization, and only after that can it be configured to draw more. I'm worried that they keyboard controller might draw too much and prevent the AVR from fully initializing.

Does anyone have any experience with something like this?

Well... the spec says that a device should only draw up to 100mA during init, but in practice it isn't a problem as long as the device isn't plugged into something that can only supply 100mA, e.g. a bus-powered hub. Powered hubs have to be able to supply 500mA at all times, even during device init (excepting error conditions).

Quote from: Chris_F;612322
Is his firmware open source?

It isn't. In principle I'd like to, but... Firstly, I can't decide on a license. Secondly, I'd want it to be at a stage where I believe forks make sense. (IMO, that certainly wasn't true until recently, when all that I had in my head for v1.0 was finally implemented). Lastly, once done it can't be undone - so it won't happen until I'm convinced!

Have you released any open source projects, and if so, what license did you use?

Offline Chris_F

  • Thread Starter
  • Posts: 37
Converting an 83-key XT keyboard to USB
« Reply #6 on: Tue, 12 June 2012, 22:28:56 »
Quote from: Soarer;612405
Well... the spec says that a device should only draw up to 100mA during init, but in practice it isn't a problem as long as the device isn't plugged into something that can only supply 100mA, e.g. a bus-powered hub. Powered hubs have to be able to supply 500mA at all times, even during device init (excepting error conditions).

I figured that might be the case. How do you handle sleep mode? Does the keyboard controller stay on?

I was thinking about regulating power to the keyboard controller with a NPN transistor, so that I could wait until after init to power it, and also so it could be shut off during sleep. You wouldn't happen to know that the voltage tolerance for these keyboard would be?

Quote from: Soarer;612405
It isn't. In principle I'd like to, but... Firstly, I can't decide on a license. Secondly, I'd want it to be at a stage where I believe forks make sense. (IMO, that certainly wasn't true until recently, when all that I had in my head for v1.0 was finally implemented). Lastly, once done it can't be undone - so it won't happen until I'm convinced!

Have you released any open source projects, and if so, what license did you use?

No, I haven't created anything unique enough or useful enough to release yet. I imagine for something like this, it would not be too big of an issue what license you choose. GPL or BSD/MIT licenses would all probably be fine.

In any case, I look forward to programming the AVR myself since I haven't had much experience with them and I don't need all the bells and whistles, just basic functionality.
Q: The best keyboards ever made are from the early '80s and have buckling springs.
A: True

Offline AKIMbO

  • HHKBro
  • Posts: 1778
  • Location: Tennessee
  • Know Topre, Know Peace. No Topre, No Peace.
Converting an 83-key XT keyboard to USB
« Reply #7 on: Tue, 12 June 2012, 22:37:19 »
Quote from: Soarer;612405
Well... the spec says that a device should only draw up to 100mA during init, but in practice it isn't a problem as long as the device isn't plugged into something that can only supply 100mA, e.g. a bus-powered hub. Powered hubs have to be able to supply 500mA at all times, even during device init (excepting error conditions).


It isn't. In principle I'd like to, but... Firstly, I can't decide on a license. Secondly, I'd want it to be at a stage where I believe forks make sense. (IMO, that certainly wasn't true until recently, when all that I had in my head for v1.0 was finally implemented). Lastly, once done it can't be undone - so it won't happen until I'm convinced!

Have you released any open source projects, and if so, what license did you use?

You should check out a dual-licensing scheme.  One license being GPL or LGPL (so others can use your software for free for non-commercial purposes) and the other being so some sort of for-profit licensing scheme.  You should tack on a reciprocity clause or an extra reciprocity license so you can incorporate others improvements on your software without worry of legal reprecussions against yourself.  

I'm no coder like many of you geekhackers but I do know the law.

Check out the links below for more info on the types of licenses and examples Soarer:
Types of licenses
GPL license examples
Mkawa Beta SSK | IBM SSK | IBM Model AT F | IBM F 122 | IBM Unsaver | LZ-GH (62g ergo clears) | HHKB Pro2 Type-S | HHKB Pro2 | Realforce 87U-Silent (55g uniform) | Leopold FC660C | Omnikey 101 (blue alps) | Kingsaver (blue alps) | Zenith ZKB2 (green alps)
| KBD75 (box reds)

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Converting an 83-key XT keyboard to USB
« Reply #8 on: Tue, 12 June 2012, 23:06:43 »
Quote from: Chris_F;612409
I figured that might be the case. How do you handle sleep mode? Does the keyboard controller stay on?

I was thinking about regulating power to the keyboard controller with a NPN transistor, so that I could wait until after init to power it, and also so it could be shut off during sleep. Maybe this is completely unnecessary.

I just leave it all on - otherwise, you couldn't do a remote wake-up of the computer from the keyboard! Again, hosts just don't enforce the spec, and if the port isn't configured for remote wakeup, its power will usually be switched off during sleep anyway.

Quote from: Chris_F;612409
No, I haven't created anything unique enough or useful enough to release yet. I imagine for something like this, it would not be too big of an issue what license you choose. GPL or BSD/MIT licenses would all probably be fine.

In any case, I look forward to programming the AVR myself since I haven't had much experience with them and I don't need all the bells and whistles, just basic functionality.

Oh, licensing always matters! I spent a while reading them (so tedious...) and GPL is probably alright for what I want. But it's still hard to make a final decision on that or whether to open source at all... and there's always something more important or more interesting to do, like adding more functionality!

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Converting an 83-key XT keyboard to USB
« Reply #9 on: Tue, 12 June 2012, 23:14:56 »
Quote from: AKIMbO;612416
You should check out a dual-licensing scheme.  One license being GPL or LGPL (so others can use your software for free for non-commercial purposes) and the other being so some sort of for-profit licensing scheme.  You should tack on a reciprocity clause or an extra reciprocity license so you can incorporate others improvements on your software without worry of legal reprecussions against yourself.  

I'm no coder like many of you geekhackers but I do know the law.

Check out the links below for more info on the types of licenses and examples Soarer:
Types of licenses
GPL license examples

Thanks! I read the first link a while back, very useful. I would certainly offer a commercial licensing option, just in case I got lucky!!

The second link is a great illustration of why it's hard to make a choice!!!

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Converting an 83-key XT keyboard to USB
« Reply #10 on: Wed, 13 June 2012, 16:19:04 »
BTW, I just measured an XT keyboard: 120mA :-)

Offline Chris_F

  • Thread Starter
  • Posts: 37
Converting an 83-key XT keyboard to USB
« Reply #11 on: Wed, 13 June 2012, 16:55:07 »
Quote from: Soarer;612893
BTW, I just measured an XT keyboard: 120mA :-)


Wow, what a pig. I tested mine and it was only drawing ~105mA.

Still, I just wont feel right if it doesn't conform to the spec, so I think I'll add a switching transistor just to be safe.
Q: The best keyboards ever made are from the early '80s and have buckling springs.
A: True

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Converting an 83-key XT keyboard to USB
« Reply #12 on: Wed, 13 June 2012, 18:46:32 »
Well even 105mA would be over :-p And then there's ~15mA for the AVR.

I'm not sure switching the power is worth the trouble, since with or without it the result is the same - the converter will work on a powered hub or port on the PC, and won't work on a bus-powered hub. I have thought about using buffers in line with the clock and data signals though, because the AVR ports are the most likely place for damage to occur.