Author Topic: TMK NEC PC98 Keyboard Converter  (Read 15310 times)

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
TMK NEC PC98 Keyboard Converter
« on: Tue, 08 December 2020, 19:11:13 »
TMK Keyboard protocol converter for NEC PC-9801 series that allows you to use PC-9801 keyboard on modern USB PC.

Prebuilt TMK PC98 converter is available here. Support this project!

See this wiki page for PC-9801 keyboard technical infos.



Update
2023-06 Fix for FBh response
2023-06 Add Windows/Menu key support for PC-9821 keyboard
2023-06 Fix key mapping



Supported keyboard
This converer supports PC-9801 compatible keyboards with Mini-DIN 8P connector basically.


- PC-9801V Keyboard
- PC-9801-106 - normal PC98 keyboard
- PC-9801-114 KBDP03 PC-PTOS - PC-PTOS specific keys are not supported by TMK PC98-USB converter at this point.
- PC-9801-115 文豪DPキーボード - not confirmed.
- PC-9801-116 - looks like PC/AT 106 keyboard without Windows key
- PC-9801-119 - PC98 keyboard with Windows and Menu key for PC-9821 - labeled as CMP-6D1Y7, CMP-6D0Y7
- PC-9801-98-S02 楽々キーボード - raku raku keyboard
- NEC FC-9801-KB6
- Digital Wave Dboard sono1
- ASCII ASKeyboard sono1
See this for more detail.



Firmware
Source code repository:
https://github.com/tmk/tmk_keyboard/tree/master/converter/pc98_usb

Prebuilt firmware HEX files:
https://github.com/tmk/tmk_keyboard/tree/master/converter/pc98_usb/binary

TMK Keymap Editor:

https://www.tmk-kbd.com/tmk_keyboard/editor/
For TMK prebuilt converter(ATmega32u2):  https://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?pc98_usb
For Others(ATmega32u4): https://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?pc98_usb_32u4



Debug
https://github.com/tmk/tmk_keyboard/wiki#debug

Use 'hid_listen' tool to see debug outputs.



How to make converter
Pinouts:
Code: [Select]
On host/converter:
    8Pin mini DIN
       ___ ___
      /  |_|  \
     / 8  7  6 \
    | 5    4  3 |
     \_ 2   1 _/
       \_____/
     (receptacle)

Wiring:
Code: [Select]
    Pin mini DIN        MCU
    ----------------------------------
    1  ~RST(TXD)        PD3
    2   GND             GND
    3  ~RDY             PD4
    4   RXD             PD2
    5  ~RTY             PD1
    6   NC
    7   NC
    8   5V              VCC


« Last Edit: Sun, 30 July 2023, 00:55:25 by hasu »

Offline EpikalPuppy

  • Posts: 13
Re: TMK NEC PC-98 Converter
« Reply #1 on: Tue, 08 December 2020, 19:51:06 »
Hey! I guess I'm quite new to this, but I'm looking for how I can do this with my Teensy 2.0. What I know is that I believe I need a HEX file, but I'm not sure how to do that or how to make it. I'm not super knowledgeable about this and unsure of how I can learn more. Thank you for any help you can provide.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC-98 Converter
« Reply #2 on: Tue, 08 December 2020, 20:22:22 »
I've never seen that keyboard, it is very interesting. Its plug is same 8P Mini-DIN as PC-9801 one. But its layout has no key specific to pc98 and it looks like more IBM PC.
I'm not sure this keyboard is for PC-9801 but it is still worth to try.
https://geekhack.org/index.php?topic=110093.0

Unfortunately I don't have time to guide you step by step for this converter :( I hope someone can help you.

As for HEX file, you basically need to build firmware from source code with 'make -f Makefile.32u4'. for Teensy.
But I can build its firmware for you if it is not easy. Let me know once your converter hardware is ready.

Check wiki for how to build firmware.
https://github.com/tmk/tmk_keyboard/wiki

Offline EpikalPuppy

  • Posts: 13
