Author Topic: Copam K-430 converter compatibility  (Read 22354 times)

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #100 on: Mon, 11 October 2021, 07:58:09 »
Can you try attached firmware and show me its debug log?

* ibmpc_usb_atmega32u4.hex (62.96 kB - downloaded 119 times.)

I updated firmware and the converter detects parity error and tries recovery by sending a command now.
Copam K-430 will communicate with the converter on AT protocol now, instead of XT.

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #101 on: Mon, 11 October 2021, 09:20:38 »
Interesting. Confirmed that Copam K-430 is AT/XT auto-switching finally.

Yes, I thought that was interesting as well. Glad something useful finally came out of it.
(sorry for the late reply, btw. I was kind of busy these past few days)

First, the keyboard sends 'AA' intentionally with parity error on AT protocol and expects behaviour like below:
- AT host including normal PS/2 converters reply with 'FE' and the keyboard continues communication on AT protocol, I guess.
- XT host can recognize it as 'AA' ignoring preceding two redundant 0 pulses.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-Keyboard-Converter#aa-with-prity-error

TMK converter doesn't detect the parity error and the keyboard switches to XT protocol immediately.

As for SysReq key it was introduced in IBM AT 84-key keyboard and didn't exists on IBM XT keyboard. The keyboard doesn't support the key in XT protocol unfortunately.

Maybe I'll fix my firmware for the parity error to support AT/XT auto-swithching keyboards later.

Then it makes sense that nothing is registered.

I noticed that you are working on the auto-switching functionality, will reply in separate post


As for the Keypad* key, it is true on IBM PC/XT computer. PrintScreen function is handled by host when Shift and Keypad*  are pressed. PrintSreen key doesn't exits in original IBM XT keyboard. Later, some of clone XT keyboards introduced PrintScreen key but Copam K-430 didn't. TMK converter doesn't handle the Shift and Keypad* combination because it is not good for key remap.

Microsoft documented about how PrintScreen key should behave on XT protocol(Scan Code Set 1), see Note 4 if you are interested.
https://web.archive.org/web/20201112031338/download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc

