Author Topic: XT/AT/PS2/Terminal to USB Converter with NKRO  (Read 892235 times)

0 Members and 1 Guest are viewing this topic.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #100 on: Mon, 23 May 2011, 05:29:02 »
Cherry 'board didn't do anything that might shed light on what the 'S' setting on yours is. 'S' could stand for 'serial', at a guess.

Your XT 'boards - what make are they?

At this point, seeing the signals on a 'scope would probably show us what the problem is within minutes, otherwise it's pretty tricky to diagnose :-/
« Last Edit: Mon, 23 May 2011, 05:32:58 by Soarer »

Offline 8_INCH_FLOPPY

  • Posts: 183
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #101 on: Mon, 23 May 2011, 22:38:59 »
I'm not sure what make they are. Unfortunately, the last owner peeled the stickers off, and I haven't taken them apart yet  They are both 83-key layout, with black cherries, double-shot keys, and full-key rollover. I can't wait to get them working. I have very little experience with digital, but I'll try to get a 'scope shot soon.
Notable Switches I have tried:
black cherry, blue cherry, brown cherry, clear cherry, cherry M84, white alps, black alps, cream alps, Monterey blue alps, Fujitsu Peerless, Gateway2000 rubber dome, Keytronic rubber dome, Model M buckling spring, Model F buckling spring, futaba, black space invader

================================================
HAPPY HUNTING
================================================

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #102 on: Tue, 24 May 2011, 06:14:25 »
Oh wow, that would really help! Normally the signals very easy to capture on a 'scope, they're 5V and only about 10kHz. Trigger on clock going below about 2.5V.

Here's an IBM XT 'board sending the make code for the comma key (0x33):

5577-0

The clock (in blue) spends less time low than high - I suspect on your 'boards it might be spending even less time low, so that's the first thing to look at. It would be interesting to see traces for both the unknown and the Monterey (in 'X' mode).
« Last Edit: Sat, 06 October 2012, 11:26:10 by Soarer »

Offline Hak Foo

  • Posts: 1270
  • Make America Clicky Again!
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #103 on: Sun, 12 June 2011, 18:13:39 »
Is there any chance we can get the source if we want to compile our own custom mappings?  I know the all-singing all-dancing customizable version is under development, but I'd love to lock down a sensible location for a few keys the registry-based remappers ignore?
Overton130, Box Pale Blues.

Offline 8_INCH_FLOPPY

  • Posts: 183
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #104 on: Tue, 14 June 2011, 13:43:36 »
These were all captured with me pressing the "accent grave/tilde" key. The "S" setting seemed to be about the same as the "X". It wouldn't work at all on the "A" setting, even though it works fine with my pc.

Unidentified 83-key XT Keyboard:
http://imageshack.us/photo/my-images/804/photo0017v.jpg/

Monterey Keyboard with switch on the "X" position:
http://imageshack.us/photo/my-images/534/photo0018jg.jpg/
http://imageshack.us/photo/my-images/541/photo0019wj.jpg/

Monterey Keyboard with switch on the "S" position:
http://imageshack.us/photo/my-images/194/photo0020e.jpg/
Notable Switches I have tried:
black cherry, blue cherry, brown cherry, clear cherry, cherry M84, white alps, black alps, cream alps, Monterey blue alps, Fujitsu Peerless, Gateway2000 rubber dome, Keytronic rubber dome, Model M buckling spring, Model F buckling spring, futaba, black space invader

================================================
HAPPY HUNTING
================================================

