Author Topic: TMK IBM PC Keyboard Converter  (Read 20282 times)

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
TMK IBM PC Keyboard Converter
« on: Tue, 03 December 2019, 05:59:31 »
IBM PC Keyboard Converter

The converter translates IBM PC keyboard protocols to use classic keyboards with modern computer with USB ports. It supports both IBM XT and AT protocols(PS/2), and all of scan code set 1, 2 and 3 with one firmware.

Pin configuration is compatible for Soarer's, this firmaware works on existent Soarer's converter hardwares.

Keyboards that should be supported
- PC XT keyboard of IBM 5150 5160
  - 83-key: 1501100 1501105
- PC AT keyboard of IBM 5170
  - 84-key: 6450200 6450225
- PC Terminal keyboard of IBM 5271(3270 PC)
  - 122-key: 6110344 6110345 1397000
  - 102-key: 1390680 1395764 1392595
- PS/2 keyboards
- and many clones

This project is intended to integrated existent TMK XT, PS/2 and Terminal converters.
- IBM XT converter: https://geekhack.org/index.php?topic=94649.0
- PS/2 converter: https://geekhack.org/index.php?topic=14618.0
- IBM Terminal converter: http://geekhack.org/index.php?topic=27272.0



REQUEST FOR HELP:
This is not finish project and still work in progress. Test in the field and feedback from users are needed to improve.
Try this firmware and report your result and your keyboard model number. Also debug outputs on hid_listen would be helpful to know how keyboard is recognized.

The converter need to be tested especially with keyboards listed below, but report from user with any keyboard would be still appreciated.
- Zenith Z-150 XT black label(Let me know if you still have any issue)
- Zenith Z-150 AT beige/white label(See "Issues" below)
- IBM PC XT 83-key(Let me know if still you have any issue)
- IBM PC AT 84-key




Tested Keyboards
XT Keyboards
- IBM PC XT 83-key: 4584656, 2020-06-02
- Leading Edge DC-2014
- KeyTronic E03600 XT/AT (after Timeout error Fix)
- Zenith Z-150 XT black label

AT(PS/2) Keyboards
- IBM PC AT 84-key,
- DS-2001,
- Northgate Omnikey
- KeyTronic E03600 XT/AT
- DTK SPK 101
- FK-8000

Terminal Keyboards
- IBM Terminal: 6110345, 6111070, 6110344
- G80-2551



Update
2020-07-05 Fix for Timeout error(ERR:20)
2020-07-02 Add support for hidden keys of IBM AT 84-key to Editor
2020-06-03 Improvement for XT protocol and keyboard error recovery
2020-05-11 Add handler for keyboard buffer full to prevent key stuck
2020-05-11 Add adhoc start bit error recovery for XT keyboards
2020-04-28 Add support G80-2551 and possibly other terminal keyboards(whose id is AB86)
2020-04-11 Keymap Editor is available
2020-03-02 firmware update for XT protocol handling and many other fixes



Issues
Post your result for debug and improvement if you have keyboard below.

Z-150 beige(AT):
The converter should receive scan codes but fails to send command to the keyboard.
The converter can't control LED indicator correctly and the keyboard stops working when pressing any lock keys.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-at

Try default firmware first, if it doesn't work test firmware in 'ibmpc_z150at_fix' branch.
https://github.com/tmk/tmk_keyboard/tree/ibmpc_z150at_fix/converter/ibmpc_usb/binary

Post your result and 'hid_listen' log when pressing CapsLock key.

Solved Issues:
More





Hardware
The firmware supports ATmega32u4, ATmega32u2, AT90USB128 by default, Teensy2/2++ or Pro Micro can be used.

Wiring
Wire controller pins below to keyboard signals, besides VCC and GND. This pin configuration is compatible for Soarer's converter.
- Data    PD0
- Clock   PD1
- Reset   PB6 or PB7 (For some of XT keyboards. Not needed for AT, PS/2 and Terminal)

Pull up resistors of 1-4.7K Ohm on both Data and Clock line are strongly recommended, without them it won't work in some cases.


Reset
Old Type-1 IBM XT keyboard and some of XT clones need this to reset its controller on startup. Many of IBM XT keyboards available are Type-2 and don't need the reset pin.

See this for Type-1 vs Type-2:
https://vintagecomputer.ca/ibm-pc-model-f-keyboard-type-1-vs-type-2/

As for clones Zenith Z-150 XT and  Leading Edge DC-2014 are known to need this.


Connector pinouts

More



Pro Micro Caveat
Pro Micro is not recommended unless you are already familiar or have skill and time enough.

You have to use VCC pin to power your keyboard, not RAW pin.
RAW pin is not for 5V power supply directly from USB line. The name may be confusing but it is used for external power input, not output. You get only around 4.6V due to protection diode's forward voltage drop(0.4V typically) on RAW pin.
And you have to make J1 solder bridged, without this you will get same voltage as RAW pin or lower.
With J1 solder bridge you can get raw power(possibly 5V) directly from USB line on VCC pin. Note that RAW pin doesn't give 5V even with the solder bridge.
Check this wiki for detail. https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge

PD0, PD1 and PB6 are maked on Pro Micro PCB as 3, 2 and 10 respectively.

https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#pinout



Keymap Editor
You can edit keymap and download prebuilt firmware here.

http://www.tmk-kbd.com/tmk_keyboard/editor/#ibmpc_usb



Default Prebuilt Firmware
Try this firmware when you have trouble.

https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb/binary



Build Firmware
Download source code from: https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb

    $ cd converter/ibmpc_usb
    $ make -f Makefile.<variant> clean
    $ make -f Makefile.<variant>

You will see firmware hex file in the directory.



Debug
Use hid_listen to see debug outputs from the converter.

https://www.pjrc.com/teensy/hid_listen.html

Code: [Select]
Waiting for new device:...
Listening:


TMK:95aba6dd/LUFA


USB configured.

Keyboard start.
rAA rBF rBF wF5 rFA wF2 rFA rBF rBF wF4 rFA ID: BFBF
kbd: Terminal
wF8 rFA 



TODO
* Reset method for rescue
For converter without accesible reset button when magickey combo doesn't work.
Check pin status at powerup:
- if Data and/or Clock are pull down to GND

* Force protocol and scan code set
Keyboard discrimination may fail and you have to configure them by hand.



Resources
- https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol
- https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol



Keyboard discrimination
This section explains how the converter determines proper protocol and scan code set for keyboard. The converter need to do that before starting to receive and translate scan codes from keyboard.

More
Protocol
This converter can recognize both XT and AT protocol dynamically accoding to bit sequence received from signal line.
https://github.com/tmk/tmk_keyboard/blob/f80601db962384146eb80705aaa3057a1b3848b4/tmk_core/protocol/ibmpc.c#L272-L303

Keyboard ID
After startup the converter sends 0xF2 command to get keyboard ID and sees how the keyboard responds to the command.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#keyboard-id

Response from keyboard:

- XT keyboard doesn't support any command and returns no response.
- AT keyboard should respond with 0xFA to the command but returns no keyboard ID.
- PS/2 keyboard should respond with 0xFA to the command, followd by keyboard ID, such as 0xAB83.
- Terminal keyboard should respond with 0xFA to the command, followed by keyboard ID, such as 0xBFBF.

Now we can dscriminate the keyboard and determine suitable protocol and scan code set as described below.

Scan code Set
- Scan codes from XT keyboard are handled as CodeSet1.
- Scan codes from AT and PS/2 keyboard are handled as CodeSet2.
- Scan codes from Terminal keyhboard are handled as CodeSet3.
« Last Edit: Fri, 23 October 2020, 21:03:24 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #1 on: Sun, 05 January 2020, 20:05:56 »
anyone? please check first post.


Quote
REQUEST FOR HELP: Try and report your result.
Post your keyboard model number here, also debug outputs on hid_listen would be helpful.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #2 on: Mon, 06 January 2020, 12:00:47 »
I have a few ATMega32u4s sitting around waiting to be turned into Soarer's Converters, and probably the necessary resistors. I have both the standard IBM Model F XT, and AT. I also have some AT/XT switchable Uniteks and a DC-2014, although it already currently has a Soarer's converter I built inside of it. I know a guy that has an old RJ11 Wyse too (among other old weird things), if any of that may be helpful for testing.

What exactly is it that you wish to accomplish? An open-source alternative to Soarer's Converter? I would think that the AT/PS2 keyboards should all work just about the same, right? My F AT works with modern systems with a 5 pin din to PS2 adapter. There's certainly no shortage of random old PS2 boards that must be available to you.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #3 on: Mon, 06 January 2020, 18:46:54 »
I have a few ATMega32u4s sitting around waiting to be turned into Soarer's Converters, and probably the necessary resistors. I have both the standard IBM Model F XT, and AT. I also have some AT/XT switchable Uniteks and a DC-2014, although it already currently has a Soarer's converter I built inside of it. I know a guy that has an old RJ11 Wyse too (among other old weird things), if any of that may be helpful for testing.
Report on those keyobards would be definitely helpful. As for DC-2014 this firmware is compatible to Soarer's hardware you can just program it to test. This doesn't break your existent keymap settings of in eeprom, so you just need to program Soarer's firmware again to restore.

I really want to know my firmware with the IBM model F AT and XT(I don't own any unfortunately), they are very original and legitimate test samples for the keyboard  protocols.

I don't know much about RJ11 Wyse but I guess some of them uses Wyse specific protocol, not AT or XT.

Quote
What exactly is it that you wish to accomplish? An open-source alternative to Soarer's Converter? I would think that the AT/PS2 keyboards should all work just about the same, right? My F AT works with modern systems with a 5 pin din to PS2 adapter. There's certainly no shortage of random old PS2 boards that must be available to you.

Yes, I like to make this useful open-source converter and I will have to improve it.
I believe that there are still unexpected behaviours of keyboards and bugs on my code that cuases problems. It is difficult to find them without testing with real keyboards.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #4 on: Mon, 06 January 2020, 19:07:53 »
I tested with IBM 122-key Terminal 6110345 and it worked well.

The converter recognizes like below.
Quote
Waiting for new device:.......
Listening:


TMK:5a759850/LUFA


USB configured.

Keyboard start.
err: 2A
rAA rBF rBF wF5 rFA wF2 rFA rBF rBF wF4 rFA ID: BFBF
kbd: Terminal
wF8 rFA r3B rF0 r3B r3B rF0 r3B r3B rF0 r3B
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #5 on: Tue, 07 January 2020, 09:48:25 »
My DC-2014 doesn't have any resistors soldered to the Pro Micro (I figured that would be fine with such short wires, but I think the reset pin should still be easily accessible to flash your firmware and it does appear to be wired the same. My general-use Soarer's converter at home doesn't even have the XT reset wire soldered to it ... and that's encased in hot glue now. I really should pry it back out and resolve that though. Worst case, I'll rig up a fresh controller and get back to you, maybe tonight. I'll have to lug the F AT and DC-2014 home from work.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #6 on: Tue, 07 January 2020, 18:08:48 »
It works without pull up resistors in most cases, you don't have to modify your exisitent converter, this conveter should work if Soarer's does.
XT reset is needed only for Old Type-1 IBM XT keyboard and some of XT clones.

Don't use short wire intead of pull up resistor, it may harm on the pin.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #7 on: Wed, 08 January 2020, 09:43:05 »
What I mean is that the wires are very short, since I put the converter inside the case of the keyboard. I like to move that one around so I removed the original cable and have a short micro usb extension cable peeking out of the case. The one I have in a hardware store junction box needs to be freed from the hot glue to add the reset wire anyway, so I may as well add resistors to it as well.

Tonight, hopefully, I will get to this. My box jades for a keyboard mod are coming in today as well, so possibly not, but it all gives me an excuse to keep the soldering iron hot.

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #8 on: Fri, 10 January 2020, 22:08:35 »
Sorry about the delay. I don't get enough sleep on weekdays. Here's a fun one. It looks like the K151L worked in both AT and XT mode. Neither the F AT, nor F XT worked. The Leading Edge DC-2014 didn't work either. I did notice that the lock lights did seem to come on if I enabled them from another usb keyboard on the F AT, but the F AT lock light did not work. The F XT spewed out garbled keypresses the entire time that it was connected.

With the F AT, interestingly, it would say it was an XT keyboard until I hit the reset button I added to the Pro Micro. Here's the results of HID_Listen for that board, including after having hit the reset button:



For the F XT I unplugged the converter so that it would stop listening for me to copy the entire text ... it is a long one:

* IBM Model F XT output.txt

Here's the results from the DC-2014:



Here are the results of the K151L in AT mode:



And here are the results of the K151L in XT mode:



Let me know if you need anything else.


Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #9 on: Sat, 11 January 2020, 07:07:08 »
Thank you for the report!

As for Model F AT, can you try procedure below?
1. connect keyboard to converter
2. plug it into usb port
When you connect keyboard after usb plugin, the converter tries to recognize the keyboard as possible, but it requires several key strokes and the keys are ignored. You better connect keyboard before plugin to computer basically.

For Model F XT and DC-2014, the converter seems to miss signal, could you try attached firmware?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #10 on: Sat, 11 January 2020, 18:19:22 »
Thank you for the report!

As for Model F AT, can you try procedure below?
1. connect keyboard to converter
2. plug it into usb port
When you connect keyboard after usb plugin, the converter tries to recognize the keyboard as possible, but it requires several key strokes and the keys are ignored. You better connect keyboard before plugin to computer basically.

For Model F XT and DC-2014, the converter seems to miss signal, could you try attached firmware?

Well, with every keyboard I tested I made sure that their 5 pin din connectors were plugged into the Pro Micro before I connected the Pro Micro to the computer. I did the following with all of them:

1) Start HID_listen

2) Connect keyboard to Pro Micro

3) Connect Pro Micro to usb port on the computer

What I did with the F AT, since it was being detected as an XT keyboard for some reason when doing this, was short the reset contact to ground with a momentary button I added (while everything was still plugged in), since I figured I would need such functionality if we would be doing a lot of this.

This almost makes me want to pick up a female PS/2 adapter to wire into it as well to see what happens with random generic boards I have lying around, but I suppose they would probably work just about like the Unitek, right? I did also add a 1k resistor between data - ground and clock - ground as well, just in case (2 separate resistors). I added both of those resistors and the proper XT reset wire before I started testing your firmware.

Your alternative firmware seems to work with the DC-2014, but the XT behaved similarly to before. I would plug the Pro Micro into the computer with the keyboard already attached, no keypresses seemed to register, and HID_listen would freak out until I unplugged it. It looks like the output was a bit different this time though?

* IBM Model F XT output with alternative firmware.txt (1 kB - downloaded 39 times.)
« Last Edit: Sat, 11 January 2020, 18:39:55 by Maledicted »

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #11 on: Sat, 11 January 2020, 18:41:22 »
Just note that Pull-up register is placed between 5V and signal line, not ground. 1-10K Ohm would be fine.
To confirm your converter hardware setup before testing my firmware, you can use well-tested Soarer's converter firmware.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #12 on: Sat, 11 January 2020, 18:45:12 »
Just note that Pull-up register is placed between 5V and signal line, not ground. 1-10K Ohm would be fine.
To confirm your converter hardware setup before testing my firmware, you can use well-tested Soarer's converter firmware.

Right. 5V, not ground. My mistake. What you describe is actually how I wired it. I had previously used all of these keyboards successfully with Soarer's firmware, but I could re-test with this specific Pro Micro, and the new modifications if you like. I imagine they'll all work.

Alright, interesting results. With Soarer's converter flashed to the Pro Micro, it works with everything (including the F AT) except for the F XT, it continues to spit random things out in HID_listen. I think it might dislike the reset wire that the DC-2014 requires. I may solder an on/of switch in if I desolder the reset wire and the F XT suddenly works again with Soarer's converter.

Even with the reset wire desoldered, it is doing the same thing. Is it possible that the F XT isn't happy with a 1k ohm resistor between clock - 5v/vcc and data - 5v/vcc? I know that this keyboard worked with this very same Pro Micro without the resistors.

I think I'll throw together another basic Soarer's converter from scratch, without the resistors. I have a few more Pro Micros lying around anyway.

It just keeps getting stranger. I desoldered the resistors and resoldered the XT reset wire and the F XT did nothing. If I disconnected the XT reset wire as well, it went back to freaking out. My computer even bluescreened. I wonder what version of Soarer's firmware I originally used with this keyboard now. I'm most recently using one that somebody modified to make the Pro Micro's PB6/ contact/pin 10 into the keyboard reset line, since Soarer's firmware apparently didn't account for this on the Pro Micro.