Re: TMK NEC PC-98 Converter
« Reply #3 on: Tue, 08 December 2020, 20:44:04 »
I've never seen that keyboard, it is very interesting. Its plug is same 8P Mini-DIN as PC-9801 one. But its layout has no key specific to pc98 and it looks like more IBM PC.
I'm not sure this keyboard is for PC-9801 but it is still worth to try.
https://geekhack.org/index.php?topic=110093.0

Unfortunately I don't have time to guide you step by step for this converter :( I hope someone can help you.

As for HEX file, you basically need to build firmware from source code with 'make -f Makefile.32u4'. for Teensy.
But I can build its firmware for you if it is not easy. Let me know once your converter hardware is ready.

Check wiki for how to build firmware.
https://github.com/tmk/tmk_keyboard/wiki
Ok, thanks! I'll take a look. I'm new to this so I have a lot to learn, I just find this keyboard so intriguing that I must use it, it looks kind of like the early IBM AT keyboards!

Offline Rayndalf

  • Posts: 472
Re: TMK NEC PC-98 Converter
« Reply #4 on: Tue, 08 December 2020, 20:50:59 »
Is this compatible with the PC9801-98 as well?
I have one and I'd love to get it up and running.

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK NEC PC-98 Converter
« Reply #5 on: Tue, 08 December 2020, 20:58:58 »
Is this compatible with the PC9801-98 as well?
I have one and I'd love to get it up and running.

@Rayndalf interesting ergo board. what does the connector look like? model info off the back of the board?

@EpikalPuppy - check the info on github https://github.com/tmk/tmk_keyboard/tree/master/converter/pc98_usb
first two bits of info is the connector and the reference table to which pins they should go to on the microcontroller

@hasu - are there any pull-up resistors needed for the NEC-PC-98 converter (like some of your other converters)?
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK NEC PC-98 Converter
« Reply #6 on: Tue, 08 December 2020, 21:00:59 »
BTW, nice job hasu, how long have you been working on this one?
 - keep being awesome!
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC-98 Converter
« Reply #7 on: Tue, 08 December 2020, 21:52:12 »
Rayndalf,
It should work. I have the board too.
https://deskthority.net/viewtopic.php?f=62&t=5212


nevin, Thanks for your help as always.
Quote
@hasu - are there any pull-up resistors needed for the NEC-PC-98 converter (like some of your other converters)?

Good qustion. I don't use them on this converter and it should work without them.
I think having pull-up resistors will be good probably or not harmful at least. To be honetst I don't know and didn't consider this closely on microcontroller UART.
So I'd recommend to make this converter without pull-up resistors until something bad happens.

Quote
BTW, nice job hasu, how long have you been working on this one?

I made this converter for my PC9801-98 in 2013 and added support for a few pc98 keyboards I obtaioned so far.
I'm happy to improve firmware code when getting feedback from people.

Offline EpikalPuppy

  • Posts: 13
Re: TMK NEC PC-98 Converter
« Reply #8 on: Tue, 08 December 2020, 22:08:17 »
I've never seen that keyboard, it is very interesting. Its plug is same 8P Mini-DIN as PC-9801 one. But its layout has no key specific to pc98 and it looks like more IBM PC.
I'm not sure this keyboard is for PC-9801 but it is still worth to try.
https://geekhack.org/index.php?topic=110093.0

Unfortunately I don't have time to guide you step by step for this converter :( I hope someone can help you.

As for HEX file, you basically need to build firmware from source code with 'make -f Makefile.32u4'. for Teensy.
But I can build its firmware for you if it is not easy. Let me know once your converter hardware is ready.

Check wiki for how to build firmware.
https://github.com/tmk/tmk_keyboard/wiki

Hey! I have my teensy 2.0 here with jumper wires on the needed pins. I think I figured out how the pinout corresponds with the 8 pin mini din, and I just need the HEX file now to test it!

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK NEC PC-98 Converter
« Reply #9 on: Tue, 08 December 2020, 22:17:47 »
nice. thanks again as always hasu.