Offline REVENGE

  • Posts: 568
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #105 on: Fri, 17 June 2011, 19:26:45 »
Soarer, this is an excellent project! My implementation works nicely with a Model F 122 key terminal board. Now, when do you plan on releasing the source code? I am very interested in doing some controller level remapping for media keys and whatnot.
◕ ‿ ◕

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #106 on: Sat, 18 June 2011, 05:39:37 »
Quote from: Hak Foo;359618
Is there any chance we can get the source if we want to compile our own custom mappings?  I know the all-singing all-dancing customizable version is under development, but I'd love to lock down a sensible location for a few keys the registry-based remappers ignore?

 
Quote from: REVENGE;362636
Soarer, this is an excellent project! My implementation works nicely with a Model F 122 key terminal board. Now, when do you plan on releasing the source code? I am very interested in doing some controller level remapping for media keys and whatnot.

 
It could well well Autumn before I have a chance to implement the fancy bits; looks like other stuff is going to get in the way until then :-(

So, possibly.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #107 on: Sat, 18 June 2011, 06:47:14 »
Quote from: 8_INCH_FLOPPY;360683
These were all captured with me pressing the "accent grave/tilde" key. The "S" setting seemed to be about the same as the "X". It wouldn't work at all on the "A" setting, even though it works fine with my pc.

Unidentified 83-key XT Keyboard:
http://imageshack.us/photo/my-images/804/photo0017v.jpg/

Monterey Keyboard with switch on the "X" position:
http://imageshack.us/photo/my-images/534/photo0018jg.jpg/
http://imageshack.us/photo/my-images/541/photo0019wj.jpg/

Monterey Keyboard with switch on the "S" position:
http://imageshack.us/photo/my-images/194/photo0020e.jpg/

That Monterey is an odd beast! For starters, it's going more than twice as fast as a standard IBM XT, ~40uS per clock vs ~100uS. Then it only spends a small amount of that time high, ~8uS. Since my software attempts to track both the rising and falling edges of the clock signal, I guess it's failing to do that correctly at that speed. The strange thing is, I'd expect that to cause a lot of R04, with maybe a few other errors mixed in, but anyway the timing is something I can look at.

The 'A' settting is clearly even more enigmatic! But let's assume it's a similar timing problem for now.

The XT board, though, has perfectly fine looking timings. I can't see anything in them that would trip up my converter :-/
So I'm guessing there's something else odd about it, that maybe a trace showing the whole byte would reveal.

edit: Uploaded those pics to GH... 2nd edit: again...

Unidentified 83-key XT Keyboard:

Monterey Keyboard with switch on the "X" position:

Monterey Keyboard with switch on the "S" position:
« Last Edit: Sat, 06 October 2012, 11:20:04 by Soarer »

Offline didjamatic

  • Posts: 1352
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #108 on: Sat, 18 June 2011, 08:59:24 »
Nice work, I'm doing this!  Is there a downside to the ++ or is it just larger than necessarily?  Seems the ++ would be more versatile if you were only going to buy one.
« Last Edit: Sat, 18 June 2011, 09:06:47 by didjamatic »
IBM F :: IBM M :: Northgate :: Cherry G80 :: Realforce :: DAS 4

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #109 on: Sat, 18 June 2011, 09:29:04 »
No downside apart from cost really! It just has more of everything (which the converter doesn't make any use of currently). Eventually the extra RAM and EEPROM could be used to store more and/or longer macros etc, but that's about it.

Offline REVENGE

  • Posts: 568
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #110 on: Sat, 25 June 2011, 06:28:03 »
Soarer, one of the keys on my 122 key terminal Model F does not send any key codes through the adapter when I checked in Aqua's key test. It's the top right key in the numpad cluster. Is this a problem with my keyboard or is that key not mapped to any code in your firmware?
◕ ‿ ◕

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #111 on: Sat, 25 June 2011, 07:48:04 »
Quote from: REVENGE;367634
Soarer, one of the keys on my 122 key terminal Model F does not send any key codes through the adapter when I checked in Aqua's key test. It's the top right key in the numpad cluster. Is this a problem with my keyboard or is that key not mapped to any code in your firmware?

 
My bad! Looks like I did half a change - I took it out of the global remaps, but forgot to put it back in elsewhere. :-(
I'll have a look at it later and see if I can remember what I intended to do!

Offline REVENGE

  • Posts: 568
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #112 on: Sat, 25 June 2011, 08:15:06 »
Quote from: Soarer;367653
My bad! Looks like I did half a change - I took it out of the global remaps, but forgot to put it back in elsewhere. :-(
I'll have a look at it later and see if I can remember what I intended to do!
Thanks! :) Aside from that key not sending a code, the board is currently missing default key mappings for Pause, Numpad /, and Numpad +.

Another issue I noticed: the keyboard can wake my computer from standby, but stops working afterwards and requires a re-plug. Not sure if this is a known issue or not.
« Last Edit: Sat, 25 June 2011, 08:27:09 by REVENGE »
◕ ‿ ◕

Offline kps

  • Posts: 410
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #113 on: Sun, 26 June 2011, 11:57:23 »
Quote from: Hak Foo;359618
Is there any chance we can get the source if we want to compile our own custom mappings?

 
Quote from: REVENGE;362636
I am very interested in doing some controller level remapping for media keys and whatnot.


This is what I did for my 122-key F; it might help someone else. No guarantees, and I probably don't have time to hold hands.



[ Attachment Invalid Or Does Not Exist ] 19817[/ATTACH]

Offline Oqsy

  • Posts: 861
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #114 on: Mon, 27 June 2011, 23:25:48 »
Nice. I need to do an ANSI mod and add my RGB modifiers too. Excellent work and thx for sharing.
[sigpic]Currently in use: Rosewill RK9000 and CH DT225[/sigpic]
"Private misfortunes make for public welfare."

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #115 on: Sat, 02 July 2011, 10:35:00 »
Quote from: Soarer;367653
My bad! Looks like I did half a change - I took it out of the global remaps, but forgot to put it back in elsewhere. :-(
I'll have a look at it later and see if I can remember what I intended to do!

New version (0.995) posted that maps the top-right key of the numpad to 'Pause'.

Quote from: REVENGE;367662
Thanks! :) Aside from that key not sending a code, the board is currently missing default key mappings for Pause, Numpad /, and Numpad +.

Another issue I noticed: the keyboard can wake my computer from standby, but stops working afterwards and requires a re-plug. Not sure if this is a known issue or not.

Not known to me, at least! Does resume work fine with another USB keyboard?

Offline mr_a500

  • Posts: 401
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #116 on: Sun, 03 July 2011, 11:36:52 »
I'm thinking of trying this thing with an IBM 5155 keyboard. It should be the same as an XT keyboard, right? Theoretically, I'd just need a phone-style plug in and connect the appropriate lines to the teensy. Has anybody tried this?

Offline REVENGE

  • Posts: 568
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #117 on: Sun, 03 July 2011, 20:29:10 »
Quote from: Soarer;371928
New version (0.995) posted that maps the top-right key of the numpad to 'Pause'.


 
Not known to me, at least! Does resume work fine with another USB keyboard?

Yep, I had my BlackWidow and the Model F both connected. First off, the Teensy stays on even while the computer is suspended, the lock LEDs stay lit. Secondly, if I resume using the Model F, it will not function once the computer boots up. At this point, without resetting the Teensy, if I put the computer back to sleep and use another USB device to wake it up, the Model F will function normally again. Finally, I can always unplug and replug the Teensy to get the keyboard working again.

Thanks for adding Pause by the way, although I would still prefer to compile from source using my own mappings. :P
◕ ‿ ◕

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #118 on: Tue, 05 July 2011, 06:59:07 »
It has to stay powered for a keypress to be able to trigger the wake-up ;)  I know it's not supposed to stay fully powered, but it's the best that can be done with non-usb keyboards. Depending on OS and settings, the USB port or hub that it is attached to may get switched off (or simply ignored, if it's self-powered) because it's drawing too much current when in sleep mode, but that just means it can't send the wake-up.

Re not working after being used to wake up the computer - I need more clues!! It seems to be working ok on Windows (although I did have to change which power mode the computer was using for suspend), on Linux,  and also on Macs (apparently), so I guess part of this is working out what's different about your setup? OS, power settings (BIOS and OS), whether it's on a powered hub, pr0n cache size...

Offline REVENGE

  • Posts: 568
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #119 on: Tue, 05 July 2011, 08:04:41 »
Quote from: Soarer;373627
Re not working after being used to wake up the computer - I need more clues!! It seems to be working ok on Windows (although I did have to change which power mode the computer was using for suspend), on Linux,  and also on Macs (apparently), so I guess part of this is working out what's different about your setup? OS, power settings (BIOS and OS), whether it's on a powered hub, pr0n cache size...

Still waiting for Explorer to scan the pr0n cache and total up the file sizes, I'll get back to you on that one. Do you need to know my web history as well?

Windows 7 64-bit, S3, not sure what you can do with power settings in Windows, powered mobo hub.
◕ ‿ ◕

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #120 on: Tue, 05 July 2011, 08:59:05 »
It's just the size that counts!

I'll check next time I reboot what I set in my BIOS, I might've changed it from S3 to S2, but I forget! Before I changed it, the port was being powered down by the PC, so wake-up didn't work at all.

I'm all XP at the moment. Sometime soon I'll be setting up a Windows 7 PC, it will probably be 32-bit, but that shouldn't make much difference to this problem. I'll look at it then.

Offline REVENGE

  • Posts: 568
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #121 on: Tue, 05 July 2011, 10:19:09 »
Quote from: Soarer;373666
It's just the size that counts!

I'll check next time I reboot what I set in my BIOS, I might've changed it from S3 to S2, but I forget! Before I changed it, the port was being powered down by the PC, so wake-up didn't work at all.

I'm all XP at the moment. Sometime soon I'll be setting up a Windows 7 PC, it will probably be 32-bit, but that shouldn't make much difference to this problem. I'll look at it then.

Sounds good, mad props again for developing and maintaining this project. :P
◕ ‿ ◕

Offline mr_a500

  • Posts: 401
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #122 on: Sun, 10 July 2011, 09:02:02 »
So nobody has ever tried this with an IBM 5155? (that means I'll be the first... in history!)





I'm thinking of getting something like this:


...and put the Teensy inside of it. Connecting the wires should then be no problem. My only problem is that I don't know which pin is what. How can I find out?

Maybe my "Googling skills" aren't great, but I can't find any pinout information for the 5155.
« Last Edit: Sun, 10 July 2011, 09:08:05 by mr_a500 »

Offline kps

  • Posts: 410
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #123 on: Sun, 10 July 2011, 09:25:25 »
Quote from: mr_a500;377416
My only problem is that I don't know which pin is what. How can I find out?

 
Open it. Power and ground should be straightforward to identify. Data & clock might take a bit of tracing (though it's more likely the same as the PC), and getting them backwards on the first try won't hurt anything anyway.

Offline mr_a500

  • Posts: 401
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #124 on: Sun, 10 July 2011, 09:35:05 »
You mean open the keyboard? That could be tricky. There are no screws. It looks like it was assembled by snapping the front in and it looks difficult to snap it out again. There are small cracks all around the edges. I don't want to break it by trying to pry it apart. Even if I was successful, it would probably be loosened - and the sturdy feel of this keyboard is the main reason I like it.

No, I don't think I'll attempt to open it.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #125 on: Sun, 10 July 2011, 10:07:25 »
If you have a multimeter, you might be able to work it out without taking it apart.
Measure resistance between the case (obviously, need to find some metal part!) and each pin...
One or more will have 0 resistance, so they're grounds.
Power will have some resistance (about 780 ohms on the 122-key board I just tried).
Data and clock might have the same reading (about 2.8k on this board), or, if it's like the PC-XT, then data will be lower resistance than clock (both would still be higher than from case to power).

Offline Hak Foo

  • Posts: 1270
  • Make America Clicky Again!
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #126 on: Sun, 10 July 2011, 19:58:31 »
Revenge:  I think I've had a similar symptom.  Only happened since 0.99.5, but it seems like once it powers off, you have to unplug/replug to make it work again.  Even hard power-off (cut the line power, not software power-off) doesn't help.

Mobo: MA790X-UD4, using an on-board port
OS: Windows 7 64-bit
Board: 6110345 (122-key F, as most of us use)
Overton130, Box Pale Blues.

Offline LETE

  • Posts: 50
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #127 on: Wed, 20 July 2011, 14:51:56 »
Quote from: kps;368471
This is what I did for my 122-key F; it might help someone else. No guarantees, and I probably don't have time to hold hands.



These files aren't much use without the source code, right? Or did you just inject the resulting hex code into the main hex file?

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #128 on: Wed, 20 July 2011, 15:03:01 »
You write the teensy firmware with this hex file.  It's a complete firmware.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #129 on: Wed, 20 July 2011, 15:04:46 »
[strike]I didn't work out what they were for either.... presumably OS side somewhere.[/strike]
« Last Edit: Wed, 20 July 2011, 15:07:29 by Soarer »

Offline LETE

  • Posts: 50
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #130 on: Wed, 20 July 2011, 15:25:11 »
I'm talking about the files kps posted in the attached zip file "remap.zip" on page 12. They're basically the look-up tables used to generate compatible scancodes.

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #131 on: Wed, 20 July 2011, 15:36:06 »
Just looked at the contents, it's got a makefile and everything is automatic... it specifies the input:  Soarer_at2usb_v0.994_teensy2.hex  and modifies it to produce patched.hex   which is then a complete replacement firmware itself.

edit:   will not be possible to do this to any other rev of the FW without figuring out the addresses equivalent to start1a/start1b/start2/start3 from the one he patched.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline LETE

  • Posts: 50
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #132 on: Wed, 20 July 2011, 15:41:53 »
Ah, well said. Thank you.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #133 on: Wed, 20 July 2011, 17:34:30 »
Oh... so that's what it does... outrageous subterfuge!!

I should warn anyone trying this, that my remaps happen after those tables, so you may not get what you intended!

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #134 on: Wed, 20 July 2011, 17:39:59 »
The people WANT YOUR STUFF... ;)  they just want it their way.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline REVENGE

  • Posts: 568
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #135 on: Wed, 20 July 2011, 18:18:08 »
Quote from: Soarer;384288
Oh... so that's what it does... outrageous subterfuge!!

I should warn anyone trying this, that my remaps happen after those tables, so you may not get what you intended!
Soarer, I understand you're not ready to release your source, but I would be satisfied in the meantime if you could include a proposed layout for the 104 key Terminal Model F. Specifically, Esc and Pause need to be moved the left side function cluster since there's no Numpad area on those boards.
◕ ‿ ◕

Offline kps

  • Posts: 410
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #136 on: Wed, 20 July 2011, 20:30:18 »
Quote from: Soarer;384288
Oh... so that's what it does... outrageous subterfuge!!

Thanks!

Quote
I should warn anyone trying this, that my remaps happen after those tables, so you may not get what you intended!

I thought so, from the table contents. It's enough to get my Terminal F layout working, though.

Offline LETE

  • Posts: 50
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #137 on: Thu, 21 July 2011, 21:50:47 »
I'm going to stick a couple solid state relays in my box and set this thing up to control my lamps. I shouldn't have to stand up to turn those things on and off when I've got so many extra buttons on my keyboard.

Offline LETE

  • Posts: 50
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #138 on: Fri, 29 July 2011, 10:38:44 »
Here are a few pictures of my teensy mounting solution for a model F terminal board. My four terminal boards have an extra pcb mounting spot so I decided to take advantage of it. I bought some perf board, a screw and some female to female jumper wires and in 8 minutes I was up and running. No soldering makes it completely reversible, the teensy board is held in by friction alone, but it feels solid enough.

[ Attachment Invalid Or Does Not Exist ] 22675[/ATTACH] [ Attachment Invalid Or Does Not Exist ] 22676[/ATTACH] [ Attachment Invalid Or Does Not Exist ] 22678[/ATTACH]
« Last Edit: Fri, 29 July 2011, 10:41:02 by LETE »

Offline SmallFry

  • ** Moderator Emeritus
  • Posts: 3887
  • Location: Wisconsin, USA
  • Leaving 6/15; returning 6/22 or so.
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #139 on: Wed, 10 August 2011, 23:08:48 »
Is it possible that I could get the source code? I wanted to recompile/edit a little/etc this to work with my AVR Butterfly (ATmega169)...

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #140 on: Thu, 11 August 2011, 09:04:38 »
Quote from: SmallFry;396808
Is it possible that I could get the source code? I wanted to recompile/edit a little/etc this to work with my AVR Butterfly (ATmega169)...

Sorry, I'm not ready to give it out yet. It might be a while because I'm very busy with other stuff for at least the next month or two.

I think it might anyway take a fair bit of effort to get it working on that chip, since I don't think it has hardware USB support.

Offline SmallFry

  • ** Moderator Emeritus
  • Posts: 3887
  • Location: Wisconsin, USA
  • Leaving 6/15; returning 6/22 or so.
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #141 on: Thu, 11 August 2011, 12:30:26 »
Alright, thanks anyways Soarer

Offline wcass

  • Posts: 506
  • Location: Fort Lauderdale, FL, USA
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #142 on: Fri, 12 August 2011, 09:53:17 »
Soarer, perhaps the GH community could help with building a front end? something that did nothing more than build an input file ...

=
=
=
 
You can name the format that works.
How can we help you?

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #143 on: Thu, 18 August 2011, 08:47:50 »
Quote from: wcass;397641
Soarer, perhaps the GH community could help with building a front end?
How can we help you?

I'm sorry, I missed this! Thanks for the offer!

I would like some help with the front-end and cross platform stuff (particularly OSX) - the way I envisage it, it breaks down into 3 or 4 components, so it is ideal for sharing the work! Even having alternate front-ends, if that suits people. However, one or two of those I have to write, so I'm still the weak link :(

The layers would be...
  • Front-end
  • Compiler - could be a simple script, or integrated into front-end
  • Driver - one for each platform, but doesn't need to be much more that the PJRC sample code
  • Device - rawhid endpoint on the Teensy, allows read/write EEPROM
The input file to the compiler will be something like you suggest, rather than full tables, since that's how my remapping works on the Teensy. But there can also be multiple sections, each one tagged with enough information to decide when to apply the remappings - e.g. globally, for set3 terminal boards, or perhaps by individual keyboard ID.

So, I need to write the device part (which I can't really test without also writing the driver part for Windows!), and also define the binary format within the EEPROM, in a way that allows for future extensions (macros, etc).

Offline wcass

  • Posts: 506
  • Location: Fort Lauderdale, FL, USA
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #144 on: Sun, 28 August 2011, 00:37:50 »
so a couple of questions.

input file format should be ... what? default name?
comment character would be what? - i'm using # in this example)
will your code ignore white space and letter case?
Quote
3a=1D # cap lock = left ctrl
  1d = 3A # left ctrl = caps lock
     ... etc
some (mostly terminal) keyboards send key combinations like [shift]+[F1] for a single key-press of [F13]; is your code able to catch [shift]+[F1] and spit out something like ...
     
Quote
2A+3B=e0 30 # F13 = volume up
     2a+3c=e0 2e # F14 = volume down
     ... etc

macros would be written like ....
     
Quote
6b=E0 48+E0 48+E0 4D+E0 4B # F20 = (arrows) up up right left
     ... etc

is this reasonable expectation?
« Last Edit: Sun, 28 August 2011, 00:40:22 by wcass »

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #145 on: Sun, 28 August 2011, 08:15:48 »
I'm imagining something along the lines of this:
Code: [Select]
# colemak
!remap
!type=global
D=S
E=F
f=t
G=D
# ...
P=SEMICOLON
semicolon = O

# extra keys on a modded AT-F
!remap
!type=set2
FAKE_02 = LEFT_ALT
FAKE_04=RIGHT_ALT
# ...
(Case insensitive and spaces ignored).

The remapping happens using page 7 HID codes (mostly), and I have a spreadsheet with textual names for each of them already, so it would be easy to generate a table for converting the text to binary codes (e.g. SEMICOLON to 0x33). I say mostly, because I've also crammed the system and media keys into the same table (and some fakes as well, to avoid clashes) - this means every key function is coded by a single byte.

Macros are still a big TBD! I have the output side implemented, so punting a series of codes out is not a problem. Each entry in the output queue is a pair of a command byte and a data byte - I've got command bytes for changing modifiers, saving/restoring modifiers, key up, key down, etc. And I've hardcoded the trigger logic to handle the few 'odd' keys on the XT and AT. But there's still a lot of thinking to do to get it data driven, so I don't think user-definable macros will be part of v1.0.

That said, there's three kinds of macro, and for those triggered by a single key, implementation would be quite simple. In increasing order of trickiness:
Single key - can have separate macros for press and release (up to the user to make sure they make sense!)
Combination1 - single macro that is played when a combination is pressed
Combination2 - separate press and release macros (release is very tricky to track!)

What makes these things tricky is the lack of RAM, mainly.

Leaving aside that remapping shift-F1 etc is going to prevent you using that combination for its normal purpose, it sounds like you'd want the second combination type for that volume up/down example, because even the first one would leave you repeatedly pressing the key rather than just holding it down and letting it repeat.
« Last Edit: Sun, 28 August 2011, 08:18:39 by Soarer »

Offline wcass

  • Posts: 506
  • Location: Fort Lauderdale, FL, USA
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #146 on: Sun, 28 August 2011, 14:04:17 »
would it conserve RAM to only include key mappings for the hardware and configurations  one expects to use? For example, if i don't know Dvorak or Colemak then leave support for these out; if it will only be used with a standard 101 key - don't include code to handle F13-F24.

if you were to go this way, it would be configured in the front end - there would probably need to be a keyboard database with keyboard make, model, all the make/break scan codes that the controller can produce.

i see advantages of making such a thing a web app - one user would supply the scan code map for a "new" keyboard and add it to the database. other users with that model would benefit. notes about specific keys/keyboards would be displayed in the UI when  they are selected such as "this key does not send a break code and  therefore ..." or "this key is equivalent to [shift]+[F1] and therefore ...". a web app could also support the costs to develop and host itself with ads and/or "donate" buttons. A user would go to the web page and ...
  • pick one or more keyboards from a list
  • select one of a list of "standard" full set key assignments
  • make modifications to that layout
  • click on "make file"
  • your code would run on the web server (support only one OS!) and spit out a hex file for the user to download.
  • user loads hex file into teensy using appropriate loader as normal.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #147 on: Sun, 28 August 2011, 16:01:46 »
Oh, I was just using Colemak as an example, it needn't be included all the time. And for F13 etc, unless mappings were in the config file, they wouldn't take up any EEPROM space. There are some small tables used to remap the FAKE entries to usable codes, but these live in ROM, and there's plenty of that :-)

There's certainly no reason why the compiler couldn't read multiple input files before spitting out the binary EEPROM image, but I don't think there's a need for a keyboard database since the majority fall into one the four types already handled (any keys with special codes in, say, extended set 2, would need modifications to the hardcoded part of the converter anyway).

The web server idea is great, but would need to hande uploads carefully, and need a server that stays up, etc. Another option is to use a web browser for UI, but have it all run locally... the snag with that is that people update browsers, and it might break something (particularly since we'd want to read/write files), so could be a maintenance headache to keep the code compatible. On the other hand, everyone has a web browser already, so there's no scripting runtime to install. Third option would be some scripting language which has reasonable cross-platform UI support (python?). The latter has the advantage that it's no problem to call the driver to upload the compiled binary to the converter.

So far, I've been thinking only of uploading the remaps and macros to EEPROM using this setup (i.e. The main firmware would not be reloaded each time). This means you don't even have to press the button on the Teensy in order to change mappings, and your keyboard stays operational throughout. That's nice, but there's so much ROM space free, that it's tempting to reload with a modified firmware (which is what you were thinking...?).

Offline wcass

  • Posts: 506
  • Location: Fort Lauderdale, FL, USA
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #148 on: Sun, 28 August 2011, 23:19:10 »
yes, i was thinking to reload firmware when changing key maps and macros. speaking for myself, i would be be changing my computer much more frequently than key mapping.

and as far as web services go, pjrc might offer support as it inherently promotes their product. iMav might help as it is aimed at his target audience. sourceforge might work. and this forum is full of people in information technologies fields - all you need to do is ask.

if - like many programmers - you don't feel comfortable asking, i would be happy to ask for you.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #149 on: Mon, 29 August 2011, 04:43:47 »
Heh, it's not that - I'd always planned on asking for someone to do the front end when it was time! I'd rather it didn't require a server though, it just seems unnecessary. Especially if browser based, it (or the user) can easily go and fetch definition blocks from all over the place anyway. If Javascript is sufficient, I think that's the way I'd like to go - reading files would be no problem, running them (to load the mappings onto the Teensy) might mean faking a download? Obviously directly running another app is a no-no, but with a file association it could.