Now the Pro Micro itself is spurting out random characters. I tried reflowing all of the solder and flashing another version of Soarer's but that didn't change anything ... I'll build a new one.
« Last Edit: Sat, 11 January 2020, 19:41:40 by Maledicted »

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #13 on: Sat, 11 January 2020, 20:36:27 »
Just note that Pull-up register is placed between 5V and signal line, not ground. 1-10K Ohm would be fine.
To confirm your converter hardware setup before testing my firmware, you can use well-tested Soarer's converter firmware.

Right. 5V, not ground. My mistake. What you describe is actually how I wired it. I had previously used all of these keyboards successfully with Soarer's firmware, but I could re-test with this specific Pro Micro, and the new modifications if you like. I imagine they'll all work.

Alright, interesting results. With Soarer's converter flashed to the Pro Micro, it works with everything (including the F AT) except for the F XT, it continues to spit random things out in HID_listen. I think it might dislike the reset wire that the DC-2014 requires. I may solder an on/of switch in if I desolder the reset wire and the F XT suddenly works again with Soarer's converter.

Interesting.
There are two types of IBM XT. Type-1 requires reset line to start up while Type-2 doesn't. But on Type-2 reset line is not connected to its controller so I believe reset line doesn't bother Type-2. Converter with reset line should work regardless of whether your XT keyboard is Type-1 or Type-2.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol#type-1-vs-type-2

If your XT is Type-1 and you use ProMicro you will have to use this modified version of Soarers' firmware to support reset line on pin 10(PB6). I belive you already know and use this on DC-2014, though.
https://deskthority.net/viewtopic.php?p=187874#p187874


Quote
Even with the reset wire desoldered, it is doing the same thing. Is it possible that the F XT isn't happy with a 1k ohm resistor between clock - 5v/vcc and data - 5v/vcc? I know that this keyboard worked with this very same Pro Micro without the resistors.

I think I'll throw together another basic Soarer's converter from scratch, without the resistors. I have a few more Pro Micros lying around anyway.

I don't think 1K pull-up resistors are problem but it is still worth trying without them.

Thanks for your time.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #14 on: Sat, 11 January 2020, 20:48:50 »
I redid all of the wiring on the Pro Micro with some good high quality silicone wire, cleaned up all of the old solder first with some wick. It seems to work with other keyboards again, with Soarer's firmware. I didn't know that some F XTs required the reset wire and that some did not, I figured it was weird "XT-like" boards that used it. I do know that my F XT refused to work on initial boot of my operating system unless I unplugged the converter and plugged it back in, without the reset wire. The F XT is still doing the same thing as before even with Soarer's firmware. I may take it apart and take a look inside. I got it with a cut cable, so I snipped a MIDI cable and soldered it in.

Let me know if there's anything else you want me to try with the F AT with your firmware in the mean time.

F XT cable tests good, all wires make a good connection to the controller and none are bridged. I should have known. I made sure this thing would never break. Mine must be a type-2, there are only 4 wires running from what's left of the original cable to the controller.

Alright, I built an entirely new Soarer's converter and the F XT is now working with that. I thought there may be something wrong with the other converter, but I think there was something flaky with the usb cable, grounding maybe, since once I removed the usb extender it would work. I still can't get the F AT or F XT to work with either version of your firmware though. At least the F XT doesn't spit out random keypresses though. So, I've tried 3 different usb cables and 2 different Pro Micros, one with and without the pullup resistors and a complete rewire, with the same results (once whatever was going on with the XT was resolved).

With a little more testing, I also noticed that the K151L was only working when I connected while it was in XT mode. If i switched it to AT mode, it would continue to work, but if I connected it while it was already in AT mode, it would not.

So, with the original firmware the K151L worked in XT mode. With the alternative firmware the DC-2014 worked.
« Last Edit: Sun, 12 January 2020, 03:59:12 by Maledicted »

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #15 on: Sun, 12 January 2020, 06:05:54 »
Let me know if there's anything else you want me to try with the F AT with your firmware in the mean time.

I found description of power-on-reset on original 84-key AT in IBM tech reference, it is  rather slower than I expected.
Could you try this new attached firmware and show me output of hid_listen when press a, s, d and f key? I need to know numbers of Ixxx and Rxxx in particular, like below.

Code: [Select]
TMK:ee0200d6/LUFA

USB configured.

Keyboard start.
I401
rAA R1163
wF5 rFA wF2 rFA rAB r83 wF4 rFA ID: AB83
kbd: AT
L1175
wED rFA w00 rFA wED rFA w02 rFA r1C rF0 r1C r1B rF0 r1B r23 rF0 r23 r2B rF0 r2B r34 rF0 r34



Quote
Alright, I built an entirely new Soarer's converter and the F XT is now working with that. I thought there may be something wrong with the other converter, but I think there was something flaky with the usb cable, grounding maybe, since once I removed the usb extender it would work. I still can't get the F AT or F XT to work with either version of your firmware though. At least the F XT doesn't spit out random keypresses though. So, I've tried 3 different usb cables and 2 different Pro Micros, one with and without the pullup resistors and a complete rewire, with the same results (once whatever was going on with the XT was resolved).

Do you test my firmware with the "new Soarer's converter", right?
Sorry but can you share output of hid_listen for F XT with this new firmware again?  Pressing a, s, d and f key would be helpful.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #16 on: Sun, 12 January 2020, 22:17:44 »
I tried both previous firmwares with both the newly assembled Pro Micro, and the previous one that I had re-wired. The results were the same other than the F XT no longer spewed out random keypresses (most of the time). I noticed that with your latest firmware the F XT spewed out random keypresses on the rebuilt Pro Micro and did not on the one that I just newly built specific for this testing. That makes no sense to me since I wired them exactly the same way this time, with the extra XT wire soldered, and no resistors.

The XT did now give results with the new firmware, on the newly-assembled Pro Micro, when pressing the a,s,d, and f keys, although that didn't seem to translate into actual character signals that the computer understood when I tried to type out text. HID_listen detected nothing at all when I used the latest supplied firmware to press the a,s,d, and f keys on the F AT. I have attached the results of your requested test with the F XT:

* Ibm Model F XT output second alternative firmware, asdf pressed.txt (0.65 kB - downloaded 41 times.)

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #17 on: Wed, 15 January 2020, 15:18:45 »
I don't mean to double post, but do you have everything you need, or is there anything else I can test for you while I have all of the boards in one place? I jump around between buildings at work, and use the DC-2014 especially at work, but also the F AT. I have been keeping them at home the last few days for testing this.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #18 on: Thu, 16 January 2020, 17:43:42 »
Maledicted,
Thank you for your service so far! I really appreciate.
I don't want to prevent you from using your keyobards anymore, feel free to place them back to where they should be when you need.

I'm debuging my code on keyboard protocol recoginition and signal handling and this will take some time. If this is not in time for your test, others in the community will help me in the end.

Thanks agian!
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #19 on: Fri, 17 January 2020, 09:14:45 »
Absolutely, anything I can do. Thank you for putting all of that effort into an open source project for the community at large.

Actually, since I posted that, I won another F AT and DC-2014 on Ebay, so I should have at least one of each available no matter what now. lol

Have others with the same boards helped elsewhere? I wouldn't be surprised if none had. I imagine a lot of people go, "Soarer's firmware works for me. I'm good." since all of these boards work fine already. I think it is pretty important to expand on the functionality of Soarer's work though myself, and being open source like that, TMK seems to have the potential to become the one catch-all solution in time.

Offline gravesgeek

  • Posts: 1
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #20 on: Sun, 02 February 2020, 12:43:35 »
Hi, I am new to the community with my model m, unicomp ultracompact.
I found a 1987model m122 with stepped key and DIN 5 plug and 1981 model f xt with DIN 5 plug from a local flea market for 30 and 40 USD, respectively.

But the problem is I am not an electronics man (MD. actually). I can find someone from the medical device maintenance dept. for soldering. But I don't think they can handle the programming.

Is there any guide for building converters from the beginning?

Is there a software with a simple interface for remapping the keys or this can be don only by code writing?

Thanks to everybody.

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #21 on: Sun, 02 February 2020, 19:43:10 »
Hi, I am new to the community with my model m, unicomp ultracompact.
I found a 1987model m122 with stepped key and DIN 5 plug and 1981 model f xt with DIN 5 plug from a local flea market for 30 and 40 USD, respectively.

But the problem is I am not an electronics man (MD. actually). I can find someone from the medical device maintenance dept. for soldering. But I don't think they can handle the programming.

Is there any guide for building converters from the beginning?

Is there a software with a simple interface for remapping the keys or this can be don only by code writing?

Thanks to everybody.

Hello gravesgeek, welcome to the keyboard obsession. You're probably best off posting a separate thread on this, but the M122 should work with most any 5-pin din to ps2 adapter with any modern computer that has a ps2 port. For the F XT, or to use either through a usb port, you'll need to build or buy a converter and flash it either with Soarer's converter firmware, or Hasu's. Pre-made converters with Soarer's firmware are readily available on Ebay.

For remapping, there are programs like SharpKeys, which seemed easy enough to me the last time I used it, but that was years ago. The zip downloads for Soarer's firmware contain documentation on how to remap keys and apply that remapping to the converter (which would, conveniently, mean that all computers you use with the converter would have that same mapping). Google searches reveal the same.

For the process of wiring and flashing, this is a simple/detailed guide:

https://deskthority.net/viewtopic.php?t=19035

Offline hking0036

  • Posts: 342
  • Location: NC, USA
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #22 on: Tue, 04 February 2020, 11:41:50 »
I can try this out - my kbd is Terminal F122 6111070. It's got french legends on the CMD keys up top but other than that I believe it is identical to 6110344.

Here is the output:
Code: [Select]
Waiting for device:.....
Listening:


TMK:5a759850/LUFA


USB configured.

Keyboard start.
rAA rBF rBF wF5 rFA wF2 rFA rBF rBF wF4 rFA ID: BFBF
kbd: Terminal
wF8 rFA

I have been using the terminal_usb converter for some time, and it has worked very well. Is there a particular intent for this FW?

P.S. Looking in unimap_trans.h, it seems that 0x58 is bound to 0x14 for Type-3 sets, but isn't marked.
« Last Edit: Tue, 04 February 2020, 14:53:03 by hking0036 »
Realforce RF87UB 45g Uniform | Leopold FC660C w/ TMK | IBM Model M - 3/24/1997 | IBM Model F 122 - 11/25/1985 ANSI'd w/ TMK | IBM Model F XT in a box

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR HELP] TMK IBM PC Keyboard Converter [2020-03-02]
« Reply #23 on: Mon, 02 March 2020, 00:00:34 »
REQUEST FOR HELP:

Updated firmware for XT protocol handling and many other fixes. 2020-03-02
Could someone try this prebuilt firmware and report your result and your keyboard model number? Also debug outputs on hid_listen would be helpful.

https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb/binary

The converter need to be tested with keyboards below particularly.

- IBM PC XT 83-key
- IBM PC AT 84-key

Thank you
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR HELP] TMK IBM PC Keyboard Converter [2020-03-02]
« Reply #24 on: Tue, 03 March 2020, 10:30:18 »
REQUEST FOR HELP:

Updated firmware for XT protocol handling and many other fixes. 2020-03-02
Could someone try this prebuilt firmware and report your result and your keyboard model number? Also debug outputs on hid_listen would be helpful.

https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb/binary

The converter need to be tested with keyboards below particularly.

- IBM PC XT 83-key
- IBM PC AT 84-key

Thank you

I'll do this this evening, if I get the chance. I have ... way too many additional keyboards I could be testing with now too.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #25 on: Tue, 03 March 2020, 17:10:41 »
I can try this out - my kbd is Terminal F122 6111070. It's got french legends on the CMD keys up top but other than that I believe it is identical to 6110344.

Here is the output:
Code: [Select]
Waiting for device:.....
Listening:


TMK:5a759850/LUFA


USB configured.

Keyboard start.
rAA rBF rBF wF5 rFA wF2 rFA rBF rBF wF4 rFA ID: BFBF
kbd: Terminal
wF8 rFA

I have been using the terminal_usb converter for some time, and it has worked very well. Is there a particular intent for this FW?

P.S. Looking in unimap_trans.h, it seems that 0x58 is bound to 0x14 for Type-3 sets, but isn't marked.

I did miss this post for no reason. Thank you for the test and insight.

Fixed the scancode in comment at this commit.
https://github.com/tmk/tmk_keyboard/commit/a4d4f14942a906d540c1f5aaf9d65fb6be17686b#diff-b9793345227e846a48d134c1e5f548f4
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #26 on: Tue, 03 March 2020, 21:18:59 »
REQUEST FOR HELP:

Updated firmware for XT protocol handling and many other fixes. 2020-03-02
Could someone try this prebuilt firmware and report your result and your keyboard model number? Also debug outputs on hid_listen would be helpful.

https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb/binary

The converter need to be tested with keyboards below particularly.

- IBM PC XT 83-key
- IBM PC AT 84-key

Thank you

I'll do this this evening, if I get the chance. I have ... way too many additional keyboards I could be testing with now too.

Also, can you try this XT converter firmware with your IBM XT keyboard?
https://geekhack.org/index.php?topic=94649.0

You can get the firmware for ATMega32u4 here.
https://github.com/tmk/tmk_keyboard/tree/master/converter/xt_usb/binary
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #27 on: Fri, 06 March 2020, 17:30:07 »
Well, On my Pro Micro with the pullup resistors, the flash failed and it appears to have nuked the bootloader. Probably my own fault for trying to flash it while connected to an unpowered hub. Not sure if I'll bother to try to unbrick it or not. It appears to have successfully flashed both variations of the bootloader to another Pro Micro I use without the resistors, but even after a second flash, your first all-in-one firmware didn't seem to function at all with a working F AT or XT. hid_listen searches endlessly and detects nothing, even after shorting reset to ground and/or pressing keys. The XT-specific firmware seemed to do the same. Flashing back to Soarer's firmware instantly restores functionality.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #28 on: Fri, 06 March 2020, 18:48:38 »
Maledicted, Thanks for the test.
Hmm, I don't see why it fails, we are missing something perhaps. I like to see feedback from others.


It would be really helpful if someone else can test.
Please  check the first post and this.
https://geekhack.org/index.php?topic=103648.msg2871066#msg2871066

Thanks
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #29 on: Sun, 08 March 2020, 23:11:05 »
Maledicted, Thanks for the test.
Hmm, I don't see why it fails, we are missing something perhaps. I like to see feedback from others.


It would be really helpful if someone else can test.
Please  check the first post and this.
https://geekhack.org/index.php?topic=103648.msg2871066#msg2871066

Thanks

Any time, hasu. You're doing great things for this community. I could try the updated firmware with he DC-2014 as well, if you like, maybe as a control. I also have ... a lot of other old XT and AT protocol boards now. NEC, Samsung, Zenith, etc, though I imagine the beige label Z-150 isn't even on your radar, and most of the rest are probably similarly functional to anything else that cloned the AT protocol.

Offline ivanthetolerable

  • Posts: 15
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #30 on: Thu, 12 March 2020, 10:27:53 »
Currently working on my F122. Using AutoHotkey to create layers of macros

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #31 on: Thu, 12 March 2020, 10:32:23 »
Currently working on my F122. Using AutoHotkey to create layers of macros

Which controller are you using? Which resistors, if any? How are you flashing? I wonder if I should pick up an authentic Teensy or two. I don't own an F122, but you would think the protocol would be be close enough to the standard XT.

That's a great username by the way, and a cool F122. Is that a GBC LCD cover/sticker? I'm using one of those same Optiplexes as an HTPC at the moment.
« Last Edit: Thu, 12 March 2020, 10:36:04 by Maledicted »

Offline ivanthetolerable

  • Posts: 15
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #32 on: Thu, 12 March 2020, 10:55:47 »
Currently working on my F122. Using AutoHotkey to create layers of macros

Which controller are you using? Which resistors, if any? How are you flashing? I wonder if I should pick up an authentic Teensy or two. I don't own an F122, but you would think the protocol would be be close enough to the standard XT.

That's a great username by the way, and a cool F122. Is that a GBC LCD cover/sticker? I'm using one of those same Optiplexes as an HTPC at the moment.