@EpikalPuppy - give me a min & i'll attach the default hex and we can make adjustments to the layout once you see what it's doing.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC-98 Converter
« Reply #10 on: Tue, 08 December 2020, 22:23:30 »
EpikalPuppy,
OK. I just added firmware HEX files here.  Use 'pc98_usb_atmega32u4.hex' for Teensy2.0.

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




To debug it check this wiki entry and use 'hid_listen' tool to see debug outputs.
https://github.com/tmk/tmk_keyboard/wiki#debug

Debug output log from 'hid_listen' would be helpful to see scan code from the keyobard.

« Last Edit: Tue, 08 December 2020, 22:26:44 by hasu »

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK NEC PC-98 Converter
« Reply #11 on: Tue, 08 December 2020, 22:24:40 »
thanks hasu, you beat me to it.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline EpikalPuppy

  • Posts: 13
Re: TMK NEC PC-98 Converter
« Reply #12 on: Tue, 08 December 2020, 22:42:46 »
Ok! I have learned some things. Pin 8 on this keyboard appears to be ground, and I don't need to be an electrician to find out why, upon plugging the keyboard in, the wire to pin 8 got quite hot. So I guess this is different from pc98 boards? I hope I didn't damage anything

Offline EpikalPuppy

  • Posts: 13
Re: TMK NEC PC-98 Converter
« Reply #13 on: Tue, 08 December 2020, 23:03:47 »
If anyone would like pics of the board, I'd be happy to provide them. I can't find anything about this, but I made absolutely sure, pin 8 is indeed ground, whereas it appears to be 5V in on a PC98

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC-98 Converter
« Reply #14 on: Tue, 08 December 2020, 23:05:49 »
Ok! I have learned some things. Pin 8 on this keyboard appears to be ground, and I don't need to be an electrician to find out why, upon plugging the keyboard in, the wire to pin 8 got quite hot. So I guess this is different from pc98 boards? I hope I didn't damage anything

Hope you could plug off it immedately.

You can post pic of your wiring to get double check. 
People including me sometime interpret pinouts reversed with confused with receptacle and plug side.

In case that it is not PC98 compatible you will have to open its case and trace power/signal lines on pcb using multimeter.
Share pics of the pcb when you decide to open its case. I'm interested its inside.

EDIT: Post pics of the keyboard in your own thread. I'll visit there.

Offline EpikalPuppy

  • Posts: 13
Re: TMK NEC PC-98 Converter
« Reply #15 on: Tue, 08 December 2020, 23:12:28 »
Ok! I have learned some things. Pin 8 on this keyboard appears to be ground, and I don't need to be an electrician to find out why, upon plugging the keyboard in, the wire to pin 8 got quite hot. So I guess this is different from pc98 boards? I hope I didn't damage anything

Hope you could plug off it immedately.

You can post pic of your wiring to get double check. 
People including me sometime interpret pinouts reversed with confused with receptacle and plug side.

In case that it is not PC98 compatible you will have to open its case and trace power/signal lines on pcb using multimeter.
Share pics of the pcb when you decide to open its case. I'm interested its inside.

EDIT: Post pics of the keyboard in your own thread. I'll visit there.
Ok! I’ll just post this here. I have a cable that I am pretty sure is attached to pin 8 (if you can see it in the picture) and when I check continuity, that pin is continuous with the metal backplate. I will post pictures of the pcb in my thread now!

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC-98 Converter
« Reply #16 on: Tue, 08 December 2020, 23:37:39 »
Yes, that pin is Pin8. That is not PC98 compatible probably.

Offline EpikalPuppy

  • Posts: 13
Re: TMK NEC PC-98 Converter
« Reply #17 on: Tue, 08 December 2020, 23:53:09 »
Interesting! I guess it’ll remain on my shelf of interesting things that I can’t use for now, at least until I can figure out what exact protocol this is supposed to use

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #18 on: Fri, 17 September 2021, 18:27:53 »
Updated prebuilt firmware files, no PC-9801 specific change but some generic fixes for TMK firmware.

