Author Topic: IBM 4704 Keyboard Converter  (Read 91253 times)

0 Members and 1 Guest are viewing this topic.

Offline jeff_c

  • Posts: 2
Re: IBM 4704 Keyboard Converter
« Reply #100 on: Tue, 17 July 2018, 01:56:22 »
ah you are right. other post has pic of to side of PCB which displays diodes.

Alps models can support Nkro.

I read about how the alps 4704 boards can support NKRO, but I only get 2-key rollover with my keyboard connected to the Hasu controller. Is that a result of buffer limitation on my particular 4704? The model number for my board is 5954339

In other words, should I expect the magic key function to enable NKRO to work on this converter like it does on the HHKB alternate controller?
« Last Edit: Thu, 19 July 2018, 20:51:45 by jeff_c »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #101 on: Fri, 20 July 2018, 17:30:51 »
ah you are right. other post has pic of to side of PCB which displays diodes.

Alps models can support Nkro.

I read about how the alps 4704 boards can support NKRO, but I only get 2-key rollover with my keyboard connected to the Hasu controller. Is that a result of buffer limitation on my particular 4704? The model number for my board is 5954339

In other words, should I expect the magic key function to enable NKRO to work on this converter like it does on the HHKB alternate controller?

I saw diodes in pics on this post so I thought the Alps model should be NKRO if its keyboard firmware supoorts it. I don't see reason it doesn't support, but NKRO depends totally on the 4704 Alps firmware implementation.
https://deskthority.net/workshop-f7/p77-the-tkl-pingmaster-t16419.html#p368597

This converter supports 6KRO on USB by default you can send up to 6 keys plus modifiers if you keyboard supports NKRO. No converter limitation there.
(If you need NKRO on USB you can configure and build firmware yourself, but it is not your problem in this case.)

If you get only 2 keys with this converter your keyboard is 2KRO.

Offline laxfan91

  • Posts: 5
  • Location: MI, USA