I'm just using a standard Teensy 2.0. I tried it on my F XT with no issues too.

The GBC is the cover I took off when I replaced the screen with a backlight LCD and glass protector. Didn't want to throw it out.. This Optiplex is just a standard work machine.

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #33 on: Thu, 12 March 2020, 12:17:07 »
Currently working on my F122. Using AutoHotkey to create layers of macros

Which controller are you using? Which resistors, if any? How are you flashing? I wonder if I should pick up an authentic Teensy or two. I don't own an F122, but you would think the protocol would be be close enough to the standard XT.

That's a great username by the way, and a cool F122. Is that a GBC LCD cover/sticker? I'm using one of those same Optiplexes as an HTPC at the moment.

I'm just using a standard Teensy 2.0. I tried it on my F XT with no issues too.

The GBC is the cover I took off when I replaced the screen with a backlight LCD and glass protector. Didn't want to throw it out.. This Optiplex is just a standard work machine.

Resistor configuration? What steps did you follow to flash? I really should get a Teensy then and see if the problem is with my using Pro Micros.

Those backlight mods are tempting. I still have my atomic purple GBC I got for Pokemon Red version when it came out.

Sure, it is just a standard work machine, which is nice. Business class desktops last literally forever, and even LGA 1155 i3s are more than enough for 99% of all tasks. Nice and easy to take apart and work in too.

Offline ivanthetolerable

  • Posts: 15
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #34 on: Thu, 12 March 2020, 13:01:52 »
Currently working on my F122. Using AutoHotkey to create layers of macros

Which controller are you using? Which resistors, if any? How are you flashing? I wonder if I should pick up an authentic Teensy or two. I don't own an F122, but you would think the protocol would be be close enough to the standard XT.

That's a great username by the way, and a cool F122. Is that a GBC LCD cover/sticker? I'm using one of those same Optiplexes as an HTPC at the moment.

I'm just using a standard Teensy 2.0. I tried it on my F XT with no issues too.

The GBC is the cover I took off when I replaced the screen with a backlight LCD and glass protector. Didn't want to throw it out.. This Optiplex is just a standard work machine.

Resistor configuration? What steps did you follow to flash? I really should get a Teensy then and see if the problem is with my using Pro Micros.

Those backlight mods are tempting. I still have my atomic purple GBC I got for Pokemon Red version when it came out.

Sure, it is just a standard work machine, which is nice. Business class desktops last literally forever, and even LGA 1155 i3s are more than enough for 99% of all tasks. Nice and easy to take apart and work in too.

I didn't use any resisters. Just a stanard Teensy and this guide. Before I used this https://geekhack.org/index.php?topic=17458.0

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #35 on: Thu, 12 March 2020, 17:35:59 »
Currently working on my F122. Using AutoHotkey to create layers of macros

Which controller are you using? Which resistors, if any? How are you flashing? I wonder if I should pick up an authentic Teensy or two. I don't own an F122, but you would think the protocol would be be close enough to the standard XT.

That's a great username by the way, and a cool F122. Is that a GBC LCD cover/sticker? I'm using one of those same Optiplexes as an HTPC at the moment.

I'm just using a standard Teensy 2.0. I tried it on my F XT with no issues too.

The GBC is the cover I took off when I replaced the screen with a backlight LCD and glass protector. Didn't want to throw it out.. This Optiplex is just a standard work machine.

ivanthetolerable,
Great. Thank you.
Can you share model nubmer for your  "F XT" and "F122" so that I'll update first post?


Maledicted,
I believe *decent* ProMicro should work and the converter doesn't require Teensy.

EDIT: ProMicro has several variants of pcb design and there are many clones by small vendors in the market, though. I believe SparkFun's should work at least.
https://www.sparkfun.com/products/12640

But we may miss something, I'll get ProMicro to test this firmware. What is source(site or URL) of your ProMicro so that I get same as yours?
Also can you post some pics of your ProMicro and its wiring, I can find something perhaps?



And I'll work on TMK keymap editor for this converter once I can believe it works well after getting some more reports.
« Last Edit: Thu, 12 March 2020, 17:52:39 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #36 on: Fri, 13 March 2020, 07:29:17 »
I believe I have only used these, which have worked perfectly with Soarer's firmware:

KeeYees Pro Micro ATmega32U4 5V 16MHz Micro USB Development Board Module Microcontroller for Arduino IDE Leonardo Bootloader (Pack of 3pcs)

I can get pictures after work today. They shouldn't look out of the ordinary though. Wouldn't surprise me if it is just the controllers, they're pretty cheap. lol

I did order some real Teensy 2.0s, with headers. I already have some Dupont wires lying around, so I might try to set up something modular, but semi-permanent for this stuff. Could even swap different controllers in then too I suppose. Might eventually pick up one of those Sparkfun Pro Micros to try too.

Do you ever plan on supporting the beige label Zenith Z-150. It doesn't work with the vast majority of computers with ps/2 ports, and doesn't work at all with Soarer's firmware. I found only one computer, out of 4 or 5 I tested, that had 100% function with it.
« Last Edit: Fri, 13 March 2020, 08:34:48 by Maledicted »

Offline ivanthetolerable

  • Posts: 15
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #37 on: Fri, 13 March 2020, 07:54:04 »
Currently working on my F122. Using AutoHotkey to create layers of macros

Which controller are you using? Which resistors, if any? How are you flashing? I wonder if I should pick up an authentic Teensy or two. I don't own an F122, but you would think the protocol would be be close enough to the standard XT.

That's a great username by the way, and a cool F122. Is that a GBC LCD cover/sticker? I'm using one of those same Optiplexes as an HTPC at the moment.

I'm just using a standard Teensy 2.0. I tried it on my F XT with no issues too.

The GBC is the cover I took off when I replaced the screen with a backlight LCD and glass protector. Didn't want to throw it out.. This Optiplex is just a standard work machine.

ivanthetolerable,
Great. Thank you.
Can you share model nubmer for your  "F XT" and "F122" so that I'll update first post?


Maledicted,
I believe *decent* ProMicro should work and the converter doesn't require Teensy.

EDIT: ProMicro has several variants of pcb design and there are many clones by small vendors in the market, though. I believe SparkFun's should work at least.
https://www.sparkfun.com/products/12640

But we may miss something, I'll get ProMicro to test this firmware. What is source(site or URL) of your ProMicro so that I get same as yours?
Also can you post some pics of your ProMicro and its wiring, I can find something perhaps?



And I'll work on TMK keymap editor for this converter once I can believe it works well after getting some more reports.

F XT is 4584656
f 122 is 6110344

Offline ivanthetolerable

  • Posts: 15
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #38 on: Wed, 18 March 2020, 12:20:59 »
One thing I have noticed while using this firmware for the last week is that it often up and doesn't detect my keypresses, or will randomly send a different key. This doesn't happen on my other Model F using Soarers firmware on the same Teensy. Has anyone else noticed this?

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #39 on: Wed, 18 March 2020, 12:28:57 »
I think I posted about that earlier on, in the few cases in which I had the F XT ... somewhat functional, but that was with a generic Chinesium Pro Micro as well. At some point my F AT and Leading Edge DC-2014 were working perfectly, but I certainly didn't use them as long as you have continuously. I do have some Teensies now. I do still plan to flash one and see how that goes with my boards. I just haven't gotten around to it.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #40 on: Thu, 19 March 2020, 01:05:29 »
ivanthetolerable,
The issue happens on F XT only, or both XT and 122?
Does your converter has pull up resistors? This is not root cause  probably but it may help a bit.

Maledicted,
Good to hear that It works with F AT now, it is what I expected with my fix.



I think AT protocol(AT, PS/2 and Terminal keyoards) part works as expected now.

As for XT protocol the converter has had serious problem with IBM XT keyboard.
To support various XT keyobards including IBM XT and clones, the converter should read signal(start bit) at exact timing, within a few micro second.
I guess USB interrupt can prevent this, perhaps. I'll look into.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #41 on: Thu, 19 March 2020, 08:11:20 »
ivanthetolerable,
The issue happens on F XT only, or both XT and 122?
Does your converter has pull up resistors? This is not root cause  probably but it may help a bit.

Maledicted,
Good to hear that It works with F AT now, it is what I expected with my fix.



I think AT protocol(AT, PS/2 and Terminal keyoards) part works as expected now.

As for XT protocol the converter has had serious problem with IBM XT keyboard.
To support various XT keyobards including IBM XT and clones, the converter should read signal(start bit) at exact timing, within a few micro second.
I guess USB interrupt can prevent this, perhaps. I'll look into.

I actually haven't tested it again since I bricked that one Pro Micro. I just know the F AT did work at some point, conditionally, with the old firmware. I need to rig up one of those Teensies still.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #42 on: Sun, 22 March 2020, 07:38:05 »
ivanthetolerable, Maledicted or someone else,
Could you try new firmware with IBM XT keyboard?

With the latest fix I removed USB related intterupt routine that can interfere XT signal handling.

https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/ibmpc_usb/binary/ibmpc_usb_atmega32u4.hex

hid_listen output would be helpful for me when you find glitch with the converter.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #43 on: Mon, 23 March 2020, 18:57:20 »
ivanthetolerable, Maledicted or someone else,
Could you try new firmware with IBM XT keyboard?

With the latest fix I removed USB related intterupt routine that can interfere XT signal handling.

https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/ibmpc_usb/binary/ibmpc_usb_atmega32u4.hex

hid_listen output would be helpful for me when you find glitch with the converter.

I finally stopped being lazy and made a completely modular setup including a Teensy 2.0. Through the use of a lot of dupont connectors and some quick and dirty modification of a breadboard, I can quickly connect or disconnect the XT reset wire and quickly connect or disconnect the pull-up resistors to clock and data, and even swap the Teensy out entirely should I brick it.

The IBM F XT seemed to work immediately. For whatever reason, the IBM F AT did not work at all until I pulled the resistors and reset line. After I reconnected the reset line, it started working. I added the resistors back in, and it continued to work. That could (maybe) just come down to how impermanent my setup is. The DC-2014 seemed to have perfect function immediately as well. Alas, nothing works with my beige label Zenith Z-150 still. I figured maybe using an authentic Teensy had a shot, but it doesn't work with TMK or Soarer's firmware.

I am typing this from my F XT at this very moment. Are there any other weird old boards you would like tested in particular?

I did save the results of HID_listen when pressing the a, s, d, and f keys when the F AT keyboard wasn't working, if that would at all be helpful. You'll find it attached.
« Last Edit: Mon, 23 March 2020, 19:53:18 by Maledicted »

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #44 on: Tue, 24 March 2020, 04:36:38 »
Thanks for your support!

The IBM F XT seemed to work immediately.

It will have to be tested on F XT for long period to check the issue reported by ivanthetolerable, which may be intermittent.
https://geekhack.org/index.php?action=profile;u=76741



Quote
For whatever reason, the IBM F AT did not work at all until I pulled the resistors and reset line. After I reconnected the reset line, it started working. I added the resistors back in, and it continued to work. That could (maybe) just come down to how impermanent my setup is.

Let me know if you find something on this.



Quote
The DC-2014 seemed to have perfect function immediately as well.
Great.



Quote
Alas, nothing works with my beige label Zenith Z-150 still. I figured maybe using an authentic Teensy had a shot, but it doesn't work with TMK or Soarer's firmware.


Doesn't hid_listen show anything?

Beige label  Zenith Z-150 really looks odd for AT keyboard according to people's experiences.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#whitebeige-label-zenith-z-150

Debugging this without seeing its actual signals would be really difficult. It would be helpful if you can try Soarer's Logic Analyzer on the board.
https://deskthority.net/viewtopic.php?f=7&t=4567



Quote
I am typing this from my F XT at this very moment. Are there any other weird old boards you would like tested in particular?

Black label Z-150 XT keyboard.
I'll post in deskthority thread some later if anyone doesn't  appear with it here.

https://deskthority.net/viewtopic.php?f=2&t=12972&start=30
« Last Edit: Wed, 29 April 2020, 02:26:13 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #45 on: Tue, 24 March 2020, 19:20:24 »
Thanks for your support!

I have said it before, but any time hasu. You're doing a lot of really great things for this community.

The IBM F XT seemed to work immediately.

It will have to be tested on F XT for long period to check the issue reported by ivanthetolerable, which may be intermittent.
https://geekhack.org/index.php?action=profile;u=76741

Oh man, you mean I have to try to type with the XT format for an extended period? I'll try.

For whatever reason, the IBM F AT did not work at all until I pulled the resistors and reset line. After I reconnected the reset line, it started working. I added the resistors back in, and it continued to work. That could (maybe) just come down to how impermanent my setup is.

Let me know if you find something on this.


I'll keep messing with it and see if I can reproduce it. I did try once more just now and it seems to work normally, so maybe one of the dupont connectors was just loose.

Alas, nothing works with my beige label Zenith Z-150 still. I figured maybe using an authentic Teensy had a shot, but it doesn't work with TMK or Soarer's firmware.


Doesn't hid_listen show anything?

Beige label  Zenith Z-150 really looks odd for AT keyboard according to people's experiences.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol/_edit#whitebeige-label-zenith-z-150

Debugging this without seeing its actual signals would be really difficult. It would be helpful if you can try Soarer's Logic Analyzer on the board.
https://deskthority.net/viewtopic.php?f=7&t=4567

Well, I flashed the proper firmware and attempted to run scla. It errored out just saying that MFC71.dll was missing. This is apparently a file used by Visual Studio 2003, which is, by now, ancient. The internet suggests that Internet Explorer also uses it, which seems to still be functional on my Windows 10 system, but even installing the latest community release of Visual Studio doesn't seem to resolve that error. I'm hesitant to start going around and finding VS 2003 installers, or manually downloading the dll and throwing it into System 32. Any ideas? I might have a Windows 7 system somewhere still to try with, otherwise I could even dig out my first desktop computer. I'm pretty sure that thing has an IDE/PATA hard drive in it with Windows XP installed on it. lol


I am typing this from my F XT at this very moment. Are there any other weird old boards you would like tested in particular?

Black label Z-150 XT keyboard.
I'll post in deskthority thread some later if anyone doesn't  appear with it here.

https://deskthority.net/viewtopic.php?f=2&t=12972&start=30

I don't have one of those, unfortunately. There was a guy a while back asking for help getting his working in another thread. It sounded like he eventually gave up instead of taking the effort to properly configure a controller with TMK. I do wish he would have given the board to somebody that would cooperate with you. Maybe I could find him and ask if he'll sell.