And added Keymap Editor support for PC98 converter. Try it and let me know if you have problem, suggestionon or anything.
https://www.tmk-kbd.com/tmk_keyboard/editor/

EDIT: I tested this converter only with PC-9801V and DIGITAL WAVE Dboard, but feedbacks from owners with other PC-9801 keyboards are needed.
« Last Edit: Fri, 17 September 2021, 18:34:26 by hasu »

Offline reppi

  • Posts: 5
Re: TMK NEC PC98 Keyboard Converter
« Reply #19 on: Sat, 10 June 2023, 03:40:15 »
Hi hasu-san. I've built PC98 keyboard converter with Arduino Pro Micro clone.
But I have two Issues. Can you help? I'm using PC-9821 Keyboard which has Windows key(CMP-6D1Y7).
Windows key and Application key is not working.
I have read "Keyboard Interface & Commands" ( http://www.webtech.co.jp/company/doc/undocumented_mem/io_kb.txt ) in References, it says "to use extra keys, you have to send 95h and 03h to keyboard."
But this firmware looks never do this.
What should I do.

Mapping ESC on STOP key will not work.
I think there are some issue in config.h line 38.
Code: [Select]
    matrix_is_on(12, 0) || /* STOP */ \
I don't know this line does what.
but delete this line, build firmware, then flash, mapping ESC on STOP key works well.
What should I do?

and can I use Japanese, my English skill isn't very well :)

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #20 on: Sat, 10 June 2023, 04:12:31 »
You can find debug messages using hid_listen. Share debug ouputs on console when it plugs to see if the converter recognizes the keyboard as 'new type' keyboard.
https://github.com/tmk/tmk_keyboard/wiki#hid_listen

Codes around this show how to send PC98 command, try send the commands if you can see.
https://github.com/tmk/tmk_keyboard/blob/master/converter/pc98_usb/matrix.c#L77-L106

I don't have pc98 keyboards and converer around to test that commands now.


Stop key is assigned as Magic key for debug by default.  For example, pressing Stop and 'H' key show help message on hid_listen console.
https://github.com/tmk/tmk_keyboard/wiki#magic-commands-for-debug

You can remove the line safely if you don't need Magic commands.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #21 on: Sat, 10 June 2023, 09:42:05 »
reppi or anyone with the keyboard

Can you try this patch for windows key and post hid_listen log ?


Code: [Select]
diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c
index 029c599f..518e0a3b 100644
--- a/converter/pc98_usb/matrix.c
+++ b/converter/pc98_usb/matrix.c
@@ -105,6 +105,19 @@ static bool pc98_is_newtype(void)
     return true;
 }
 
+static void pc98_enable_winkey(void)
+{
+    uint16_t code;
+RETRY:
+    pc98_send(0x95);
+    code = pc98_wait_response();
+    if (code != 0xFA) return;
+
+    pc98_send(0x03);
+    code = pc98_wait_response();
+    if (code != 0xFA) goto RETRY;
+}
+
 static uint8_t pc98_led = 0;
 static void pc98_led_set(void)
 {
@@ -140,8 +153,13 @@ void matrix_init(void)
     serial_init();
 
     _delay_ms(50);
-    if (pc98_is_newtype()) xprintf("new type\n"); else xprintf("old type\n");
+    xprintf("\nKeyboard Type: ");
+    if (pc98_is_newtype()) xprintf("[NEW]"); else xprintf("[OLD]");
+
+    xprintf("\nInhibit Repeat: ");
     pc98_inhibit_repeat();
+    xprintf("\nEnable Winkey: ");
+    pc98_enable_winkey();
 
     // initialize matrix state: all keys off
     for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;

Offline reppi

  • Posts: 5
Re: TMK NEC PC98 Keyboard Converter
« Reply #22 on: Mon, 12 June 2023, 04:13:53 »
Thank you, hasu-san. Sorry for late reply.

You can remove the line safely if you don't need Magic commands.
I'm glad to hear that. I'll keep that line is deleted. :)