I looked at the doc, and tried various combos of Ctrl+Shift+* etc, but it does not register as PrintScrn. I notice it also referenced the 'break' key (which doesn't exist)

So are you saying that it should work with a certain keycombo – not necessarily Shift+* on the NumPad?
« Last Edit: Mon, 11 October 2021, 09:26:51 by Drag0nFly »

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #102 on: Mon, 11 October 2021, 09:26:24 »
Can you try attached firmware and show me its debug log?

(Attachment Link)

I updated firmware and the converter detects parity error and tries recovery by sending a command now.
Copam K-430 will communicate with the converter on AT protocol now, instead of XT.
Tried the updated firmware, but the keyboard behaves the same way unfortunately. I notice it does send a reset, which it didn't do before. I still comes up as an XT keyboard.

Tried to get the PrintScrn keycode to register, based on your previous comments (unsure if I understood the keycode reference from M$ correctly, but it seems there might be other keys involved).

Also – and this is more of a question: I cannot see how one would enter sub-legends on the K-430, as it does not have an AltGr key. However, those keys are on the keycaps (for @, £, $ for 2, 3, 4, respectively). Not sure if there is something I am missing, or whether another key will have to be re-mapped to AltGr.
(see the previous picture for the layout)

In any case, here is the debug log for the new firmware you just uploaded when testing on the Copam:

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

TMK:86482d/LUFA:d6a7df

USB configured.

Loop start.
I717
718 ERR:01 ISR:AA90 [RST] I719
723 PRT:22 ISR:AAC0 rAA A3720 wFF R R R R R R R R R R
4201 ERR:11 ISR:0000 X4703 rAA W4707 wF2 R R R R R R R R R R R5689
ID:FFFF(XT)
5690 ERR:11 ISR:AAC0 S5690 L5690 r1E r9E r1E r9E r1F r9F r0E r8E r0E r8E r0E r8E r46 rC6 r46 rC6 r46 rC6 r46 rC6 r45 rC5 r45 rC5 r46 rC6 r46 rC6 r46 rC6 r46 rC6 r46 rC6 r46 rC6 r2A r2A r2A r2A r2A r2A r2A r37 rB7 rAA r2A r37 rB7 r37 rB7 r37 rB7 r37 rB7 rAA

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #103 on: Tue, 12 October 2021, 09:17:03 »
Timing of sending command seems to be too late for the keyboard.
I fixed how to send 'reset' command.

* ibmpc_usb_atmega32u4.hex (62.65 kB - downloaded 116 times.)


As for PrintScreen original IBM XT keyboard doesn't have 'dedicated' PrintScreen key while some enhanced XT keyboards has. The MS document explains about the 'dedicated' PrintSreen key. Copam doesn't have the 'dedicated' key and so you have to use Shift+Keypad* combo on XT computer. Note that the converter doesn't recognize the combo by design.

The Copam K-430 through the converter works just as a modern USB keyboard. You will need AltGr, that is Right Alt for the char.(but I'm not sure, it depends on you keyboard layout on your OS.) You can remap a key for AltGr once firmware support the Copam keyboard.

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #104 on: Tue, 12 October 2021, 11:41:03 »
Timing of sending command seems to be too late for the keyboard.
I fixed how to send 'reset' command.

(Attachment Link)
Great, I'll try it and report back.

As for PrintScreen original IBM XT keyboard doesn't have 'dedicated' PrintScreen key while some enhanced XT keyboards has. The MS document explains about the 'dedicated' PrintSreen key. Copam doesn't have the 'dedicated' key and so you have to use Shift+Keypad* combo on XT computer. Note that the converter doesn't recognize the combo by design.
Ok–I was a little unsure whether the converter should recognize Shift+* as PrintScrn in XT-mode, since it is apparently the only way to send PrintScrn via the keyboard when running in this mode.

The Copam K-430 through the converter works just as a modern USB keyboard. You will need AltGr, that is Right Alt for the char.(but I'm not sure, it depends on you keyboard layout on your OS.) You can remap a key for AltGr once firmware support the Copam keyboard.
Yes, I guess I should clarify: I was wondering how this functionality was originally intended for this keyboard, being that many of the important keys are sub-legends normally activated via AltGr (which it, as we both noticed, does not have)

It affects the "@" key and "<" ">" keys (and brackets/parenthesis), etc., in addition to the currency symbols, so I am just thinking a bit out loud what the intention of the designers were. Maybe "Alt" acted as an AltGr, but it also does not make much sense. (It is of course hard to determine if not having used the keyboard) ;)

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #105 on: Tue, 12 October 2021, 12:24:36 »
Tested the updated firmware; not quite there yet as it still comes up as XT.

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

TMK:56eb79/LUFA:d6a7df

USB configured.

Loop start.
I611
612 ERR:01 ISR:AA90 [RST] E612 A613 wFF rAA
616 PRT:22 ISR:AAC0 X1117 rAA W1121 wF2 R R R R R R R R R R R2103
ID:FFFF(XT)
2103 ERR:11 ISR:AAC0 S2104 L2104


r20 rA0 r20 rA0 r1F r9F r12 r92 r12 r92 r12 r92 r13 r93 r0E r8E r01 r81 r0E r0E r0E r0E r0E r8E r1C r9C r1C r9C r1C r9C r46 rC6 r46 rC6 r46 rC6 r46 rC6 r45 rC5 r45 rC5 r2A r37 rB7 r37 rB7 r37 rB7 r37 rB7 r37 rB7 r37 rB7 rAA r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r38 r2A r02 r82 r03 r83 r03 r83 r04 r84 r04 r84 r04 r84 r03 r83 rB8 rAA r3A r03 r83 r03 r83 r04 r84 rBA r3A r3A r3A r3A r3A r3A r3A r3A r2A r03 r83 r03 r83 r02 r82 r02 r82 r03 r83 r03 r83 rAA r2A rAA r04 r84 r38 r04 r84 r03 r83 rB8 rBA r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E r0E r8E


Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #106 on: Wed, 13 October 2021, 10:26:00 »
Reset command doesn't seems to work as what I expected.
Updated to send Resend instead Reset command.

* ibmpc_usb_atmega32u4.hex (62.87 kB - downloaded 109 times.)

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #107 on: Thu, 14 October 2021, 16:04:09 »
Hi @hasu,

Sorry for the late reply. I tested your updated firmware just now, and can report ––







More
that the Copam now speaks AT to your adapter.  ;D

See debug output below. Also tested the SysRq key, which now behaves as PrintScrn (similar to the passive PS2-USB adapters). Also notice the Scroll Lock behavior is different – it does not come on (the LED), although the key is registered (also identical to the other AT adapters)

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

TMK:111e8c/LUFA:d6a7df

USB configured.

Loop start.
I776
777 ERR:02 ISR:AA90 P778 wFE rAA r00AA e00 iEA90 E781 I781 A3782 wFF rFA
3785 PRT:10 ISR:FE90 rAA W4168 wF2 rFA R5171
ID:0000(AT_AT84) S5171 wED rFA w00 rFA L5178 r84 rF0 r84 r0E rF0 r0E r0E rF0 r0E r4A r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E rF0 r4A r0E rF0 r0E r4A r0E rF0 r0E r0E rF0 r0E rF0 r4A r4A rF0 r4A r59 r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E rF0 r59 r59 r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E rF0 r59 r66 rF0 r66 r66 rF0 r66 r66 r66 r66 r66 r66 r66 r66 rF0 r66 r66 rF0 r66 r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E r77 wED rFA w02 rFA rF0 r77 r77 rF0 r77 wED rFA w00 rFA r77 wED rFA w02 rFA rF0 r77 r77 rF0 r77 wED rFA w00 rFA r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #108 on: Thu, 14 October 2021, 16:06:17 »
Hmm. Seems that 'more'-block really messed up the code formatting.

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

TMK:111e8c/LUFA:d6a7df

USB configured.

Loop start.
I776
777 ERR:02 ISR:AA90 P778 wFE rAA r00AA e00 iEA90 E781 I781 A3782 wFF rFA
3785 PRT:10 ISR:FE90 rAA W4168 wF2 rFA R5171
ID:0000(AT_AT84) S5171 wED rFA w00 rFA L5178 r84 rF0 r84 r0E rF0 r0E r0E rF0 r0E r4A r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E rF0 r4A r0E rF0 r0E r4A r0E rF0 r0E r0E rF0 r0E rF0 r4A r4A rF0 r4A r59 r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E rF0 r59 r59 r0E rF0 r0E r0E rF0 r0E r0E rF0 r0E rF0 r59 r66 rF0 r66 r66 rF0 r66 r66 r66 r66 r66 r66 r66 r66 rF0 r66 r66 rF0 r66 r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E r77 wED rFA w02 rFA rF0 r77 r77 rF0 r77 wED rFA w00 rFA r77 wED rFA w02 rFA rF0 r77 r77 rF0 r77 wED rFA w00 rFA r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E r7E rF0 r7E

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #109 on: Thu, 14 October 2021, 16:36:33 »
Hmm x2. With regards to remapping for AltGr (still haven't decided how to do this) – but I really wonder how these legends were typed originally? – it's the same problem for the U.S layout (not just us strange frozen Northerners with equally strange vowel keys;) –



I guess one option is to sacrifice the right Shift key (and make the arrow-nav into an inverse T-nav and the leftmost arrow into AltGr, but it's not the prettiest, as there is neither an actual AltGr keycap, and since the stabilizer mounts for the R-Shift would be visible if the Up_arrow was placed there...)

Question: Is it possible to perhaps use the comination of L_Shift + Alt to function as an AltGr? Or does it need to be a dedicated key? (not sure how/if the firmware would allow this)

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #110 on: Fri, 15 October 2021, 05:23:06 »
Great! I'll add support for the Copam K-430 keyboard on next release.

'Scroll Lock' LED is controled by OS. Windows is known to turn it on while Linux and MacOS don't in general as far as I know. I think you are testing on Mac. Try on Windows.


Hi @hasu,

Sorry for the late reply. I tested your updated firmware just now, and can report ––


that the Copam now speaks AT to your adapter.  ;D

See debug output below. Also tested the SysRq key, which now behaves as PrintScrn (similar to the passive PS2-USB adapters). Also notice the Scroll Lock behavior is different – it does not come on (the LED), although the key is registered (also identical to the other AT adapters)

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #111 on: Fri, 15 October 2021, 05:44:18 »
I guess one option is to sacrifice the right Shift key (and make the arrow-nav into an inverse T-nav and the leftmost arrow into AltGr, but it's not the prettiest, as there is neither an actual AltGr keycap, and since the stabilizer mounts for the R-Shift would be visible if the Up_arrow was placed there...)

Question: Is it possible to perhaps use the comination of L_Shift + Alt to function as an AltGr? Or does it need to be a dedicated key? (not sure how/if the firmware would allow this)

The converter firmware itsef doesn't recognize any key combo.  You can emulate it somewhat in keymap perhaps but it doesn't appear a good idea. I think you will need dedicated key.

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #112 on: Fri, 15 October 2021, 07:45:54 »
Just to clarify regarding the Scroll Lock, I mentioned it as it was different to running the keyboard in XT-mode with the TMK adapter on the same host. In XT-mode it lights up and can be toggled.

So I guess this is AT-specific, as all other adapters behave the same way (on Linux), when hooked up to an AT board.

I'll keep thinking about what to do with the sub-legends (@, £, $, etc.) It seems peculiar, as there has to have been a way to type these on the keyboard “back in the day”, as several layouts have this issue.

That being said, is there a guide on how to remap the keys – as in an editor for the .hex file which is programmed to the adapter? (hopefully something which works on Linux)

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #113 on: Fri, 15 October 2021, 09:19:40 »
Just to clarify regarding the Scroll Lock, I mentioned it as it was different to running the keyboard in XT-mode with the TMK adapter on the same host. In XT-mode it lights up and can be toggled.
Ah, OK. Yes, LED indcators are controlled by the keyboard In XT mode while by computer/OS in AT mode.
It seems that modern computers don't define apparent usage for Scroll Lock key and its indicator.


Quote
I'll keep thinking about what to do with the sub-legends (@, £, $, etc.) It seems peculiar, as there has to have been a way to type these on the keyboard “back in the day”, as several layouts have this issue.
I think you can find something in vast documents hosted in bitsavers.org. Let us know if you find.
http://www.bitsavers.org/pdf/ibm/pc/xt
http://www.bitsavers.org/pdf/ibm/pc/at

Quote
That being said, is there a guide on how to remap the keys – as in an editor for the .hex file which is programmed to the adapter? (hopefully something which works on Linux)

You can refer wiki pages.
https://github.com/tmk/tmk_keyboard/wiki


Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #114 on: Fri, 15 October 2021, 11:59:59 »
Thanks for those pointers – I'll check them out and see if I can find something.  :thumb:

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #115 on: Wed, 27 October 2021, 22:47:53 »
I updated firmware. You can download new firmware on Keymap Editor now.

https://geekhack.org/index.php?topic=103648.msg3090743#msg3090743

Let me know if you have any problem with new firmware.

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #116 on: Sun, 07 November 2021, 10:42:09 »
Looked at the technical reference docs – AFAIKS there were no mentions of an AltGr key, except in the XT286 doc (brief mention on page 196); not surprisingly as it is not common on XT. Looked at the most recent AT doc from 1986 also, and it was the same there.

However, I notice that the issue is usually solved by using Ctrl+Alt (on Win) and even simply by using the 'regular' Alt (L-Alt) as an AltGr / R_Alt (which is actually default on OSX, learned something new) Funny as I was specifically avoiding testing on OSX due to its terse hid_listen output...). It would appear that the latter solution would be better, since one cannot remap a key-combo with the TMK firmware to act as AltGr...

I did this on Linux with a customized Xmodmap in X in order to have Alt toggle level3 modifiers ("keycode  64 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift", it worked in X (Mate terminal) but some apps (esp. Emacs and Vi) still interpret the keycode incorrectly.
Looked at the wiki page for how to remap keys, but apparently got lost in the vastness of the documentation. ;)

One last thought: is the TMK firmware able to know how many keys is on the keyboard if it is uniquely identified during initialization? If so, one could perhaps assign Alt as AltGr as default (unless there are good reasons to retain the L_Alt key functionality of course)

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Copam K-430 converter compatibility
« Reply #117 on: Sun, 07 November 2021, 19:54:50 »
What's exact your problem or requirement?
Simply mapping Left Alt key to Right Alt(AltGr) on Keymap Editor doesn't work for you?

The converter can get Keyboard ID from many of PC keyboards. But Copam doesn't have Keyboard ID as IBM PC/AT 84-key keyboard.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#keyboard-id

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #118 on: Tue, 09 November 2021, 13:37:56 »
Hi @hasu,


No worries, I used your on-line remapping tool for the IBMPC firmware and Alt now outputs AltGr. Very convenient tool (which I initially did not see when I landed on the FAQ page..)

I was a little concerned that the generated unimap hexfile was quite a bit larger than the “ibmpc_usb_atmega32u4” I was using (63K) vs. 68K for the modified one, but I guess it might be due to unimap or some other extra data.

Now my Copam actually works and is useful. :) Even the line-nav somehow makes more sense (although not ideal for gaming)

There are a few keys which still output incorrect codes, but this is due to the weird layout. Particularly the leftmost key next to F2, which is "<" ">" (i.e, the reverse of the problem reported earlier as this key is normally found to the right of the left shift in ISO-layouts.)

The keyboard editor reports the hexcode as 34, and the other key to the right of the left shift (which doesn't exist on the Copam) as 64. So I guess it is just a matter of switching those around as well.

Thanks again for your excellent work on the firmware and the remap functionality.

Offline Drag0nFly

  • Thread Starter
  • Posts: 83
Re: Copam K-430 converter compatibility
« Reply #119 on: Sun, 12 December 2021, 10:37:53 »
Hi @hasu,

Don't mean to pollute this thread, but I have another board which I wanted to start a “supported”-thread for. The problem is, I am unsure what brand and model it is!
What I can say is that it only works with your adapter (in AT84 mode) – and I was thinking that support for this, or a keyboard quite similar, might have been to your firmware. I also know it has Alps SKCL Cream switches.

I created another thread for it here in the “Media” section – https://geekhack.org/index.php?topic=115479.0

I've asked on Deskthority as well – as I assumed there would be members there who'd recognize it – but none appear to know which board it is. Just posting here in case it rings any bells, so to speak, as it would be nice to know what keyboard I actually bought. :)