Offline Rayndalf

  • Posts: 394
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #46 on: Tue, 31 March 2020, 18:19:45 »
I recently picked up a K151L on ebay (previously I'd bought what was left of one after a harvesting on Mechmarket)

I thought about just handwiring both, but after cleaning the complete one I found it has in switch diodes, so I'm eager to convert it (and get a new badge made). I'll give this convertor a shot and see (just need to buy a female DIN plug).

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #47 on: Wed, 01 April 2020, 08:35:39 »
I recently picked up a K151L on ebay (previously I'd bought what was left of one after a harvesting on Mechmarket)

I thought about just handwiring both, but after cleaning the complete one I found it has in switch diodes, so I'm eager to convert it (and get a new badge made). I'll give this convertor a shot and see (just need to buy a female DIN plug).

Take a good look at the solder pads for the switches on the one somebody harvested the switches from and make sure they're intact if you plan on using it. Literally the only board I have ever lifted a pad on was a K151L, and I have been doing soldering for years, and have a proper temperature-controlled iron. Those PCBs are really shoddy, as much as I love those boards. They are AT/XT switchable, so you should be able to just use a 5-pin din to ps2 adapter with a modern computer, though I imagine that TMK will work (it has worked with every AT clone I have tried, besides the beige label Zenith Z-150), and I know that Soarer's firmware will work with them.

With the one I did a switch swap on, I ended up having to replace most of the diodes because the legs on the originals had rusted. With the box jades I chose to replace the "vintage" blacks, the diodes fit nicely within the switch housing.

Offline Rayndalf

  • Posts: 394
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #48 on: Wed, 01 April 2020, 14:00:37 »
The one I got in parts may have had a toggle switch for protocol, but the new one didn't work with a passive 5 pin Din to 6 pin mini Din + active ps/2 to usb converter which works with my other boards, so either its XT only (as the label somewhat suggests) or there is already a lifted pad.

Unitek/Unitech is a strange company who recycled model numbers and changed their logo to most closely match the particular product they were cloning (they started cloning Macs and now they make hearing aids?), so nothing would surprise me.

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #49 on: Wed, 01 April 2020, 14:35:04 »
The one I got in parts may have had a toggle switch for protocol, but the new one didn't work with a passive 5 pin Din to 6 pin mini Din + active ps/2 to usb converter which works with my other boards, so either its XT only (as the label somewhat suggests) or there is already a lifted pad.

Unitek/Unitech is a strange company who recycled model numbers and changed their logo to most closely match the particular product they were cloning (they started cloning Macs and now they make hearing aids?), so nothing would surprise me.

You have one with no AT/XT switch? The chassis and layout are identical otherwise? I didn't know they made any XT-only ones. You learn something every day. I fixed the pad I lifted with a scrap bit of the excess cut from the diode legs that I soldered between the trace and the switch leg, just something to look out for.

My K151L did work with TMK in XT mode, so I imagine that your oddball one will too? I guess we'll see.

Offline Rayndalf

  • Posts: 394
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #50 on: Wed, 01 April 2020, 15:09:21 »
I don't have my disassembled one on hand, but comparing the rear labels it (from an old time stamp) to my complete one and they appear to be different revisions.
http://imgur.com/a/2aZwdgY

I have yet to receive one that still has a front sticker/badge, I assume Unitek worked as an OEM and various other companies could slap their own logo on top, but I'm going to try to get some metal badges made and need some inspiration.

Sorry for derailing this thread, I'm ordering some DIN sockets  and will get a convertor made whenever they can arrive.

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #51 on: Wed, 01 April 2020, 15:22:13 »
I don't have my disassembled one on hand, but comparing the rear labels it (from an old time stamp) to my complete one and they appear to be different revisions.
http://imgur.com/a/2aZwdgY

I have yet to receive one that still has a front sticker/badge, I assume Unitek worked as an OEM and various other companies could slap their own logo on top, but I'm going to try to get some metal badges made and need some inspiration.

Sorry for derailing this thread, I'm ordering some DIN sockets  and will get a convertor made whenever they can arrive.

Cool, it is in really good shape too.

I have never seen one with a sticker or badge at all myself, lol. I wonder if they designed the case and already had the tooling and just went, "... eh, screw it." If you get any badges made, I would love to hear about it, and maybe get in on that order. You could try to recreate IBM's metal badges. It looks close enough to an F AT for it to fit in well enough.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #52 on: Sat, 11 April 2020, 05:24:57 »
Keymap Editor is available here now.

http://www.tmk-kbd.com/tmk_keyboard/editor/#ibmpc_usb

Report when you try this firmware with your keyboard.  Check first post.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #53 on: Mon, 13 April 2020, 12:05:10 »
Keymap Editor is available here now.

http://www.tmk-kbd.com/tmk_keyboard/editor/#ibmpc_usb

Report when you try this firmware with your keyboard.  Check first post.

Awesome. I'll take a look at it. I have used the F XT as much as I can stomach and can't say that any typing errors have been the result of your firmware. I thought so at first, but I think all of that has been me missing the oddly-placed and stepped modifiers, so far.

Offline PancakeMSTR

  • Posts: 484
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #54 on: Mon, 13 April 2020, 14:17:16 »
Hasu

I just gave this a try with my Northgate Omnikey Ps2. It's almost working perfectly, but I've identified two strange items. Specifically, the 'F11' and 'RALT' keys don't seem to want to fire:

239827-0

I'm not entirely sure why this would be. It could honestly be an issue with my keyboard. I'm getting RALT to fire intermittently by pressing down on it really hard.

Other than that, looks good!

« Last Edit: Mon, 13 April 2020, 14:23:19 by PancakeMSTR »
   

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter // 126 key G80-2551
« Reply #55 on: Tue, 21 April 2020, 13:51:31 »
Keymap Editor is available here now.

http://www.tmk-kbd.com/tmk_keyboard/editor/#ibmpc_usb

Report when you try this firmware with your keyboard.  Check first post.

Thanks!

A would like to ask you and the community advise how to re-map a 126 key G80-2551. Is has 4 additional keys around the nav cluster, so the 122 key layout would not work I assume. Referring to https://deskthority.net/wiki/Cherry_G80-2551 it is said that "[the] 4 extra keys which send a NULL before the key codes of 1 2 3 and 4 which means that these keys are useless on computers using the PS/2 protocol."

Any help and hints are very, very welcome before I start working on that board.

Thank you all in advance!  :thumb:

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #56 on: Tue, 21 April 2020, 18:26:35 »
Thanks!

A would like to ask you and the community advise how to re-map a 126 key G80-2551. Is has 4 additional keys around the nav cluster, so the 122 key layout would not work I assume. Referring to https://deskthority.net/wiki/Cherry_G80-2551 it is said that "[the] 4 extra keys which send a NULL before the key codes of 1 2 3 and 4 which means that these keys are useless on computers using the PS/2 protocol."

Any help and hints are very, very welcome before I start working on that board.

Thank you all in advance!  :thumb:


Use Full-key layout instead of 122-key Keymap Editor can support up to 128 keys at same time. It is different from the keyboard layout and not intuitive for the keyboard, though, you should still remmap all keys with Full-key layout.

Download firmware without editting keys when you test first, though.

I can't understand exactly what the wiki says, especially "before the keycodes of 1 2 3 and 4" part. What does the "1 2 3 and 4" mean?  I may be missing something, it would be helpful if you or someone can rephrase.

Try the firmware with default layout and see if the four keys resister something on computer. If not, use 'hid_listen' tool to see raw scan codes the keyboard spits out, so that I can update firmware for the keys if needed.

Let us know your result.


TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter // 126 key G80-2551
« Reply #57 on: Fri, 24 April 2020, 12:54:29 »
Dear All

First: a very big thanks to hasu for pointing me to 'ibmpc_usb_at90usb1286.hex' (https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/ibmpc_usb/binary/ibmpc_usb_at90usb1286.hex) to be able to use the G80-2551 with a Teensy 2++.

The "regular" 122 keys work perfectly. (I would like to arrange some keys - later).

I used hid_listen to check the scan codes for the 4 extra keys around the nav cluster (see attached pic);
for the first one "TD=" (10 o'clock in the pic) I get:

r80 !CS2_INIT!
I45570 X46071 r26 W46072 r80 W46074 rF0 W46076 R46076 wF2 rFA rAB r86 ID:AB86(2)
S46083 wED rFA w02 rFA L46090 3r26 333333333333333333333333333333333333333333

for the second "page with edge":

r80 !CS2_INIT!
I61468 X61969 r25 W61970 r80 W61972 rF0 W61974 R61975 wF2 rFA rAB r86 ID:AB86(2)
S61981 wED rFA w02 rFA L61988 4r25 44444444444444444444444444444

for the third "two pages (1/2)":

r80 !CS2_INIT!
I10585 X11087 r16 W11088 r80 W11090 rF0 W11092 R11092 wF2 rFA rAB r86 ID:AB86(2)
S11099 wED rFA w02 rFA L11106 r16 11111111111

for the forth "calc":

r80 !CS2_INIT!
I17872 X18374 r1E W18375 r80 W18377 rF0 W18379 R18380 wF2 rFA rAB r86 ID:AB86(2)
S18386 wED rFA w02 rFA L18394 r1E 22222222222222222222222222222222222

After every key press the 1s, 2s, 3s, and 4s repeat endless until I press another key.

(Just in case: here the output after I pressed qwertzuiop which behaves normal on the keyboard:
r15 qrF0 r15 r1D wrF0 r1D re24 rF0 r24 rr2D rF0 r2D r2Ct rF0 r2C r35 zrF0 r35 r3C urF0 r3C r43 irF0 r43 ro44 rF0 r44 r4D prF0 r4D)

It would be great if the 4 extra keys could be used and mapped.

Best, EspritBerlin

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #58 on: Fri, 24 April 2020, 20:52:10 »
EspritBerlin,

That hid_listen log is very helpful to add support of the extra keys.
The keyboard seem to send codes in Scan Code Set 2 like below for the keys.

TD=: 80, 26 / 80, F0, 26
page with edge: 80, 25 / 80, F0, 25
two pages: 80, 16 / 80, F0, 16
calc: 80, 1E / 80, F0, 1E

I added some codes to support the four extra keys. Try attached hex file and can you post hid_listen output again? They should not repeat key any more.

The keys are assigned to Japanese specific keys and Mute by default. This is because of compatibitly for other terminal keyboards. (You can remap the keys with editor later after I add support.)

Also check the keys with xev assuming you are on Linux. Your OS may not recognize the Japanese keys, perhaps.

* ibmpc_usb_at90usb1286.hex (54.2 kB - downloaded 25 times.)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #59 on: Sat, 25 April 2020, 01:44:34 »
Dear Hasu

Thanks for the new hex file! It works:

hid_listen reports:

TD=: r80 r26 r80 rF0 r26
page with edge: r80 r25 r80 rF0 r25
two pages: r80 r16 r80 rF0 r16
calc: r80 r1E r80 rF0 r1E

There is no repetition anymore; as you assumed, 'page with edge' does mute/unmute, the other three keys nothing so far, given that I use German keyboard layout.

xev reports:

TD=:

KeyPress event, serial 38, synthetic NO, window 0x5800001,
    root 0x1da, subw 0x0, time 792293, (-469,195), root:(392,650),
    state 0x10, keycode 132 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Page with edge:
FocusOut event, serial 39, synthetic NO, window 0x5800001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 39, synthetic NO, window 0x5800001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 39, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 

Note: in the sequence above, "keys: 2  0  0.." I got sometimes on the first keypress also 75, 419, after that always 2.

Two pages:
KeyPress event, serial 38, synthetic NO, window 0x5800001,
    root 0x1da, subw 0x0, time 1032317, (-297,-49), root:(564,406),
    state 0x10, keycode 97 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Calc:
KeyPress event, serial 38, synthetic NO, window 0x5800001,
    root 0x1da, subw 0x0, time 1121468, (-161,127), root:(700,582),
    state 0x10, keycode 101 (keysym 0xff27, Hiragana_Katakana), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Best, EspritBerlin

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #60 on: Sat, 25 April 2020, 05:06:51 »
Great. It seems to work as I expected.
And xev recognizes the four keys somehow but Xorg doesn't seems to have useful keymapping for them by default. You will have to remap the keys on Keymap Editor.

OK. I'll work on Keymap Editor for the extra keys and some other keys specific to the keyboard.

Could you look into scan codes for 10 function keys on left cluster,  6 keys above cusors key and 'Linie' keys?
You can use hid_listen again as you did in previous post. This would be helpful to make reasonable layout of Keymap Editor.

Thanks,
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #61 on: Sat, 25 April 2020, 06:17:23 »
Great. It seems to work as I expected.
And xev recognizes the four keys somehow but Xorg doesn't seems to have useful keymapping for them by default. You will have to remap the keys on Keymap Editor.

OK. I'll work on Keymap Editor for the extra keys and some other keys specific to the keyboard.

Could you look into scan codes for 10 function keys on left cluster,  6 keys above cusors key and 'Linie' keys?
You can use hid_listen again as you did in previous post. This would be helpful to make reasonable layout of Keymap Editor.

Thanks,

Please find the scan codes attached  :)

Offline eruizc

  • Posts: 1
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #62 on: Sat, 25 April 2020, 18:10:16 »
Hello everyone! I'm new to this, I'm amazed by your work but may need some insights on what to do now...
I've got a model M122 1390250 that is currently not working, this is what the hid_listen says:

Code: [Select]
Waiting for device:...
Listening:

TMK:fefe1028/LUFA

USB configured.

Keyboard start.
I458 X960
Device disconnected.
Waiting for new device:..........
Listening:

TMK:fefe1028/LUFA

USB configured

Keyboard start
I488 X989
Device disconnected.

I've noticed the keyboard has 8 switches at the back, done some research but I'm completely lost on them. The first try they were 11111110 and the second 00000001, because I read somewhere to try them like that.

What could I be missing here?

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #63 on: Sat, 25 April 2020, 19:49:48 »
eruizc,
Can you post pic of the switches for the future reference? I couldn't find it with my quick internet search.

I guess the switches cofigure part of keyboard ID and should be '0xBF'. Try below.
10111111
0100000
11111101
0000010

See Identity explanation on this page.
https://www.seasip.info/VintagePC/ibm_1390876.html

Also you better check if your converter work with other keyboard first.


EspritBerlin,
Thanks for the scan codes! I'm working on Keymap Editor and firmware for G80-2551 and will post when it is done.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #64 on: Sun, 26 April 2020, 02:15:19 »
Can you try attached firmware?
Especially for 10 function keys on left and F13-F24 portion, check if they register anything in xev. It doesn't matter what those keys registers at this point.

Other keys are expected to register as below.

Quote

 * G80-2551(Code Set 2) Unimap default mapping                                                                     
 *               ,-----------------------------------------------.
 *               |Gui|Mhk|F23|Hnk|F13|F14|F15|F16|F17|F18|F19|F20|                                                 
 *               |-----------------------------------------------|
 *               | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|                                                 
 *               `-----------------------------------------------'
 * ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.         
 * |Mut|F24| |   |   |   |   |   |   |   |   |   |   |   |   |   |       | |  /|PgU|PgD| |Esc|NmL|ScL|  *|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|         
 * |VoU|Pau| |     |   |   |   |   |   |   |   |   |   |   |   |   |     | |End|Ins|Del| |   |   |   |  +|
 * |-------| |------------------------------------------------------`    | |-----------| |---------------|         
 * |VoD|F22| |      |   |   |   |   |   |   |   |   |   |   |   |   |    | |Yen|   |  #| |   |   |   |  -|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|         
 * |Psc|App| |    |   |   |   |   |   |   |   |   |   |   |   |          | |   |Hom|   | |   |   |   |   |
 * |-------| |-----------------------------------------------------------| |-----------| |-----------|Ent|         
 * |Gui|F21| |     |   |                                  |    |   |       | RO|   |KAN| |       |  .|   |
 * `-------' `-----'   `---------------------------------------'   `-----' `-----------' `---------------'         
 * 

* ibmpc_usb_at90usb1286.hex (54.78 kB - downloaded 24 times.)



Great. It seems to work as I expected.
And xev recognizes the four keys somehow but Xorg doesn't seems to have useful keymapping for them by default. You will have to remap the keys on Keymap Editor.

OK. I'll work on Keymap Editor for the extra keys and some other keys specific to the keyboard.

Could you look into scan codes for 10 function keys on left cluster,  6 keys above cusors key and 'Linie' keys?
You can use hid_listen again as you did in previous post. This would be helpful to make reasonable layout of Keymap Editor.

Thanks,

Please find the scan codes attached  :)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #65 on: Sun, 26 April 2020, 03:32:06 »
I checked new firmware. I have serious trouble with repeating keys for the 10 function keys on the left.
Please see details attached.

I have not checked F1-F24 etc so far.

Can you try attached firmware?
Especially for 10 function keys on left and F13-F24 portion, check if they register anything in xev. It doesn't matter what those keys registers at this point.

Other keys are expected to register as below.


Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #66 on: Sun, 26 April 2020, 04:30:25 »
Thanks for testing.

I think this fixes the problem.

* ibmpc_usb_at90usb1286.hex (54.83 kB - downloaded 26 times.)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #67 on: Sun, 26 April 2020, 05:18:06 »
Thank you!

I tested the new firmware esp. regarding the repeating for the left 10 function keys.
It got better, but it seems that they only register about every second key press and get rarely into the repeating mode again.
Very left column of keys (labeled: Abruf=row1, PsAus=row2, ErAus=row3, Druck=row4, blank=row5) behave as follows:

Abruf (row1):sometimes toggles between mute and volume, fast repeating key presses lead to loop/repeating on/off vol

PsAus (row2): every 2nd to 3rd key press increases vol

ErAus (row 3): singe key press has no action, 3 fast key presses = vol - by auto repeat

Druck (row 4): print screen works without problems

blank (row 5): menu key loops/repeats (same as in my post before: pressing d leads to desktop); I can leave this loop only by unplugging Teensy from USB.

I added some information in the attached docs for the 5 keys.
Please let me know how I can help to investigate further.



Thanks for testing.

I think this fixes the problem.

(Attachment Link)

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #68 on: Sun, 26 April 2020, 06:14:06 »
I seems to have missed something to be cared for.
hope new firmware fixes the problems this time.

* ibmpc_usb_at90usb1286.hex (54.83 kB - downloaded 25 times.)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #69 on: Sun, 26 April 2020, 08:34:52 »
The loops are gone! The firmware did not hung or crash once, no unexpected behavior!

I have tested the firmware and attached hid_listen output for
- 10 function keys (left)
- 24 F keys (top)
- nav cluster
- num pad (right)

For the 10 function keys I included xev, for the remaining keys I tested if xev output was given.

Since this layout opens the opportunity to move arrow keys to inverted T this would be a good option I think.
Please let me know if further testing/reporting is needed to support you.

Thanks, best, EspritBerlin

I seems to have missed something to be cared for.
hope new firmware fixes the problems this time.

(Attachment Link)

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #70 on: Sun, 26 April 2020, 10:06:30 »
EspritBerlin,

I updated Keymap Editor for G80-2551 support. You can acess it here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ibmpc_usb_1286_terminal

Keys are expected to register as below with default mapping. Function keys on left and top row are not straight
due to difference from IBM 122-key. Those keys can be remappable somehow, Editor is not intuitive though.

Try it and report if you find something weird.

Quote

 * G80-2551(Code Set 2) Unimap default mapping
 *               ,-----------------------------------------------.
 *               |Gui|Mhk|F23|Hnk|F13|F14|F15|F16|F17|F18|F19|F20|
 *               |-----------------------------------------------|
 *               | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|
 *               `-----------------------------------------------'
 * ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |Mut|F24| |   |   |   |   |   |   |   |   |   |   |   |   |   |       | |NmL|PgU|PgD| |Esc|ScL|  *|  /|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|
 * |VoU|Pau| |     |   |   |   |   |   |   |   |   |   |   |   |   |     | |End|Ins|Del| |   |   |   |  +|
 * |-------| |------------------------------------------------------`    | |-----------| |---------------|
 * |VoD|F22| |      |   |   |   |   |   |   |   |   |   |   |   |   |    | |Yen|   |  #| |   |   |   |  -|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|
 * |Psc|App| |    |   |   |   |   |   |   |   |   |   |   |   |          | |   |Hom|   | |   |   |   |   |
 * |-------| |-----------------------------------------------------------| |-----------| |-----------|Ent|
 * |Gui|F21| |     |   |                                  |    |   |       | RO|   |KAN| |       |  .|   |
 * `-------' `-----'   `---------------------------------------'   `-----' `-----------' `---------------'
 * JPY: JIS ¥
 * KAN: ひらがな
 * RO: JIS ろ(Japanese RO)
 * Hnk: 変換(Japanese Henkan)
 * Mhk: 無変換(Japanese MuHenkan)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #71 on: Sun, 26 April 2020, 12:27:59 »
Hi Hasu

Thank you for all the work! I did work on the nav cluster, worked fine!
As you expected I am did not manage to do some changes to some keys. I attached an example (see hex and pic).
Num, nav, home, end, page up/down worked fine; new Esc (=1), insert (=2), three most right keys of num pad (=3) are resistant [all are mapped in the editor].
Furthermore gui assigment (last row, 10er fun keys) are resistant to change.

This is what his_listen reports for the 'new' keys
- ESC: r5F rF0 r5F
- insert: r1/7 rF0 r17
- old scl/new P/: r7E *rF0 r7E
- old */new Px: r7C -rF0 r7C
- old P() new P/: rE0 r4A ^[[2~rE0 rF0 r4A

Could you give me a hint how to change the behaviour of those 'strage' keys?

Thank you very much, best, EspritBerlin

EspritBerlin,

I updated Keymap Editor for G80-2551 support. You can acess it here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ibmpc_usb_1286_terminal

Keys are expected to register as below with default mapping. Function keys on left and top row are not straight
due to difference from IBM 122-key. Those keys can be remappable somehow, Editor is not intuitive though.

Try it and report if you find something weird.

Quote



Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #72 on: Mon, 27 April 2020, 02:11:54 »
Remmaping the keys is tricky.

For example,
When you want to Key1 in your pic:
The key of G80-2551 is refered as 'F24', see Fig.1 below.
You can remap the Key1 with changing key indicated as 'F24' in Fig.2 on Keymap Editor. i.e. key on left top.

When you want to Key2 in your pic:
The key of G80-2551 is refered as 'NmL'(NumLock), see Fig.1 below.
You can remap the Key2 with changing key indicated as 'NmL' in Fig.2 on Keymap Editor. You can find 'NmL' on keypad portoin, next to 'ESC' in Keymap Editor.

Hope this helps.

Fig.1 Default keymap of G80-2551
Quote

 *               ,-----------------------------------------------.
 *               |Gui|Mhk|F23|Hnk|F13|F14|F15|F16|F17|F18|F19|F20|
 *               |-----------------------------------------------|
 *               | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|
 *               `-----------------------------------------------'
 * ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |Mut|F24| |   |   |   |   |   |   |   |   |   |   |   |   |   |       | |NmL|PgU|PgD| |Esc|ScL|  *|  /|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|
 * |VoU|Pau| |     |   |   |   |   |   |   |   |   |   |   |   |   |     | |End|Ins|Del| |   |   |   |  +|
 * |-------| |------------------------------------------------------`    | |-----------| |---------------|
 * |VoD|F22| |      |   |   |   |   |   |   |   |   |   |   |   |   |    | |JPY|   |  #| |   |   |   |  -|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|
 * |Psc|App| |    |   |   |   |   |   |   |   |   |   |   |   |          | |   |Hom|   | |   |   |   |   |
 * |-------| |-----------------------------------------------------------| |-----------| |-----------|Ent|
 * |Gui|F21| |     |   |                                  |    |   |       | RO|   |KAN| |       |  .|   |
 * `-------' `-----'   `---------------------------------------'   `-----' `-----------' `---------------'

Fig.2 Default keymap of Keymap Editor
Quote

 *               ,-----------------------------------------------.
 *               |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
 *               |-----------------------------------------------|
 *               |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|
 *               `-----------------------------------------------'
 * ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |Mut|Hkn| |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Yen| BS| |  /|PgU|PgD| |Esc|NmL|ScL|  *|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|
 * |VoU|Pau| |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \| |End|Ins|Del| |  7|  8|  9|  +|
 * |-------| |-----------------------------------------------------------| |-----------| |-----------|---|
 * |VoD|Mhk| |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #| Ret| |JPY|Up |  #| |  4|  5|  6|  -|
 * |-------| |-----------------------------------------------------------| ,-----------| |---------------|
 * |Psc|App| |Shif|  \|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO| Shift| |Lef|Hom|Rig| |  1|  2|  3|Ent|
 * |-------| |-----------------------------------------------------------| |-----------| |-----------|---|
 * |Gui|Gui| |Ctrl|    |Alt |          Space              |Alt |    |Ctrl| | RO|Dow|KAN| |  ,|  0|  .|  =|
 * `-------' `----'    `---------------------------------------'    `----' `-----------' `---------------'
 * JPY: JIS ¥
 * KAN: ひらがな
 * RO: JIS ろ(Japanese RO)
 * Hnk: 変換(Japanese Henkan)
 * Mhk: 無変換(Japanese MuHenkan)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #73 on: Mon, 27 April 2020, 07:49:19 »
EspritBerlin,
Can you try this temporary firmware for test if you have time?

* ibmpc_usb_at90usb1286.hex (56.78 kB - downloaded 24 times.)

I got some idea of handling G80-2551 as a Terminal keyboard(Code Set 3). Current firmware sees it as weird PC keyboards with 126 keys.

I like to know whether G80-2551 supports decently 'Code Set 3' and its scan codes are correspondent with genuine IBM ones.
We can have better/straight mapping support in Keymap Editor perhaps if the keyboard does.

It would be helpful if you can share hid_listen output of firmware startup.

Genuine terminal keyboard should send scan codes like below. Can you check left 10-key function portion and  F13-F24 especially? If they look all good look into four extra keys around cursors also.

Quote

 *               ,-----------------------------------------------.
 *               | 08| 10| 18| 20| 28| 30| 38| 40| 48| 50| 57| 5F|
 *               |-----------------------------------------------|
 *               | 07| 0F| 17| 1F| 27| 2F| 37| 3F| 47| 4F| 56| 5E|
 *               `-----------------------------------------------'
 * ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
 * | 05| 06| | 0E| 16| 1E| 26| 25| 2E| 36| 3D| 3E| 46| 45| 4E| 55| 5D| 66| | 67| 6E| 6F| | 76| 77| 7E|*84|
 * |-------| |-----------------------------------------------------------| |-----------| |---------------|
 * | 04| 0C| | 0D  | 15| 1D| 24| 2D| 2C| 35| 3C| 43| 44| 4D| 54| 5B|  5C | | 64| 65| 6D| | 6C| 75| 7D| 7C|
 * |-------| |-----------------------------------------------------------| `-----------' |---------------|
 * | 03| 0B| | 14   | 1C| 1B| 23| 2B| 34| 33| 3B| 42| 4B| 4C| 52| 53| 5A |     | 63|     | 6B| 73| 74| 7B|
 * |-------| |-----------------------------------------------------------| ,-----------. |---------------|
 * |*83| 0A| | 12 | 13| 1A| 22| 21| 2A| 32| 31| 3A| 41| 49| 4A| 51|  59  | | 61| 62| 6A| | 69| 72| 7A| 79|
 * |-------| |-----------------------------------------------------------| `-----------' |---------------|
 * | 01| 09| | 11  |   |19  |        29                   |39  |   | 58  |     | 60|     | 68| 70| 71| 78|
 * `-------' `-----'   `---------------------------------------'   `-----'     `---'     `---------------'
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #74 on: Mon, 27 April 2020, 11:33:28 »
Dear Hasu

Please find attached the hid_listen codes for 10 F keys on the left, nav cluster, F1-F24, and num pad.

Please let me know if I can help further

EspritBerlin,
Can you try this temporary firmware for test if you have time?


Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #75 on: Mon, 27 April 2020, 22:41:08 »
EspritBerlin,
Great. The keyboard seems to be very straight terminal keyboard except for the extra keys.

I just updated firmware in Keymap Editor to support G80-2551 in better way. This update breaks your current keymap probably and you will have to start mapping from scratch.

To get new version Editor you may need to reload Keymap Editor page completely in web browser with Shift+Control+R or summat.

Try mapping especially on the extra keys in Keymap Editor. Mapping keys should be very straight now.

Thanks,
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline EspritBerlin

  • Posts: 12
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #76 on: Tue, 28 April 2020, 00:50:00 »
Dear Hasu

I can confirm that all keys can be mapped. I am running the prior proposed mapping

- nav as inverted T
- num pad 'modern style'
- ESC on left 10 F keys
- changed position of menu key

Thank you very, very much for your help and patience!

Kind regards, EspritBerlin


EspritBerlin,
Great. The keyboard seems to be very straight terminal keyboard except for the extra keys.

I just updated firmware in Keymap Editor to support G80-2551 in better way. This update breaks your current keymap probably and you will have to start mapping from scratch.

To get new version Editor you may need to reload Keymap Editor page completely in web browser with Shift+Control+R or summat.

Try mapping especially on the extra keys in Keymap Editor. Mapping keys should be very straight now.

Thanks,

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #77 on: Tue, 28 April 2020, 23:18:04 »
At long last, I stopped being lazy and installed wine on a Linux install I have lying around for that beige label Zenith Z-150. scla works on there, at least. I'll attach the full output from sctrace, and a zip file of every individual screenshot of a zoomed-in visualization of that output from scla. Here's a selection from the output, in order:

241039-0

241041-1

241043-2

241045-3

241047-4

* Zenith Z-150 Beige Label scla output.zip (238.13 kB - downloaded 24 times.)

I hope that's everything you need to crack the case. Otherwise, let me know.

I think I mentioned it last time, but the portB version of sctrace basically did nothing, by the way. This was with the portD version of sctrace.
« Last Edit: Tue, 28 April 2020, 23:21:47 by Maledicted »

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #78 on: Wed, 29 April 2020, 02:23:10 »
Maledicted,
Great contribution! Thank you for your time.

Zenith Z-150 Beige asserts stop bit as low level(0) for some reason, this is obvious violation of IBM PC AT protocol.




That is why many PS/2 converters and PS/2 port on PC fail to talk with the keyboard. Converter and PC with decent implementation of AT keyboard protocol won't accept the keyboard.

https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#whitebeige-label-zenith-z-150

TMK IBM PC Keyboard Conveter doesn't check validity of stop bit, I don't think the stop bit prevents the converter from working. I may miss something else.

What ouputs do you get on hid_listen with the latest firmware?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #79 on: Wed, 29 April 2020, 21:10:01 »
I wish I could help more than what little I may have done. With the latest version of TMK it acts much the same:



That's all I can get because none of the keys register, the beeper doesn't even work. I tested with an old Fujitsu board, which is most likely AT, as a control and that board worked as it should. Even on the HP 8200 system that the board does work with (beeper and all keys), it still doesn't seem to always initiate caps lock, num lock, etc as you would normally expect from a keyboard, and on some other computers mashing caps lock over and over again would sometimes get the rest of the keys to register.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #80 on: Wed, 29 April 2020, 21:57:27 »
hid_listen log is almos always really helpful for me to debug.
'Copy and paste' log text is good enough unless taking screenshot is easier for you.

The converter can read powerup test result code(rAA) from the keyboard at startup as I expected.
But the keyboard doesn't response with 'read ID' command(wF2) at all and seems to stop working since then.

I just changed firmware temporarily to skip the 'read ID' and recognize it as AT(Code Set 2) automatically. You can type keys with firmware perhaps. And I guess it stops after pressing Caps Lock or Num Lock.

Can you try pressing Q, W, Caps Lock, A and S in this order? hid_listen log would be helpul again.

* ibmpc_usb_atmega32u4.hex (54.39 kB - downloaded 22 times.)

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #81 on: Wed, 29 April 2020, 23:01:30 »
hid_listen log is almos always really helpful for me to debug.
'Copy and paste' log text is good enough unless taking screenshot is easier for you.

The converter can read powerup test result code(rAA) from the keyboard at startup as I expected.
But the keyboard doesn't response with 'read ID' command(wF2) at all and seems to stop working since then.

I just changed firmware temporarily to skip the 'read ID' and recognize it as AT(Code Set 2) automatically. You can type keys with firmware perhaps. And I guess it stops after pressing Caps Lock or Num Lock.

Can you try pressing Q, W, Caps Lock, A and S in this order? hid_listen log would be helpul again.

(Attachment Link)

Here you go:

Keyboard start.
I267 X769 rAA W1213 R1714 ID:0000(2)
S1714 wED w00 L1750
ERR:17
r15 rF0 r15 r1D rF0 r1D r58 wED w04
ERR:17
rF0 r58 r1C rF0 r1C r1B rF0 r1B

It looks like it actually has full function with that modified firmware, it even seems to toggle caps lock num lock and scroll lock normally, and continues to type. Interestingly, the LED status lights for the lock keys do not work though.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #82 on: Thu, 30 April 2020, 00:34:14 »
Can you try this and check if the LED indicators works?

* ibmpc_usb_atmega32u4.hex (54.26 kB - downloaded 22 times.)

According to this post in reddit,
it seems that the indicators are controlled internally by the keyboard, instead of the converter.

https://www.reddit.com/r/MechanicalKeyboards/comments/16woai/having_troubles_with_my_newly_acquired_zenith/

Quote
I recently picked up a Zenith data systems keyboard from 1984. Its in great condition. It has an AT plug so i got an AT(dim 5) to PS/2 adapter. I plug it in and it not registering with windows. It does however light up the num lck and caps lock when pressed and the keys make faint beeps when pressed.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #83 on: Thu, 30 April 2020, 17:38:01 »
That seems to have brought no functional change. I'm using the board right now to type this. These green Alps are wonderful. I noticed that Sys Req muted my computer's audio, lol. Is that a normal feature of TMK? The weird thing is that the lock lights do work on every direct ps2 connection computer that I could get the board to somewhat work on, even the ones where I had to mash the caps lock key many times on to get the rest of the keys to register.

With the HP 8200, literally everything works normally, though the lock keys don't always necessarily engage their corresponding lock mode on every press.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #84 on: Thu, 30 April 2020, 18:09:16 »
It depends on what scan code Sys Req key sends. What does log output show when pressing the key?
EDIT: And what does the key register on HP 8200?


WIth internet search I found people said many computers and PS/2 converters couldn't handle with the keyboard.
PS/2 port on HP 8200 can handle with beige Z-150. Interesting. Do you have other computer that can do with the keyboard?

When plugin USB keyboard with HP 8200 as well and press lock key on the USB keyboard, does indicator of Z-150 on PS/2 port change?
If yes the it means keyboard can receive commands from computer.



That seems to have brought no functional change. I'm using the board right now to type this. These green Alps are wonderful. I noticed that Sys Req muted my computer's audio, lol. Is that a normal feature of TMK? The weird thing is that the lock lights do work on every direct ps2 connection computer that I could get the board to somewhat work on, even the ones where I had to mash the caps lock key many times on to get the rest of the keys to register.

With the HP 8200, literally everything works normally, though the lock keys don't always necessarily engage their corresponding lock mode on every press.

« Last Edit: Thu, 30 April 2020, 18:20:32 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #85 on: Thu, 30 April 2020, 19:38:56 »
It took me a while to even find a tool that would work with the Sys Req key. Nirsoft always seems to have an awesome utility for everything. Sys Req is functioning as print screen by default. Relatedly, the actual print screen key functions only as *, regardless of number lock status, etc.

I looked back through a thread I started in February when I first tested all of this. My HP may actually be an 8300. I think they're basically the same, HP just added USB 3.0 ports to the 8300 vs 8200. I tested on quite a few computers, though I think I may have more I could try now. A lot of the others I didn't at the time because they don't even have operating systems on them.

It had perfect function on my:

HP 8200/8300
Compaq SR1920nx (yeah, that's an oldie, my first desktop computer)

It had partial function by mashing the caps lock key many times on an old Dell XPS 630, in Linux Mint ... maybe 17 or so. The same trick didn't work in Windows 10.

It didn't work at all on any other computer I tried.

The lock keys of a separate keyboard do indeed turn on the corresponding indicator LED of the Zenith when connected to the HP.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #86 on: Fri, 01 May 2020, 08:40:16 »
Then, the keyboard supports commands somewhat.

I tweaked timing of command signal a bit.
Can you try attached firmware and post 'hid_listen' log with pressing the 'Sys Req' key, Caps Lock and Num Lock?

* ibmpc_usb_atmega32u4.hex (54.65 kB - downloaded 23 times.)

The lock keys of a separate keyboard do indeed turn on the corresponding indicator LED of the Zenith when connected to the HP.

As for the '*/Print screen' key, I think it worked as Print screen on original XT AT computer when pressed with Shift key. But mordern  OS and USB keyboards don't have the feature. The key just registers 'numpad *' with the converter and modern PCs.
And I think the 'Sys Req' key on IBM AT 84-key keyboard should be registered as Print screen. Its scan code is 0x84 but Z-150 seems to use diffrent code perhaps.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #87 on: Sat, 02 May 2020, 00:09:30 »
That new firmware does not work with the keyboard at all. On my first reboot after flashing it, the keys would still beep, but it wasn't sending any codes to the computer. Every other try after the keyboard would do nothing, so I flashed it back to the previous firmware and everything but the lock lights is working again. The caps lock and num lock keys, although they function normally, do not send any codes that hid_listen detects. I think I could get the specific codes with that Nirsoft utility I found though.

Here it is with sys req:

TMK:2e5e6a69+/LUFA


USB configured.

Keyboard start.
I279 X781 rAA W1224 R1725 ID:0000(2)
S1725 L1725 r7F rF0 r7F r58 rF0 r58 r77 rF0 r77

The utility is KeyboardStateView

Key Name   Description   Key Code   Hex Key Code   Key Pressed   Key Toggled
VK_CAPITAL   CAPS LOCK key   20   0x14   *   *   5/2/2020 12:03:25 AM

Key Name   Description   Key Code   Hex Key Code   Key Pressed   Key Toggled   Last Key Press Time   
VK_NUMLOCK   NUM LOCK key   144   0x90   *   *   5/2/2020 12:04:03 AM   

Those are, all standard, I imagine.

Here's Sys Req, with the converter:

Key Name   Description   Key Code   Hex Key Code   Key Pressed   Key Toggled   Last Key Press Time   
VK_VOLUME_MUTE   Volume Mute key   173   0xad   *   *   5/2/2020 12:08:34 AM   


Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #88 on: Sat, 02 May 2020, 00:28:31 »
Sorry. It seems I attached wrong or corrupt firmware for no reason.

Can you try this instead and check if the indicators work with Caps Lock and Num Lock?

* ibmpc_usb_atmega32u4.hex (54.56 kB - downloaded 22 times.)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #89 on: Sat, 02 May 2020, 00:50:28 »
That firmware is doing the same thing, with the Fujitsu control board from before as well.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #90 on: Sat, 02 May 2020, 01:20:41 »
That firmware is doing the same thing, with the Fujitsu control board from before as well.

I believe the firmware should display hid_listen log at least and wonder old firmware is sitll in the converter.
Could you check the file and flash it again?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #91 on: Sat, 02 May 2020, 01:47:31 »
That firmware is doing the same thing, with the Fujitsu control board from before as well.

I believe the firmware should display hid_listen log at least and wonder old firmware is sitll in the converter.
Could you check the file and flash it again?

I deleted the old firmware file from my computer, copied the latest to its place, flashed it, and tested. Then I flashed to the firmware prior to it, tested, flashed back to the latest and tested. That's what I did before posting the previous message. Now I deleted it once more, downloaded it again, renamed it just in case the Teensy flashing utility had cached it somewhere or something, and flashed it once more.

The results are all the same.

Here's what hid_listen says with this firmware:

Keyboard start.
I232 wED
ERR:11
X733 rAA W1178 R1679 ID:0000(2)
S1679 wED
ERR:11
L1750

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #92 on: Sat, 02 May 2020, 08:49:02 »
The keyboard still doesn't like how the converter sends command and the request ends in timeout.

Attached firmware revised for signal timing again. Also fixed for 'SysRq' key, it should register Print Screen now.

* ibmpc_usb_atmega32u4.hex (54.72 kB - downloaded 20 times.)

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #93 on: Sat, 02 May 2020, 18:14:55 »
Same results, functionally. No beeps, no key codes sent.

TMK:da82c5f3+/LUFA


USB configured.

Keyboard start.
I297 X799 rAA W1243 R1744 ID:0000(2)
S1744 wED
ERR:11
L1797


Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #94 on: Sun, 03 May 2020, 04:48:41 »
I looked into some ps/2 port of computers and PS/2 converters kicking around and found some variations of sginal handling there but got no definite useful finding. We will have to do a bunch of trials and errors on timing values without any insight :(

What does hid_listen show with attached firmware when pressing CapsLock?

* ibmpc_usb_atmega32u4.hex (54.69 kB - downloaded 17 times.)


I wonder what Soarer's converter display on its debug log with the Z-150. Can you try it too?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline acid2000

  • Posts: 18
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #95 on: Sun, 03 May 2020, 16:26:51 »
Iíve been testing the latest TMK firmware from the github link you shared. The newer ones posted in the forum just spew out garbage.

Overall it is better than when I was testing in September but still has lots of issues.

Iím using an XT 83 key 5150 UK layout with a 5V Pro Micro without reset connected. Itís either connected into a powered USB hub or with a Y cable into a 2.1amp PSU to ensure the voltage doesnít drop. It has strong pull-ups and the cable to the board itself is short.

I have built a few pro micros with Soarers before. With XTs I usually power it up with the RAW pin and bypass the regulator all together to make sure the power doesnít dip. I canít remember if I did this in this one.

It works well with Soarers and is my daily driver.

Iíve got some hid listen output for a few different states.
* No input, power on and donít touch anything. I left it for around 5m. I was expecting to see nothing but got some things that look like errors.
* Holding down Q. I have two different outputs with slightly different results. Iíve tried a few keys and Q always seems to show issues.
* General typing. Iíve included the ASCII output from the keyboard and the corresponding hid_listen results.

Testing is a PITA for me. For some reason I canít get the Soarers fw into the bootloader from Windows. I need to bridge the reset pin by hand. I have a few 5150 keyboards and in all of them my adapter is inside the keyboard glued in place and wrapped in electrical tape.

Back in September there were lots of problems with stuck keys. This looks like that is solved (only did a bit of testing) but instead I do get an incorrect keypresses. Is this a timing error?

Iím really hoping that one day soon these issues can be resolved. Iím quite familiar with the TMK codebase now and already have some mods Iíve written Iíd like to push up when theyíve been tested.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #96 on: Sun, 03 May 2020, 19:55:33 »
acid2000,
Thanks a lot for the report.
It sems to read a lot of garbage and phantom key press of Q and not completely miss signals.
The converter read signal at diffrent timing from Soarer's and it can be fussy on signal cleanness. But I don't know why Soarer's can work even with this situation. The setup of same keyboard with same Pro Micro works well with Soarer's firmware?

My fIrmware can still have a silly bug or room to improve but I'd suspect its power line first. I'm not totally sure power voltage drop causes  serious problem like these.

Quote
Iím using an XT 83 key 5150 UK layout with a 5V Pro Micro without reset connected. Itís either connected into a powered USB hub or with a Y cable into a 2.1amp PSU to ensure the voltage doesnít drop. It has strong pull-ups and the cable to the board itself is short.

I have built a few pro micros with Soarers before. With XTs I usually power it up with the RAW pin and bypass the regulator all together to make sure the power doesnít dip. I canít remember if I did this in this one.

I got Pro Micro and looked into closely the other day and found something people are likely to misunderstand.

DId you check voltage with multimeter?
First, RAW pin is not for 5V power supply directly from USB line. The name may be not easy to understand but it is used for external power input, not output. You get voltage with diode's forward voltage drop(0.4V typically) on RAW pin.

You have to use VCC pin to power your keyboard, not RAW pin.

And you have to make J1 solder bridged, without this you will get same voltage as RAW pin or lower.

With J1 soder bridge you can get raw power(possibly 5V) from USB line on VCC pin, note that RAW pin doesn't give 5V even with the solder bridge.

Check this wiki for detail.
https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge


TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #97 on: Sun, 03 May 2020, 20:37:53 »
I looked into some ps/2 port of computers and PS/2 converters kicking around and found some variations of sginal handling there but got no definite useful finding. We will have to do a bunch of trials and errors on timing values without any insight :(

What does hid_listen show with attached firmware when pressing CapsLock?

(Attachment Link)


I wonder what Soarer's converter display on its debug log with the Z-150. Can you try it too?

With the firmware you attached, this is the result in hid_listen after having pressed caps lock, which caused the board to stop responding. Before I press caps lock with that firmware, the regular keys seem to function and beep like normal. After pressing it, they stop working:

TMK:b9de6db4+/LUFA


USB configured.

Keyboard start.
I287 X789 rAA W1234 R1735 ID:0000(2)
S1735 L1735 r58 rF0 r58

The keyboard doesn't work at all with Soarer's firmware, so this is all hid_listen reports:

Listening:
R08 wEE

remaining: FFFC


Keyboard ID: 0000
Code Set: 1
Mode: PC/XT

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #98 on: Sun, 03 May 2020, 21:10:02 »
With the firmware you attached, this is the result in hid_listen after having pressed caps lock, which caused the board to stop responding. Before I press caps lock with that firmware, the regular keys seem to function and beep like normal. After pressing it, they stop working:

TMK:b9de6db4+/LUFA


USB configured.

Keyboard start.
I287 X789 rAA W1234 R1735 ID:0000(2)
S1735 L1735 r58 rF0 r58

Didn't you see any output like 'wED' or 'ERR:11' as before?
I expect the error output when seding command of 'set indicator'(ED). Debug prints is not very reliable and you have to try several times perhaps?



I see. R08 means stop bit error. Soarer's do very right thing, it is totally the keyboard's fault.
I wonder why Zenith made the keyboard not compliant to AT protocol :(

Quote
The keyboard doesn't work at all with Soarer's firmware, so this is all hid_listen reports:

Listening:
R08 wEE

remaining: FFFC


Keyboard ID: 0000
Code Set: 1
Mode: PC/XT

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline acid2000

  • Posts: 18
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #99 on: Mon, 04 May 2020, 03:25:12 »
My fIrmware can still have a silly bug or room to improve but I'd suspect its power line first. I'm not totally sure power voltage drop causes  serious problem like these.

I checked again a few things again, Iím not doing any power shenanigans.

Soarers converter works without issue, I swap the fw to TMK and have issues.
Iíve tried on 2 different XT keyboards both built around the same time using two different ProMicros. Same issues.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #100 on: Mon, 04 May 2020, 03:57:23 »
My fIrmware can still have a silly bug or room to improve but I'd suspect its power line first. I'm not totally sure power voltage drop causes  serious problem like these.

I checked again a few things again, Iím not doing any power shenanigans.

Soarers converter works without issue, I swap the fw to TMK and have issues.
Iíve tried on 2 different XT keyboards both built around the same time using two different ProMicros. Same issues.

I belive you can't get 5V at RAW on Pro Micro and you need to use VCC pin with J1 solder bridged. (It seems liek most of cheap Pro Mciros come without the solder bridge) I'm NOT sure that voltage of power matters, though.

It would be helpful if you can see whether there are any difference with 5V when you have time.
« Last Edit: Mon, 04 May 2020, 04:03:22 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline acid2000

  • Posts: 18
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #101 on: Mon, 04 May 2020, 06:52:41 »
J1 on the pro micro is for voltage select. 3V vs 5V.

Iím running a 5V pro micro.

Running at 3v is way out of spec for an XT. In the past Iíve run accidentally on 3v and they wonít come up.
Even if they did (by tapping of the usb power) you would be driving a 5V GPIO with 3V, it would probably work but would be a PITA to set up.

Run your ProMicro at 5V.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #102 on: Mon, 04 May 2020, 07:25:16 »
J1 on the pro micro is for voltage select. 3V vs 5V.

Iím running a 5V pro micro.

Running at 3v is way out of spec for an XT. In the past Iíve run accidentally on 3v and they wonít come up.
Even if they did (by tapping of the usb power) you would be driving a 5V GPIO with 3V, it would probably work but would be a PITA to set up.

Run your ProMicro at 5V.

No, I'm not referring 3.3V Pro Micro.

Did you check the wiki page?
Beleive me, you will get only 4.6V typically from RAW pin even if you are using 5V version Pro Micro.
You should be able to confirm this with multimeter easily, or this can be evident from its schematic also.

To get proper 5V you have to do both two things below.
1) Make solder bridge on J1
2) Use VCC pin to give keyboard power , not RAW pin

https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #103 on: Mon, 04 May 2020, 08:48:07 »
J1 on the pro micro is for voltage select. 3V vs 5V.

Iím running a 5V pro micro.

Running at 3v is way out of spec for an XT. In the past Iíve run accidentally on 3v and they wonít come up.
Even if they did (by tapping of the usb power) you would be driving a 5V GPIO with 3V, it would probably work but would be a PITA to set up.

Run your ProMicro at 5V.

No, I'm not referring 3.3V Pro Micro.

Did you check the wiki page?
Beleive me, you will get only 4.6V typically from RAW pin even if you are using 5V version Pro Micro.
You should be able to confirm this with multimeter easily, or this can be evident from its schematic also.

To get proper 5V you have to do both two things below.
1) Make solder bridge on J1
2) Use VCC pin to give keyboard power , not RAW pin

https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge

I suppose that could explain why all of my Pro Micros only intermittently worked with TMK, but Teensies work fine. I'll have to look at that.

I do still plan on flashing back to your most recently posted modified TMK firmware by the way, it was just getting late last night. Is there any sort of sniffing we could try to do on a computer that natively works with the beige label Z-150 to figure out how/why?

Also, maybe if you could point me to what values to play with, and what you think the general threshold may be, I could tweak the timings myself?

Offline acid2000

  • Posts: 18
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #104 on: Mon, 04 May 2020, 13:29:25 »
Iíve bought a Teensy 2.0 from an official distributor.

This will be the last time I give this a go. I hope it works.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #105 on: Wed, 06 May 2020, 02:25:27 »
J1 on the pro micro is for voltage select. 3V vs 5V.

Iím running a 5V pro micro.

Running at 3v is way out of spec for an XT. In the past Iíve run accidentally on 3v and they wonít come up.
Even if they did (by tapping of the usb power) you would be driving a 5V GPIO with 3V, it would probably work but would be a PITA to set up.

Run your ProMicro at 5V.

No, I'm not referring 3.3V Pro Micro.

Did you check the wiki page?
Beleive me, you will get only 4.6V typically from RAW pin even if you are using 5V version Pro Micro.
You should be able to confirm this with multimeter easily, or this can be evident from its schematic also.

To get proper 5V you have to do both two things below.
1) Make solder bridge on J1
2) Use VCC pin to give keyboard power , not RAW pin

https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridge

I suppose that could explain why all of my Pro Micros only intermittently worked with TMK, but Teensies work fine. I'll have to look at that.

If you can confirm that  the lower voltage power of Pro Micro affects any keyboard this would be worth sharing with the community and I would make a thread for this Pro Micro topic.


Quote
I do still plan on flashing back to your most recently posted modified TMK firmware by the way, it was just getting late last night. Is there any sort of sniffing we could try to do on a computer that natively works with the beige label Z-150 to figure out how/why?

Also, maybe if you could point me to what values to play with, and what you think the general threshold may be, I could tweak the timings myself?

It would be great if you can tweak code and test it in quick turnaround.

To get my current working source code repo from github.com run commands below, this is needed just once.
Code: [Select]
git clone -b ibmpc_z150at_fix https://github.com/tmk/tmk_keyboard.git
cd tmk_keyboard/
git submodule update --init
cd converter/ibmpc_usb/

Then, just run 'make' command to build firmware in 'tmk_keyboard/converter/ibmpc_usb/' directory.
Code: [Select]
make
You will find firmware file 'ibmpc_usb.hex' in the directory.

The current firmware should work with Z-150 AT until you press CapsLock, NumLock key.
Let me know one you can get this working on your side.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline acid2000

  • Posts: 18
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #106 on: Wed, 06 May 2020, 03:54:04 »
I bridged J1 in my Pro Micro, very little changed.

Teensy should arrive in the next few days. If it doesnít work with that then itís TMK otherwise it is the Pro Micro.

Offline acid2000

  • Posts: 18
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #107 on: Thu, 07 May 2020, 12:55:16 »
So I got the teensy 2. Wired it up with 1k pull ups and I still have problems.

Iíve attached the results of holding down Q for about 1m. You can see the incorrect key presses at the end.

Given Iíve now changed the hardware can we agree that this is a bug in TMK?

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #108 on: Thu, 07 May 2020, 19:36:27 »
So I got the teensy 2. Wired it up with 1k pull ups and I still have problems.

Iíve attached the results of holding down Q for about 1m. You can see the incorrect key presses at the end.

Given Iíve now changed the hardware can we agree that this is a bug in TMK?

Thanks for the test. Can you attach it again or just post it with code tag?

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #109 on: Thu, 07 May 2020, 23:19:39 »
I haven't touched anything else with TMK yet, but I got one of those Monoprice adapters in. I initially didn't bother trying one since I literally bought every single design that looked different from one another in their listings and tested them previously. None worked, at least 2-3 ended up looking exactly the same as each other even though they didn't in the listing, and the Monoprice one actually looks a lot like most of those ones that matched.

The Monoprice adapter did, in fact, end up working with the beige label Z-150 though. Same thing as the first firmware you got working with it. 100% function other than the lock lights not illuminating.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #110 on: Fri, 08 May 2020, 00:29:23 »
I haven't touched anything else with TMK yet, but I got one of those Monoprice adapters in. I initially didn't bother trying one since I literally bought every single design that looked different from one another in their listings and tested them previously. None worked, at least 2-3 ended up looking exactly the same as each other even though they didn't in the listing, and the Monoprice one actually looks a lot like most of those ones that matched.

The Monoprice adapter did, in fact, end up working with the beige label Z-150 though. Same thing as the first firmware you got working with it. 100% function other than the lock lights not illuminating.

The Monoprice adapter did lock lights for other AT keyboards?
And it can handle F7 key correctly? This post on Deskthority referred the key.

https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#monoprice-ps2-converter-bluecube
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #111 on: Fri, 08 May 2020, 01:23:37 »
I haven't touched anything else with TMK yet, but I got one of those Monoprice adapters in. I initially didn't bother trying one since I literally bought every single design that looked different from one another in their listings and tested them previously. None worked, at least 2-3 ended up looking exactly the same as each other even though they didn't in the listing, and the Monoprice one actually looks a lot like most of those ones that matched.

The Monoprice adapter did, in fact, end up working with the beige label Z-150 though. Same thing as the first firmware you got working with it. 100% function other than the lock lights not illuminating.

The Monoprice adapter did lock lights for other AT keyboards?
And it can handle F7 key correctly? This post on Deskthority referred the key.

https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#monoprice-ps2-converter-bluecube

You are a hawk. Good call on F7. It does not work with the Monoprice adapter. I'm pretty sure that it worked with straight ps2 on the HP. The lock lights do work with the NEC APC-H410EA I tested with, and so did F7.

I flashed back to the first TMK firmware that that allowed full function sans the lock lights and confirmed that F7 works fine with the beige label Z-150 that way.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #112 on: Wed, 13 May 2020, 10:17:46 »
Maledicted,

Can you try this firmware with Z-150 AT and post hid_listen log?

https://raw.githubusercontent.com/tmk/tmk_keyboard/80a172448cebce73d232746ea0f8bd05934cb88c/converter/ibmpc_usb/binary/ibmpc_usb_atmega32u4.hex

I like to know if it shows 'PRT:11' instead of 'PRT:10', the firmware can recognize Z-150 AT specific protocol now.
Also press CapsLock to see how it goes in log.


Code: [Select]
Waiting for new device:.......
Listening:


TMK:a709d822/LUFA


USB configured.

Keyboard start.
I428 wFF rFA A1433
PRT:10 ISR:FE90 rAA W1785 R2286
ID:0000(2) S2286 L2286 r29 rF0 r29
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Maledicted

  • Posts: 1399
  • Location: Wisconsin, United States
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #113 on: Thu, 14 May 2020, 18:03:02 »
Maledicted,

Can you try this firmware with Z-150 AT and post hid_listen log?

https://raw.githubusercontent.com/tmk/tmk_keyboard/80a172448cebce73d232746ea0f8bd05934cb88c/converter/ibmpc_usb/binary/ibmpc_usb_atmega32u4.hex

I like to know if it shows 'PRT:11' instead of 'PRT:10', the firmware can recognize Z-150 AT specific protocol now.
Also press CapsLock to see how it goes in log.


Code: [Select]
Waiting for new device:.......
Listening:


TMK:a709d822/LUFA


USB configured.

Keyboard start.
I428 wFF rFA A1433
PRT:10 ISR:FE90 rAA W1785 R2286
ID:0000(2) S2286 L2286 r29 rF0 r29

Alright, interesting results with this one. I flashed your new test firmware and now all 3 lock lights flash on, flicker, and then shut off whenever pressing caps lock or scroll lock. Until the lock lights shut off again, the keyboard doesn't respond to key presses, but resumes doing so after they do shut off. It does the same thing, in all regards, if I press l press caps lock on another connected keyboard. Pressing num lock works like the first working firmware in that it toggles num lock, but the lights do not react. I can type immediately after pressing this lock key.

I noticed that, sometimes, pressing caps lock will lock up the whole board and I have had to pres caps lock on another keyboard to return functionality to the Z-150. In these cases, the board doesn't seem to send any output related to having pressed caps lock to the computer until pressing caps lock on another keyboard and pressing a key, in which case it belatedly sends both.

This is the result of connecting the Teensy with the keyboard attached, and then pressing caps lock:

Keyboard start.
I250 wFF A1253
ERR:17 ISR:6A90
PRT:11 ISR:0000 X1755 rAA W2198 R2699
ID:0000(2) S2699 L2699 r58 wED
ERR:11

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #114 on: Thu, 14 May 2020, 21:34:50 »
Alright, interesting results with this one. I flashed your new test firmware and now all 3 lock lights flash on, flicker, and then shut off whenever pressing caps lock or scroll lock. Until the lock lights shut off again, the keyboard doesn't respond to key presses, but resumes doing so after they do shut off. It does the same thing, in all regards, if I press l press caps lock on another connected keyboard. Pressing num lock works like the first working firmware in that it toggles num lock, but the lights do not react. I can type immediately after pressing this lock key.

Can you post the whole of log outputs during this process?

I guess the keyboard seems to wait for signal or something after the covnerter tries and fails to send 'set LED' command. I don't know why NumLock  behaves diffrently from other Lock keys, though.

Quote
I noticed that, sometimes, pressing caps lock will lock up the whole board and I have had to pres caps lock on another keyboard to return functionality to the Z-150. In these cases, the board doesn't seem to send any output related to having pressed caps lock to the computer until pressing caps lock on another keyboard and pressing a key, in which case it belatedly sends both.

Another 'set LED' command caused by another keyboard may recovers from lockup somehow.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #115 on: Wed, 03 June 2020, 02:19:39 »
Updated firmware.  commit:7cf306 2020-06-03

Chages since the last update commit:42b7bf:
- Improvement for XT protocol, especially for genuine IBM 83-key keyboard. The converter now should work well with them.
- Fix signaling on how to send command in AT protocol. Realforce 101 failed to receive 'Set LED' commands occasionally.
- Various improvements for compatibility and error recovery

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #116 on: Thu, 02 July 2020, 06:19:49 »
Updated 'Keymap Editor' to add support for hidden keys of IBM AT 84-key.

https://deskthority.net/viewtopic.php?p=467498#p467498
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Diskfix

  • Posts: 8
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #117 on: Sat, 04 July 2020, 03:30:48 »
Neat stuff. Will the Elite-C https://deskthority.net/wiki/Elite-C also work?

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3893
  • Location: England
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #118 on: Sat, 04 July 2020, 03:42:45 »
Neat stuff. Will the Elite-C https://deskthority.net/wiki/Elite-C also work?

The important thing is the microcontroller chip not the USB connector - it will work :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod
MX Brown 30g, HHKBish
Vortex OEM PBT
for See how the other half lives challenge!

Offline Diskfix

  • Posts: 8
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #119 on: Sat, 04 July 2020, 04:19:40 »
The important thing is the microcontroller chip not the USB connector - it will work :)
Thanks! Just got a elite-c with two broken tracks after desoldering with a newer purpose.


Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #120 on: Sat, 04 July 2020, 08:24:51 »
Just thought i'd post with one success story and one failure.
In my attic a few days ago i tripped over an old keyboard with a nicer mechanism than what i've been typing on recently.
It's a Key Tronic J980405319.
I think i picked it up around 2000-2001. It was likely a few years old when i came by it.
246396-0246394-1
Since i had a Chinese Ardino Pro Micro in my parts bin which i knew could do HID it seemed like a fun day's hacking.