I've tried new code that you posted.
debug recognizes CMP-6D1Y7 as 'old type' when connect Arduino to PC.
Code: [Select]
Waiting for device:...
Listening:

TMK:6a6c07/LUFA:d6a7df

Keyboard Type: s9F r00FB [OLD]
Inhibit Repeat: s9C r00FA s70 r00FA
Enable Winkey: s95 r00FA s03 r00FA
USB configured.

Loop start.
s9D r00FA s71 r00FA

but resetting connected Arduino will debug recognizes as 'new type'. that's strange.  :(
Code: [Select]
Device disconnected.
Waiting for new device:.........
Listening:

TMK:6a6c07/LUFA:d6a7df

Keyboard Type: s9F r00FA r00A0 r0080 [NEW]
Inhibit Repeat: s9C r00FA s70 r00FA
Enable Winkey: s95 r00FA s03 r00FA
USB configured.

Loop start.
s9D r00FA s71 r00FA

Either type seems no problem.
and Windows key and App key is works well. Great. Thank you!

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #23 on: Mon, 12 June 2023, 22:58:49 »
Thanks for testing.

I also found that inconsistency of keyboard type command with Dboard sono1. Some PC98 keyboards seem to need a bit more time before receiving 'keyboard type' command. I'll increase wait time for startup(50 to 500ms) in next release.

I'll update github repo and keyboard editor for this windows key support.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #24 on: Tue, 13 June 2023, 01:55:35 »
[FIRMWARE UPDATE]

Updated github repo and keyboard editor for Windows/Menu key support.

https://github.com/tmk/tmk_keyboard/commit/e94fd4ba2a4f38e2818a0d4cd5ebc5aeadfde789

Offline reppi

  • Posts: 5
Re: TMK NEC PC98 Keyboard Converter
« Reply #25 on: Wed, 14 June 2023, 12:02:15 »
Hi, hasu san. :)
I've tested updated firmware.
It looks like new firmware broke the inhibit key repeat feature on new type keyboard. :eek:
looked debug via hid_listen.exe, keyboard type data ("A0 80") was coming when "pc98_inhibit_repeat()".
This is why key repeat wasn't configure properly.
299840-0

I'm not master of ATMEGA32U4 or C/C++, but tried investigate what's going on.
I tried add more "code = pc98_wait_response();" to "pc98_is_newtype()".
299844-1
connecting Arduino to PC, CMP-6D1Y7 sends "FB FA A0 80" when received "9F".
I don’t get it why there's "FB". Is that a some kind of ACK?
299842-2
resetting connected Arduino, CMP-6D1Y7 sends "FA A0 80" normally. there's no "FB".
It may needs some workaround that allow "FB FA" as ACK.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #26 on: Wed, 14 June 2023, 20:51:45 »
Interesting.

I wildly guess that FBh is undocumented response code which means 'keyboard is not ready' or 'something goes wrong'.
The keyboard replies successfully as expected after **warm reset** in your post, it indicates keyboard needs some time to startup.

You will have to do retrying or something when receiving FBh reply anyway.

Can you test this patch and post debug prints?
Code: [Select]
diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c
index 0dbf4fc7..161bae1e 100644
--- a/converter/pc98_usb/matrix.c
+++ b/converter/pc98_usb/matrix.c
@@ -60,8 +60,11 @@ static void pc98_send(uint8_t data)
 
 static int16_t pc98_wait_response(void)
 {
-    int16_t code = -1;
-    uint8_t timeout = 255;
+    int16_t code;
+    uint8_t timeout;
+RETRY:
+    code = -1;
+    timeout = 255;
     while (timeout-- && (code = serial_recv2()) == -1) _delay_ms(1);
 
     // Keyboards require RDY pulse >=37us to send next data
@@ -71,6 +74,7 @@ static int16_t pc98_wait_response(void)
     PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
 
     xprintf("r%04X ", code);
+    if (code == 0xFB) goto RETRY;
     return code;
 }
 
@@ -153,15 +157,15 @@ void matrix_init(void)
     serial_init();
 
     _delay_ms(500);