Re: IBM 4704 Keyboard Converter
« Reply #102 on: Sun, 26 August 2018, 01:09:38 »
For the alps board, what is the fn key mapped to in the default firmware in your converter? I`m curious.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #103 on: Sun, 26 August 2018, 01:21:52 »
Right bottom key of main alpha part. See keymap editor, L1 means the key turns layer 1 on.



Sent from my WAS-LX2J using Tapatalk


Offline kankurou1010

  • Posts: 4
Re: IBM 4704 Keyboard Converter
« Reply #104 on: Tue, 11 September 2018, 18:03:47 »
Hey so I bought your converter and I'm using it on the 6112883 Japanese 102-key. However, I'm a total noob and I don't know what to do  :confused:
How do I get the keyboard to be able to type? I plug it in and it beeps but I can't type on it. Thanks.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #105 on: Tue, 11 September 2018, 19:51:09 »
Hey so I bought your converter and I'm using it on the 6112883 Japanese 102-key. However, I'm a total noob and I don't know what to do  :confused:
How do I get the keyboard to be able to type? I plug it in and it beeps but I can't type on it. Thanks.


I think the converter should work with it out of the box. It is programmed with default firmware when shipped.
DId you try other port or computer? What are your OS?

Use hid_listen to see debug info and could you post it here?
https://github.com/tmk/tmk_keyboard/wiki#debug

Offline kankurou1010

  • Posts: 4
Re: IBM 4704 Keyboard Converter
« Reply #106 on: Wed, 12 September 2018, 01:26:49 »

I think the converter should work with it out of the box. It is programmed with default firmware when shipped.
DId you try other port or computer? What are your OS?

Use hid_listen to see debug info and could you post it here?
https://github.com/tmk/tmk_keyboard/wiki#debug

So turns out it was because I was using a crappy micro usb cable. Plugged in a different one and now it works. However, some keys aren't typing letters, such as: d s q w z x c. hid_listen is picking them up though. How do I get those to work? I don't understand how to use the tmk editor... I tried both "alps 102 key" editors, but I don't get what I'm supposed to be doing. OS is windows 10 btw.
« Last Edit: Wed, 12 September 2018, 01:29:31 by kankurou1010 »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #107 on: Wed, 12 September 2018, 01:52:18 »

I think the converter should work with it out of the box. It is programmed with default firmware when shipped.
DId you try other port or computer? What are your OS?

Use hid_listen to see debug info and could you post it here?
https://github.com/tmk/tmk_keyboard/wiki#debug

So turns out it was because I was using a crappy micro usb cable. Plugged in a different one and now it works. However, some keys aren't typing letters, such as: d s q w z x c. hid_listen is picking them up though. How do I get those to work? I don't understand how to use the tmk editor... I tried both "alps 102 key" editors, but I don't get what I'm supposed to be doing. OS is windows 10 btw.

OK. yeah, reliable usb cable is a must have.
Try to download firmware from this page without any change and flash it. I guess you flashed wrong firmware.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ibm4704_usb_alps

Offline kankurou1010

  • Posts: 4
Re: IBM 4704 Keyboard Converter
« Reply #108 on: Wed, 12 September 2018, 02:58:12 »
Am I doing this right? Open page, download "Firmware Hex File Download," select file under "Base Firmware File:" select the downloaded hex, then press "Load Keymap from firmware"?


Didn't fix it. Now, some of the keys that were working aren't.  :confused:

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #109 on: Wed, 12 September 2018, 08:57:11 »
Am I doing this right? Open page, download "Firmware Hex File Download," select file under "Base Firmware File:" select the downloaded hex, then press "Load Keymap from firmware"?


Didn't fix it. Now, some of the keys that were working aren't.  :confused:


Open the link and just click 'Download' button without touching anything to download default firmware.

Offline kankurou1010

  • Posts: 4
Re: IBM 4704 Keyboard Converter
« Reply #110 on: Wed, 12 September 2018, 14:33:17 »
Am I doing this right? Open page, download "Firmware Hex File Download," select file under "Base Firmware File:" select the downloaded hex, then press "Load Keymap from firmware"?


Didn't fix it. Now, some of the keys that were working aren't.  :confused:


Open the link and just click 'Download' button without touching anything to download default firmware.

Got it. All is working. Thanks for the help!  :thumb:

Offline fr08

  • Posts: 19
Re: IBM 4704 Keyboard Converter
« Reply #111 on: Mon, 08 October 2018, 13:36:42 »
I'm having a weird issue, been using a Pingmaster (6112883) with this controller for like a week without any problems. In fact it was much easier than I thought.

But earlier today my up, down, left and right keys started outputting 8, 2, 4 and 6 instead. I've tried reflashing multiple times, even with old .hex files and with the "preset" that's on http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ibm4704_usb_alps

But nothing changes. Even if I put "no" on those keys, they still gives me 8, 2, 4 and 6.

What could be wrong? Have I messed up somehow? :(

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #112 on: Mon, 08 October 2018, 17:22:14 »
If you are using TMK preassebled covnerter URL you linked is correct and it should work.
Open browser with the URL and try reloading the page again before download firmware without editing.

I guess you flashed wrong firmware which is for IBM Capacitive models.

Offline N6NG

  • Posts: 13
  • Location: FL
Re: IBM 4704 Keyboard Converter
« Reply #113 on: Tue, 30 October 2018, 16:29:36 »
Hi
I had been using this converter on the IBM 6113442 for many months with a slightly edited version of the default Alps 102 key firmware until recently, when the keyboard suddenly stopped working. No key presses register and the beeper doesn't work.
Here is the readout from hidlisten:
Code: [Select]
Waiting for device:
Listening:
Keyboard ID: FF
Enable break: S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48 S:48
etc.
It simply repeats S:48 until I unplug it.
I tried reflashing my firmware and then tried flashing the original firmware, all to no avail.
I am completely lost  :confused:
Any help is appreciated, thanks!
« Last Edit: Tue, 30 October 2018, 16:38:06 by N6NG »
IBM Model M
1390670
29JAN87
   IBM Pingmaster
6113442
   NeXT Non-ADB AAE
Focus FK-2000 Plus
SGI Granite (Rubberdome)

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #114 on: Tue, 30 October 2018, 17:10:09 »
Seeing the log(Keyboard ID: FF) the converter restarts? and doesn't recognize keyboard at all.
I guess connecton/power was lost  temporalily for some reason? Check USB cable or keyboard cable.

Do you have hid_listen log lines before the ones you post?
I'm curious what hid_listen speaks just when the problem occurs.

I'm thinking this is related to your hardware(converter, keyboard  or cables) at this time because I haven't heard here this problem from any other users so far.
Does anyone here have similar problem to this?

Offline N6NG

  • Posts: 13
  • Location: FL
Re: IBM 4704 Keyboard Converter
« Reply #115 on: Tue, 30 October 2018, 17:56:46 »
I thought it might be the cable, so I tried multiple USB cables and tried unplugging and plugging everything in again earlier, all with the same results.
Unfortunately, I don't have any log lines from before this. I don't have any from when it was working and this is the first thing that happens when I plug it in.
Is there any way if I could test whether it's the keyboard itself?
IBM Model M
1390670
29JAN87
   IBM Pingmaster
6113442
   NeXT Non-ADB AAE
Focus FK-2000 Plus
SGI Granite (Rubberdome)

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #116 on: Tue, 30 October 2018, 19:28:25 »
I thought it might be the cable, so I tried multiple USB cables and tried unplugging and plugging everything in again earlier, all with the same results.
Unfortunately, I don't have any log lines from before this. I don't have any from when it was working and this is the first thing that happens when I plug it in.
Is there any way if I could test whether it's the keyboard itself?



Wait, it seems I misread this probably due to my weak language skills.
I thought wrongly: you can type on keyboard usually but it suddenly stops sometime and you have had this problem for months.

Quote
I had been using this converter on the IBM 6113442 for many months with a slightly edited version of the default Alps 102 key firmware until recently, when the keyboard suddenly stopped working. No key presses register and the beeper doesn't work.


After I read several times I think I got it. Your converter and keyboard stoped recently and they don't work at all at this time, right? If so, yes, keyboard cable/connector is primary suspect in addition to connector on converter. And USB cable is not the cause here because the converter can communicate with hid_listen program.

If you have DMM you can do continuity test with the keyboard cable.

Offline N6NG

  • Posts: 13
  • Location: FL
Re: IBM 4704 Keyboard Converter
« Reply #117 on: Tue, 30 October 2018, 21:31:18 »
Yes, that is correct, there is has been no response whatsoever from the keyboard since that point.
That's a good idea, I actually don't own a multimeter, but I will see if I can buy or borrow one.
Thanks!
IBM Model M
1390670
29JAN87
   IBM Pingmaster
6113442
   NeXT Non-ADB AAE
Focus FK-2000 Plus
SGI Granite (Rubberdome)

Offline fcoury

  • Posts: 150
  • Location: Brazil
Re: IBM 4704 Keyboard Converter
« Reply #118 on: Tue, 20 November 2018, 18:56:33 »
Is the converter TMK hex supposed to work on a Pro Micro? I have flashed the hex and have it wired like this:





But it doesn't seem to be working. Did I get this all wrong?

Thanks!

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #119 on: Tue, 20 November 2018, 20:03:27 »
I think HEX file should be used on Pro Micro. I don't know its pinout. Check Pro Micro schematics, github README and the first post for wiring again and take time for trials and errors. You won't break your keyboard even if you connect wires wrongly unless you are extremly unlucky.

https://github.com/tmk/tmk_keyboard/tree/master/converter/ibm4704_usb

EDIT: I hope someone can help.
« Last Edit: Tue, 20 November 2018, 20:08:14 by hasu »

Offline fcoury

  • Posts: 150
  • Location: Brazil
Re: IBM 4704 Keyboard Converter
« Reply #120 on: Wed, 05 December 2018, 21:17:52 »
Thank you so much hasu! I not only made it work, but ended up creating a video tutorial if anyone else wants to do it:


Hopefully this will help others :)

Offline ErgoMacros

  • Posts: 313
  • Location: SF Bay Area
Re: IBM 4704 Keyboard Converter
« Reply #121 on: Thu, 06 December 2018, 14:21:15 »
Nice video! Makes the whole thing seem so accessible. (Easy to do.)

I haven't done this myself (yet), but have 2, purely aesthetic, suggestions.
  a. You may be able to make the wires shorter, and
  b. you could run them all through one piece of heat-shrink tubing.

Hope you're enjoying your new keyboard! and thank you.
Today's quote: '...“but then the customer successfully broke that.”

Offline rezene

  • Posts: 1
Re: IBM 4704 Keyboard Converter
« Reply #122 on: Tue, 30 April 2019, 17:56:41 »
I have made a converter for the pingmaster and watched fcoury's video about it + talked to him on discord. He has looked everything over and can not see any thing wrong with it. The controller gets flashed and the computer recognizes it as a 4704 converter, but when I try typing on it nothing happens. this has some images I can add more if needed https://imgur.com/a/1C8IEl8
« Last Edit: Tue, 30 April 2019, 17:58:15 by rezene »

Offline karlmartin95

  • Posts: 2
Re: IBM 4704 Keyboard Converter
« Reply #123 on: Wed, 10 July 2019, 22:11:01 »
I need help with my F77, the keyboard works good with an Arduino Pro Micro but I can't hear the beeps. I only hear one beep when I connect the keyboard to the computer but nothing more.

Please, I want to make the beeper work. I moved the knob to both sides but nothing...

What can I do? We should find the way to send the command from the Arduino to the logic board in order to get a beep in every key press.

This is my baby, recently restored:
« Last Edit: Wed, 10 July 2019, 22:18:55 by karlmartin95 »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #124 on: Wed, 10 July 2019, 23:15:49 »
As first post says, current firmware doesn't support the beeper/buzzer on 'capacitive switch models'. I'm just not interested in enabling beeper on my keyboard usually and I haven't look into the feature back in the day.

I think you can emit a shot beep with sending command 0xFC to keyboard.

ibm4704_send() can be used to send the command. You can check its code here but you won't change this.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/ibm4704.c#L49

You may want to add it here to emit a beep on every key press.
https://github.com/tmk/tmk_keyboard/blob/master/converter/ibm4704_usb/matrix.c#L103

Refer this for 4704 keyboard protocol and commands.
https://github.com/tmk/tmk_keyboard/blob/master/converter/ibm4704_usb/ibm4704.txt

Try it anyway and keep us updated!



By the way, the beep/buzzer on 'Alps switch(SKCC) models' are used by keyboard itself each key press automatically, not controlled by the converter. You can use its volume knob to remove tones from the beeper.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #125 on: Fri, 12 July 2019, 02:01:52 »
I tried ibm4704_send(0xFD) on my Model 200 62-key and found it didn't work.
After tesing and debuging I could fix it and got annoying key clicks :p

More
Try this patch.

Code: [Select]
diff --git a/converter/ibm4704_usb/matrix.c b/converter/ibm4704_usb/matrix.c
index acba17dc..648c1ff4 100644
--- a/converter/ibm4704_usb/matrix.c
+++ b/converter/ibm4704_usb/matrix.c
@@ -102,6 +102,7 @@ uint8_t matrix_scan(void)
     } else if (code&0x80) {
         dprintf("%02X\n", code);
         matrix_make(code);
+        ibm4704_send(0xFD);
     } else {
         dprintf("%02X\n", code);
         matrix_break(code);
diff --git a/tmk_core/protocol/ibm4704.c b/tmk_core/protocol/ibm4704.c
index 6a03cd44..75e7db12 100644
--- a/tmk_core/protocol/ibm4704.c
+++ b/tmk_core/protocol/ibm4704.c
@@ -39,7 +39,7 @@ Data    ____|__/    X____X____X____X____X____X____X____X____X____X   \___
             |  Start   0    1    2    3    4    5    6    7    P   Stop
             Request by host
 
-Start bit:  can be long as 300-350us.
+Start bit:  can be long as 300-350us during start up and upto 2500us while key scanning
 Request:    Host pulls Clock line down to request to send a command.
 Timing:     After Request keyboard pull up Data and down Clock line to low for start bit.
             After request host release Clock line once Data line becomes hi.
@@ -58,7 +58,7 @@ uint8_t ibm4704_send(uint8_t data)
     clock_lo();
 
     /* wait for Start bit(Clock:lo/Data:hi) */
-    WAIT(data_hi, 300, 0x30);
+    WAIT(data_hi, 5000, 0x30);
 
     /* Data bit */
     for (uint8_t i = 0; i < 8; i++) {
@@ -89,7 +89,7 @@ uint8_t ibm4704_send(uint8_t data)
     return 0;
 ERROR:
     idle();
-    if (ibm4704_error > 0x30) {
+    if (ibm4704_error >= 0x30) {
         xprintf("S:%02X ", ibm4704_error);
     }
     IBM4704_INT_ON();


EDIT: Updated main repo. Just use new patch below to enable key click on IBM capacitive switch keyboards.
Code: [Select]
diff --git a/converter/ibm4704_usb/matrix.c b/converter/ibm4704_usb/matrix.c
index acba17dc..648c1ff4 100644
--- a/converter/ibm4704_usb/matrix.c
+++ b/converter/ibm4704_usb/matrix.c
@@ -102,6 +102,7 @@ uint8_t matrix_scan(void)
     } else if (code&0x80) {
         dprintf("%02X\n", code);
         matrix_make(code);
+        ibm4704_send(0xFD);
     } else {
         dprintf("%02X\n", code);
         matrix_break(code);
« Last Edit: Fri, 12 July 2019, 22:22:43 by hasu »

Offline karlmartin95

  • Posts: 2
Re: IBM 4704 Keyboard Converter
« Reply #126 on: Sat, 13 July 2019, 00:57:18 »
Thank you very much Hasu! I'll try it and keep you in touch.


Offline GrammarNazi

  • Posts: 2
  • Location: Boston Area, Massachusetts
Re: IBM 4704 Keyboard Converter
« Reply #127 on: Wed, 08 July 2020, 20:25:20 »
Hey, I picked up a chinese pingmaster with your 4704 converter yesterday but it's not quite working right. About half the time you stop using it for a while and plug it back in the converter stops functioning until you reflash the firmware. I'm using your default firmware for the correct version of the device, so I don't see how that could be a problem. In QMK Toolbox it shows inputs, but nothing else happens.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #128 on: Wed, 08 July 2020, 20:45:59 »
Hey, I picked up a chinese pingmaster with your 4704 converter yesterday but it's not quite working right. About half the time you stop using it for a while and plug it back in the converter stops functioning until you reflash the firmware. I'm using your default firmware for the correct version of the device, so I don't see how that could be a problem. In QMK Toolbox it shows inputs, but nothing else happens.


With "your 4704 converter" you mean you bought this Preassembled TMK Converter for IBM4704 from me?
https://geekhack.org/index.php?topic=72052.0

If not post pic of your converter.

You can't hot plug keyobard into converter, you have to plug-in keyboard before connecting the converter to usb port.

Offline GrammarNazi

  • Posts: 2
  • Location: Boston Area, Massachusetts
Re: IBM 4704 Keyboard Converter
« Reply #129 on: Wed, 08 July 2020, 20:52:48 »
Hey, I picked up a chinese pingmaster with your 4704 converter yesterday but it's not quite working right. About half the time you stop using it for a while and plug it back in the converter stops functioning until you reflash the firmware. I'm using your default firmware for the correct version of the device, so I don't see how that could be a problem. In QMK Toolbox it shows inputs, but nothing else happens.


With "your 4704 converter" you mean you bought this Preassembled TMK Converter for IBM4704 from me?
https://geekhack.org/index.php?topic=72052.0

If not post pic of your converter.

You can't hot plug keyobard into converter, you have to plug-in keyboard before connecting the converter to usb port.

Yes, your pre-assembled converter. I'm keeping the keyboard plugged into the converter, but when I plug the converter+keyboard into my computer it will sometimes either stop working for some keys, or all keys except left alt until I reflash.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM 4704 Keyboard Converter
« Reply #130 on: Wed, 08 July 2020, 21:07:12 »
OK.

First, flash default firmware.

Dowload firmware from here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ibm4704_usb_alps

And flash it. I'd recommend dfu-programmer but I don't think QMK Toolbox is related to this but I don't know. how it work.
https://github.com/tmk/tmk_keyboard/wiki#dfu-programmer-for-windows-mac-and-linux

The symptom seems to imply bad power supply or unstable connection,
mate connectors firmly again,
and try other USB cables, or other USB ports.



Also you can use hid_listen to see debug outputs. Post its outputs as is when the problem occurs.

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


Reflash should not be needed, replugging converter should be enough. I don't know what happens there.