This keyboard has a little switch on the back with the following positions:
 * AT
 * Enhansed AT/XT
246398-2

Lots of space inside the case for the Pro Micro and i had to disassemble it any way to give all the mechanical parts a good scrub.
246400-3

Since my multimeter implied there were already pullup resistors in place in the keyboard ps2 circuitry, i didn't bother adding more.
I also soldered the little 5Volt jumper closed to provide the keyboard with it's required supply voltage.

I'm using the prebuilt binary so far from here: https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb/binary

So rather than write the firmware myself, i found this project.
I had this up and running in a few hours (including scrubbing the old keyboard clean).
Good job! 5 stars. Would recommend.

So, debug output:
With the little switch set to "Enhansed AT/XT" it worked first time.
Here's the debug output having typed "qwerty[Enter]":
Code: [Select]
duncan@lapdancer:~/Working/hid_listen/hid_listen$ sudo ./hid_listen
Waiting for device:....
Listening:


TMK:0ab0ebf8/LUFA


USB configured.

Keyboard start.
I421 wFF rFA A1427
PRT:10 ISR:FE90 rAA W1720 wF2 rFA rAB r83 R2226
ID:AB83(2) S2226 wED rFA w00 rFA L2234 r15 qrF0 r15 r1D wrF0 r1D r24 erF0 r24 r2D rrF0 r2D r2C trF0 r2C r35 yrF0 r35 r5A
rF0 r5A