-    xprintf("\nKeyboard Type: ");
-    if (pc98_is_newtype()) xprintf("[NEW]"); else xprintf("[OLD]");
-
     xprintf("\nInhibit Repeat: ");
     pc98_inhibit_repeat();
 
     xprintf("\nEnable Winkey: ");
     pc98_enable_winkey();
 
+    xprintf("\nKeyboard Type: ");
+    if (pc98_is_newtype()) xprintf("[NEW]"); else xprintf("[OLD]");
+
     // initialize matrix state: all keys off
     for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;

Offline reppi

  • Posts: 5
Re: TMK NEC PC98 Keyboard Converter
« Reply #27 on: Thu, 15 June 2023, 04:04:39 »
Thank you hasu san. new code works smooth. Great! :cool:
"FB" appears on received first data anyway.
Code: [Select]
D:\>hid_listen
Waiting for device:....
Listening:

TMK:bd0940/LUFA:d6a7df

Inhibit Repeat: s9C r00FB r00FA s70 r00FA
Enable Winkey: s95 r00FA s03 r00FA
Keyboard Type: s9F r00FA r00A0 r0080 [NEW]
USB configured.

Loop start.
s9D r00FA s71 r00FA
Device disconnected.
Waiting for new device:.........
Listening:

TMK:bd0940/LUFA:d6a7df

Inhibit Repeat: s9C r00FA s70 r00FA
Enable Winkey: s95 r00FA s03 r00FA
Keyboard Type: s9F r00FA r00A0 r0080 [NEW]
USB configured.

Loop start.
s9D r00FA s71 r00FA

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #28 on: Thu, 15 June 2023, 09:20:31 »
Thank you for the testing.

FBh response means 'keyboard is not ready' apparently and we will have to receive extra byte when receiving FBh.
The keyboard(CMP-6D1Y7) need longer wait before receiving the first command, perhaps.

I added these two commits into 'pc98_id_fix' branch.
* dc0a6cb4 pc98_usb: Add wait for startup again(500ms -> 1000ms)
* 621d5227 pc98_usb: Receive extra byte for 0xFB response

https://github.com/tmk/tmk_keyboard/tree/pc98_id_fix/converter/pc98_usb/binary

Could you test this binary and post debug log again when you have time?
I like to see if the 1000ms wait works well for the keyboard.

Offline reppi

  • Posts: 5
Re: TMK NEC PC98 Keyboard Converter
« Reply #29 on: Fri, 16 June 2023, 11:34:09 »
Hi hasu san. :) I tested new firmware(dc0a6c).
It seems any delay is not working for CMP-6D1Y7 recognition.
I tried edit the code to 1500ms delay, same results.
"FB" always appears on cold boot. I think it means "hey good morning PC-98 san, you need to initialize me".

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

TMK:dc0a6c/LUFA:d6a7df

Keyboard Type: s9F r00FB r00FA r00A0 r0080 [NEW]
Inhibit Repeat: s9C r00FA s70 r00FA
Enable Winkey: s95 r00FA s03 r00FA
USB configured.

Loop start.
s9D r00FA s71 r00FA
Device disconnected.
Waiting for new device:..........
Listening:

TMK:dc0a6c/LUFA:d6a7df

Keyboard Type: s9F r00FA r00A0 r0080 [NEW]
Inhibit Repeat: s9C r00FA s70 r00FA
Enable Winkey: s95 r00FA s03 r00FA
USB configured.

Loop start.
s9D r00FA s71 r00FA

« Last Edit: Fri, 16 June 2023, 11:39:56 by reppi »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK NEC PC98 Keyboard Converter
« Reply #30 on: Sun, 18 June 2023, 01:56:10 »
Thank you for the testing.
hmm, the longer delay doesn't resolve FBh issue of the keyboard, we will have to receive one more byte when receiving FBh response. I'll keep 500ms for startup delay, which is needed for my Dboard at least.

Just updated github repo and keymap editor again.
https://github.com/tmk/tmk_keyboard/commit/c168e21bd79acabd5f37dd0b77de8340d6021862