Not as lucky with the "XT" setting though.
I get occasional restarts when the bus is busy. "Num Lock" and "Caps Lock" LEDs flash during the restart.
Here's the debug where i plug in the Kbd with switch set to XT, wait a minute (with no restarts) then press and hold down "a":
Code: [Select]
duncan@lapdancer:~/Working/hid_listen/hid_listen$ sudo ./hid_listen
Waiting for device:........
Listening:


TMK:0ab0ebf8/LUFA


USB configured.

Keyboard start.
I418 wFF A1455
ERR:11 ISR:AAA0
PRT:21 ISR:0000 X1957 rAA W1958 wF2 R2494
ID:FFFF(1)
ERR:11 ISR:AAA0 S2495 L2495 r1E ar1E aar1E aaar1E aaar1E aaa
ERR:20 ISR:3D40 [RST] I8261 wFF A9298
ERR:11 ISR:AAA0 X9800 rAA W9801 wF2 R10337
ID:FFFF(1)
ERR:11 ISR:AAA0 S10338 L10338

One theory i want to test is that internal pull up resistors are in place when the the switch is i the "XT" position...
Maybe the XT spec needs them on the host side?
Next time i have the cover open i will measure this.

So what i have is more than good enough; I don't need the XT setting to work but though this anomaly might interest people here.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #121 on: Sat, 04 July 2020, 09:47:20 »
Thanks for the feedback.

ERR:20 means timeout when reading from keyboard, the keyboard clocking is a bit slow, perhaps.
Other ERRs are expected for XT keyboard and I don't see no problem there.
And pullup resistors don't seem to be related in this case probably.

Can you try attached firmware? This has prolonged timeout parameter.
* ibmpc_usb_atmega32u4.hex (55.14 kB - downloaded 20 times.)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #122 on: Sat, 04 July 2020, 16:33:54 »
Same same with the linked firmware:
Code: [Select]
duncan@lapdancer:~/Working/hid_listen/hid_listen$ sudo ./hid_listen
Waiting for device:.......
Listening:


TMK:7cf3060a+/LUFA


USB configured.

Keyboard start.
I422 wFF A1459
ERR:11 ISR:AAA0
PRT:21 ISR:0000 X1961 rAA W1962 wF2 R2498
ID:FFFF(1)
ERR:11 ISR:AAA0 S2499 L2499 r1E ar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaa
ERR:20 ISR:3D40 [RST] I30017 wFF A31054
ERR:11 ISR:AAA0 X31556 rAA W31557 wF2 R32093
ID:FFFF(1)
ERR:11 ISR:AAA0 S32094 L32094

Quote
ERR:20 means timeout when reading from keyboard, the keyboard clocking is a bit slow, perhaps.
Would that cause the apparent restart of the keyboard though? (The "Num Lock" and "Caps Lock" flashing the way they do at power up.)
Isn't it more likely the keyboard restarting is causing TMK to timeout and so displays ERRL20?

« Last Edit: Sat, 04 July 2020, 16:36:58 by mrdunk »

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #123 on: Sat, 04 July 2020, 19:47:58 »
Did that reset happen while holding 'A' key or just when releasing the key?

The converter checks time elapsed to received one byte data for error recovery, keyobard hot plug-in and swap. And it resets the keyobard to recover error when timeout error happens.
Timeout parameter is 1ms with default firmware, 2ms for previous attached one.

But keyboard should not take so long but I may be missing something or the timeout error logic may have bug.

Can you try this attached firmwares below?


This has 3ms timeout check.
* ibmpc_usb_atmega32u4_3mstimeout.hex (55.14 kB - downloaded 18 times.)

And this one without tiemout check.
* ibmpc_usb_atmega32u4_notimeout.hex (54.98 kB - downloaded 19 times.)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #124 on: Sat, 04 July 2020, 20:40:55 »
Quote
Did that reset happen while holding 'A' key or just when releasing the key?
While holding it.

Quote
And it resets the keyboard to recover error when timeout error happens.
Understood. Thanks.

ibmpc_usb_atmega32u4_3mstimeout.hex
That seems to have fixed it:
Code: [Select]
duncan@lapdancer:~/Working/hid_listen/hid_listen$ sudo ./hid_listen
[sudo] password for duncan:
Waiting for device:..................
Listening:


TMK:7cf3060a+/LUFA


USB configured.

Keyboard start.

PRT:21 ISR:AAA0 I424 wFF A1461
ERR:11 ISR:AAA0 X1963 rAA W1964 wF2 R2500
ID:FFFF(1)
ERR:11 ISR:AAA0 S2501 L2501 r1E ar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E
I Mashed the keyboard for a while after that without problem.

For the sake of completeness,
ibmpc_usb_atmega32u4_notimeout.hex:
Code: [Select]
duncan@lapdancer:~/Working/hid_listen/hid_listen$ sudo ./hid_listen
Waiting for device:............
Listening:


TMK:7cf3060a+/LUFA


USB configured.

Keyboard start.

PRT:21 ISR:AAA0 I422 wFF A1459
ERR:11 ISR:AAA0 X1961 rAA W1962 wF2 R2498
ID:FFFF(1)
ERR:11 ISR:AAA0 S2499 L2499 r1E ar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aara1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aar1E aaar1E aaar1E aaar1E aaar1E aaar1E aar9E a
Again, i can mash the keyboard with no issues.

I wonder if some sort of autoconfiguration would work here?
When you first power on, start with a very long timeout, flash the Capslock LED while reducing the timeout.
When it eventually fails you have a minimum acceptable  timeout so double it and save the value to EPROM for future boots.

Or just pick a value long enough that it seems to work for everyone and allow users to manually modify it.
(I presume going too long here will lead to poor update speed?)

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #125 on: Sat, 04 July 2020, 22:26:24 »
Thanks for the test.
I'll go with the '3ms' timeout and update default firmware in github repo soon later.

In current firmware the converter detects timout error if signal sequence takes more than 1.0ms. But this seems to be too small for the keyboard and some others. I can't remember why I selected the value but it is too small obviously.

Now with '3ms' paramter the converter waits to receive signal for 2.0ms at least. I don't think there is a keyboard that needs more than 2.0ms. Timeout error and its error recovery are intended to minimize possiblity of wrong key input deu to bad wiring, hot plugin or hot swap. So it is better that the parameter is small value as possible.

Automatic timeout parameter tune like that seems to me too complex and overkill for this purpose. I believe there is no large variety of clocking speed among keyboards.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #126 on: Sun, 05 July 2020, 04:33:23 »
I'd be a little worried that there are other keyboards out there that need a longer delay but whose user does not have the experience to contact you.

If i interpret your explanation correctly it is very unlikely there would be a valid reset after the first few keystrokes.
Also if my keyboard is within the average range, the actual reset takes ~200ms (I'm guessing here but it's a long time).
I don't see much advantage in keeping this number low.

A statistician would probably draw a bell curve around the examples you know about and tell you about the probability of the examples you don't...
Would there be any harm in taking the longest example you have proof of (3ms) and doubling it to catch the untested edge cases? So 6ms.

I have a friend who i haven't talked to in too long that has loads of classic video game equipment. I might send him an email and see if he has any XT keyboards in his collection we can test on... I can send him a pre-programmed board.

As for the actual value of the timeout, it's your project so your choice.
It works well for me as it is.
Thanks for the cool project!

dunk.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #127 on: Sun, 05 July 2020, 09:37:03 »
Timeout parameter I'm refering is used when receiving data and is not used for keyboard reset.
Its timer starts when receiving start bit and ends with stop bit.

For reference these pics show waveforms of AT/XT keyboard signal, which takes around 1ms to send one byte data.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol#waveforms
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#waveform
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #128 on: Sun, 05 July 2020, 17:50:11 »
Thanks for the links; They were simpler times....

Quote
Timeout parameter I'm refering is used when receiving data and is not used for keyboard reset.
Yes, but i thought you reset the keyboard if there was an error:
Quote
The converter checks time elapsed to received one byte data for error recovery, keyobard hot plug-in and swap. And it resets the keyobard to recover error when timeout error happens.

So if there's a timeout after 1ms (or 3ms on my keyboard) the keyboard gets reset and isn't usable for (guessing a number here) ~200ms.
Since any receive error now leads to the keyboard being unusable for 100s of ms, i don't see the point in picking an aggressively small number for the timeout.

Imagine the scenario where someone's keyboard repeat rate is 10 chars per second (or 100ms between characters).
While holding the "a" down, an error occurs.
With your timeout set to 1ms you notice the error, reset the keyboard and are ready for input again after 201ms.
If you set the RX timeout to 6ms, you are ready for input again after 206ms.
At a repeat rate of 10, you haven't missed any more characters being sent.
Any additional latency is not a noticeable amount of time for the user. (And the keyboard reset is already giving them a much worse experience anyway.)

Or am i missing something?

Anyway,
if i've not convinced you yet, i'll leave it at that.

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #129 on: Sun, 05 July 2020, 18:03:43 »
This is fun: IBM's original technical reference for the XT:
http://www.minuszerodegrees.net/manuals/IBM_5155_5160_Technical_Reference_6280089_MAR86.pdf

The interesting bit for this conversation is page 4.33 "Keyboard Data Output"
It's actually quite vague about the exact timing; It specifies the /length/ of a clock pulse:
Quote
During each clock cycle, the keyboard clock is active for 25 to 50 microseconds.
but does not specify how long between cycles.
This make some sense on the resource limited systems of the day but there muts have been /some/ timeout otherwise there would be no way to recover from a keyboard malfunction (like you are trying to do).

I think this reference supports my case for avoiding aggressive timeouts though...
I would think that though wouldn't i?

dunk.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #130 on: Sun, 05 July 2020, 22:03:15 »
Thanks for the links; They were simpler times....

Quote
Timeout parameter I'm refering is used when receiving data and is not used for keyboard reset.
Yes, but i thought you reset the keyboard if there was an error:
Quote
The converter checks time elapsed to received one byte data for error recovery, keyobard hot plug-in and swap. And it resets the keyobard to recover error when timeout error happens.

So if there's a timeout after 1ms (or 3ms on my keyboard) the keyboard gets reset and isn't usable for (guessing a number here) ~200ms.
Since any receive error now leads to the keyboard being unusable for 100s of ms, i don't see the point in picking an aggressively small number for the timeout.

The timeout error doesn't(should not) occur while normal usage unless keyobard, converter and wiring are falty.
Those critical faults cannot be recovery with converter firmware anyway, you will have to fix hardware problem or a bug in firmware basically.

And note that bigger timeout parameter increases possiblity of wrong or random key inputs. This is not what we want.

Keyboard reset is not necessarily required for recovery if we don't need hot-swap/plugin support.(I want it though) You can clear internal state of the converter to sync next clock signal from keyboard somehow instead of reset. But in the case of hot-swap/plugin it is inevitable for connection to be unstable temporarily, then timerout or other errors can occur. It requires keyboard reset to recover from those errors.



Quote
Imagine the scenario where someone's keyboard repeat rate is 10 chars per second (or 100ms between characters).
While holding the "a" down, an error occurs.

Again the timeout error is exceptional and should not happen unless your keyobard and converter are good enough. If you see the error you will have to fix something, such as bad wiring, firmware bug, faulty hardware, or  etc....


Quote
With your timeout set to 1ms you notice the error, reset the keyboard and are ready for input again after 201ms.
If you set the RX timeout to 6ms, you are ready for input again after 206ms.
At a repeat rate of 10, you haven't missed any more characters being sent.
Any additional latency is not a noticeable amount of time for the user. (And the keyboard reset is already giving them a much worse experience anyway.)

Or am i missing something?

Anyway,
if i've not convinced you yet, i'll leave it at that.

I'm not sure about this part, you mean 6ms timeout is better?
Anyway, I think you don't have to worry about that.


You can check codes here if you are still interested.

How to detect timeout error:
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/ibmpc.c#L248-L267

Check error and keyboard reset(initialize):
https://github.com/tmk/tmk_keyboard/blob/master/converter/ibmpc_usb/ibmpc_usb.c#L131-L146
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #131 on: Sun, 05 July 2020, 23:01:43 »
NIce find. I can't remember I checked this before.

That descriptions in 4.32-4-33 is really useful to grasp how XT protocol works.
(Some clone XT keyboards are clearly not compliant to this, though.)

This is fun: IBM's original technical reference for the XT:
http://www.minuszerodegrees.net/manuals/IBM_5155_5160_Technical_Reference_6280089_MAR86.pdf

The interesting bit for this conversation is page 4.33 "Keyboard Data Output"
It's actually quite vague about the exact timing; It specifies the /length/ of a clock pulse:
Quote
During each clock cycle, the keyboard clock is active for 25 to 50 microseconds.
but does not specify how long between cycles.
This make some sense on the resource limited systems of the day but there muts have been /some/ timeout otherwise there would be no way to recover from a keyboard malfunction (like you are trying to do).

Right, XT has no error detection and recovery like that, keyboard interface on host side is comprised of discrete only logic ICs and deliberate circuit without microcontroller. I guess you get garbege input on XT computer until reset if you replug keyboard while it is powered.


Quote
I think this reference supports my case for avoiding aggressive timeouts though...
I would think that though wouldn't i?

dunk.

I'm still not sure I understand what your concern is exactly.
Ah, you worry about exsistence of keyboard that takes long beyond 2ms to send data? I think it is slight chance but exceptional example can exist even if the specification clearly define the value.

Yes, bigger timeout parameter can support the exceptionally slow keyboard, but not good for most of keyboards. It increases possiblity of missing timeout error.

I think 2ms is safe enough. And it is worth to get error report from user if keyboard like that really exists.



TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #132 on: Mon, 06 July 2020, 04:43:59 »
Quote
Ah, you worry about exsistence of keyboard that takes long beyond 2ms to send data?
Exactly.
My keyboard needs 3ms when switched to XT when we originally thought 1ms was safe.
There are bound to be other edge cases that are worse.

Quote
Yes, bigger timeout parameter can support the exceptionally slow keyboard, but not good for most of keyboards. It increases possiblity of missing timeout error.
What would missing the timeout error look like?
I guess one byte would run into the next, resulting in garbage input until the user stopped pressing keys for as long as the timeout value (and the resulting reset).
Resetting the keyboard because of a timeout is only useful at startup; If you reset the keyboard later, while the user is typing, the keyboard reset is as harmful as missing a timeout.

Anyway,
we disagree but that's ok.
This is an edge case which users can inform you about if it is an issue.

One last clarification,
my keyboard worked with your 3ms timeout firmware in XT mode not 2ms. (Just incase you are using my kbd as the longest supported.)

Thanks for the interesting discussion!

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #133 on: Mon, 06 July 2020, 05:01:24 »
Wait, your keyboard should work with the latest firmware,

I updated  github repo with using '3ms' parameter, which means 'timeout error' happens  when it takes more than 2ms.
This is confusing,  but it is how the firmware works in fact due to timer resolution and timeout detection logic.

You confirmed the keyboard worked with temp firmware with '3ms' parameter. (https://geekhack.org/index.php?topic=103648.msg2928549#msg2928549) So, I think you are ok with the latest firmware too.

Try the latest firmware. Let me know if it doesn't work.

https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb/binary
« Last Edit: Mon, 06 July 2020, 05:20:57 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #134 on: Mon, 06 July 2020, 05:11:32 »
Quote
You confirmed the keyboard worked with temp firmware with '3ms' parameter.
Yup. It worked with ibmpc_usb_atmega32u4_3mstimeout.hex .

I'll confirm the latest in github works the same later. (Monday morning here. got work to do debugging networking switch firmware.)

Offline mrdunk

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #135 on: Mon, 06 July 2020, 09:34:35 »
Quote
I'll confirm the latest in github works the same later.
Confirmed. ibmpc_usb_atmega32u4_3mstimeout.hex working with XT mode as described in previous post.

Offline teliot

  • Posts: 2
  • Location: CA - USA
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #136 on: Mon, 06 July 2020, 18:33:01 »
This works with a DTK SPK 101.

Used the github source, compiled and flashed on to an Arduino Micro with Atmega 32u4 over ICSP.
One of the keys registers as Code 86, KEY_102ND and seems to do nothing. The key has no symbol and is located where the Windows key generally is.
All of the other keys and LED's work correctly.

https://imgur.com/a/eQvHA1I

Thank you for all of your hard work on this!
Had my keyboard working in under 5 minutes :)

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #137 on: Mon, 06 July 2020, 19:18:14 »
This works with a DTK SPK 101.

Used the github source, compiled and flashed on to an Arduino Micro with Atmega 32u4 over ICSP.
One of the keys registers as Code 86, KEY_102ND and seems to do nothing. The key has no symbol and is located where the Windows key generally is.
All of the other keys and LED's work correctly.

https://imgur.com/a/eQvHA1I

Thank you for all of your hard work on this!
Had my keyboard working in under 5 minutes :)

Thanks for feedback.
The key is recoginized as ISO key located between left shift and z by converter. You can remap it in keymap editor.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline teliot

  • Posts: 2
  • Location: CA - USA
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #138 on: Mon, 06 July 2020, 20:08:11 »
That key is located on the right side under the shift key. This unknown key is something else.

Unmodified It types a <
With shift >
With Ctrl <
With Alt (Last command like up arrow)

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #139 on: Mon, 06 July 2020, 21:27:45 »
That key is located on the right side under the shift key. This unknown key is something else.

Unmodified It types a <
With shift >
With Ctrl <
With Alt (Last command like up arrow)

Check 'Debug' in the first post to check scan codes of the both keys.
Posting its output as is would be useful.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline TheNeonKnight

  • Posts: 1
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #140 on: Wed, 26 August 2020, 16:57:58 »
Quick couple questions regarding the pull up resistor. I'm no expert when it comes to resistors, would the 1Kohm resistor be better than the 4.7Kohm resistor or vice versa, If so why? Does it have something to do with the length of the cable connected to the controller? Also the resistor is supposed to be connected  from VCC 5v to Clock and Data respectively, correct? Does the resistor have to be 1/4 watt, 1/2 watt? These questions may seem obvious but I'm honestly at a loss on this.

Offline ivanthetolerable

  • Posts: 15
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #141 on: Thu, 24 September 2020, 20:28:45 »
Hey, is it possible to change the firmware to change PD0 on the teensy to something else? I found a spare teensy I messed up and destroyed d0 a long time ago..

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #142 on: Mon, 28 September 2020, 07:24:58 »
Possible, but it won't be easy.
I don't think it is worth for us trying it. Just buy new one.


Hey, is it possible to change the firmware to change PD0 on the teensy to something else? I found a spare teensy I messed up and destroyed d0 a long time ago..

« Last Edit: Mon, 28 September 2020, 07:27:49 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Wumbologist

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #143 on: Fri, 23 October 2020, 19:54:00 »
Hey Hasu. Can confirm this works on my Z-150 black label. Using a ProMicro.
« Last Edit: Fri, 23 October 2020, 20:49:16 by Wumbologist »

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #144 on: Fri, 23 October 2020, 20:46:17 »
Great! Thank you for your report.

Hey Hasu. Can confirm this works on my Z-150 black label. Using a ProMicro.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Wumbologist

  • Posts: 13
Re: [REQUEST FOR TEST] TMK IBM PC Keyboard Converter
« Reply #145 on: Fri, 23 October 2020, 20:49:40 »
Also, I doubt this is a keyboard even on your radar for this project, but my FK-8000 is almost working with it. The only thing not working is the blank key where LGUI should go.

Chyros describes the issue here at timestamp 5 minutes.
I'm getting the same scancodes as him in Switch Hitter. 0xE2 Win, 0x56 BIOS.

Offline hasu

  • Thread Starter
  • Posts: 3131
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK IBM PC Keyboard Converter
« Reply #146 on: Fri, 23 October 2020, 21:23:30 »
Great.
I think there was no standard scan code for the key in keyboard from that era, and guess it was defined by microsoft after introducing windows 95.

I guess you are using US layout?
It seems the 0x56 is correct for scan code.  In that case the converter should recognize it as 'non-us #'(ISO) key, you will have to change to UK or other ISO keyboard layout on your OS to use the key. Or you can remap the key by editing ISO key on Keymap Editor.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Wumbologist

  • Posts: 13
Re: TMK IBM PC Keyboard Converter
« Reply #147 on: Fri, 23 October 2020, 22:11:06 »
Ah I see. Changed NUBS to LGUI in my keycap.c and now I've got a much more usable layout. Thanks!

Offline therealding

  • Posts: 4
  • Location: Dallas, TX
Re: TMK IBM PC Keyboard Converter
« Reply #148 on: Tue, 27 October 2020, 03:21:20 »
Do you guys think it's possible to run the converter on the Digispark (ATTiny85) or would I still have to use At32u4 like on BadUSB Beetle