Author Topic: TMK PS/2 to USB keyboard converter  (Read 185265 times)

0 Members and 1 Guest are viewing this topic.

Offline itzmeluigi

  • Posts: 301
  • ПБТ
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #150 on: Fri, 18 March 2016, 17:16:01 »
Post pic of your wiring.
Did you connect DATA to PD0 and Clock ot PD4? Do you have pull up resistors?
And do you have components(zeners and registers on INT0/INT1) for VUSB?

Yup i connected DATA to PD0 and Clock to PD4.  I didnt use pullup resistors, are they required? If so where should i wire them to?

I dont think i have zeners and registers on INT0/INT1. I just cut a PS/2 cable and connected the wires from it to the 1pin connectors on the Arduino Nano.

Data and Clock wires:



5v and GND wires:


PS/2 cable wiring:

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #151 on: Fri, 18 March 2016, 17:28:51 »
I haven't touched VUSB PS/2 converter for long time but just confirmed it still works from the latest source, glad.

Saw your pic, it seems like you don't have hardware for VUSB. Arduino nano is not compatible for VUSB you'll have to attach USB connector and resistors and zener diodes yourself.(EDIT: you cannot use Nano's USB connector for VUSB, it can be used only for programming flash.)
Do you know about what VUSB is or how it works, did you read VUSB docs or something? If you are not familir with VUSB you definitely need to read its doc or tutorial.
« Last Edit: Fri, 18 March 2016, 17:39:45 by hasu »

Offline QuincyJones

  • Posts: 270
  • Location: The Greatest Of Them All, England
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #152 on: Mon, 04 July 2016, 03:01:25 »
I haven't touched VUSB PS/2 converter for long time but just confirmed it still works from the latest source, glad.

Saw your pic, it seems like you don't have hardware for VUSB. Arduino nano is not compatible for VUSB you'll have to attach USB connector and resistors and zener diodes yourself.(EDIT: you cannot use Nano's USB connector for VUSB, it can be used only for programming flash.)
Do you know about what VUSB is or how it works, did you read VUSB docs or something? If you are not familir with VUSB you definitely need to read its doc or tutorial.

Are you sure?

I'm thinking of doing the same thing, and posts like ( http://stackoverflow.com/questions/11967197/arduino-application-communication-over-built-in-usb ) this make me think it's possible! Also, pin 0 in the photo above appears to be marked txd, not pin 1!

« Last Edit: Mon, 04 July 2016, 04:01:37 by QuincyJones »
SENT FROM MY TRKA-100-ULTRA-PRO-1R WITH FLASHY MULTI-COLOURED LEDS FOR MEGA ULTRA COOLNESS
(please like me)

       

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #153 on: Mon, 04 July 2016, 04:10:11 »
Yes, my post you quoted is still correct.
USB hardware of Nano is dedicated to doing serial communication, you cannot use it for other purpose, for example USB keyobard.

Offline QuincyJones

  • Posts: 270
  • Location: The Greatest Of Them All, England
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #154 on: Mon, 04 July 2016, 13:59:20 »
Yes, my post you quoted is still correct.
USB hardware of Nano is dedicated to doing serial communication, you cannot use it for other purpose, for example USB keyobard.

That's a shame and has saved me some money not buying the ones I had lined up!

Is there a definite flash size specified for this? I'm investigating some ATTiny85 boards which apparently support v-usb but will only have about 6k of flash
SENT FROM MY TRKA-100-ULTRA-PRO-1R WITH FLASHY MULTI-COLOURED LEDS FOR MEGA ULTRA COOLNESS
(please like me)

       

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #155 on: Tue, 05 July 2016, 03:48:49 »
Tmk doesn't fit in that small 6kb anymore, get 168 or 328. It needs around 6500 bytes when building without some features. That  being said, you will be able to build it less than 6kb if you have decent SKILLs and passion. In that case I can help you.

But If you want to just save your money I can't help you.  :)

« Last Edit: Tue, 05 July 2016, 06:18:42 by hasu »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #156 on: Fri, 16 September 2016, 22:20:57 »
Keymap editor is available now.

For TMK PS/2-USB converter(Rev.2):
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb

For old TMK PS/2-USB converter(Rev.1):
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb_rev1

If you made a converter yourself with Teensy or ATMega32u4 you will be able to use editor for Rev.1.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #157 on: Wed, 05 October 2016, 22:38:09 »
PS/2 converter has had some problem on USB suspend/resume, I updated code and firmware on keymap editor for this and I think it works now.
You can try the new firmware if you have problem.

https://github.com/tmk/tmk_keyboard/commit/1a7d1f9f4d6fdebb6e1d088ffcb37745ddf119d2
« Last Edit: Wed, 05 October 2016, 22:39:41 by hasu »

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #158 on: Sat, 29 October 2016, 09:20:54 »
Hello Hasu,

(sorry for not reading the whole thread)

I intend to make such a converter using a "Pro Micro". My question is, in the 'converter/ps2_usb' folder, which is the "proper" Makefile to use? Or, is it enough if I change 'atmega32u2' to 'atmega32u4' in the main "Makefile"? And thanks (again) for creating TMK and all the features, and keyboards,  and converters that it supports :)

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #159 on: Sat, 29 October 2016, 11:48:29 »
Hello Hasu,

(sorry for not reading the whole thread)

I intend to make such a converter using a "Pro Micro". My question is, in the 'converter/ps2_usb' folder, which is the "proper" Makefile to use? Or, is it enough if I change 'atmega32u2' to 'atmega32u4' in the main "Makefile"? And thanks (again) for creating TMK and all the features, and keyboards,  and converters that it supports :)


I think you are doning right way. Use Makefile and change mcu and frequency setting for your hardware.

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #160 on: Sat, 29 October 2016, 12:18:39 »

Ok - Thanks! :)

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #161 on: Mon, 21 November 2016, 04:01:56 »
Another question (related to this):

Is it possible to use the converter with two PS/2 devices as two connected inputs, in order to be seen by the PC as a single, programmable, USB connected device?

(i.e. two inputs, one output)

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #162 on: Mon, 21 November 2016, 13:56:07 »
No, current code doesn't  support multiple instance of PS/2, but you can still use it as starting point.
i.e. TMK is not itself enough for your need but C/C++ can do anything you want :D

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #163 on: Tue, 22 November 2016, 03:07:22 »
No, current code doesn't  support multiple instance of PS/2, but you can still use it as starting point.
i.e. TMK is not itself enough for your need but C/C++ can do anything you want :D

Fair enough :) And you're right, it will still be easier than starting from scratch!

Offline Tactile

  • Posts: 1432
  • Location: Portland, OR
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #164 on: Thu, 08 December 2016, 16:22:52 »
How to handle multiple key codes?

I have an unusual keyboard from a piece of medical equipment. My PS/2 to USB converter using a teensy 2.0 is built and working great as a pass-through converter. Through the converter the keyboard behaves exactly as it does when plugged into the PS/2 port. Now I need to work with the oddball keys on this keyboard.

I have keys which when pressed send:
F9 + a
F9 + b
F9 + c
 ...
F9 + z
F10 + a
F10 + b
 ...
F10 + h

How can I deal with these multiple key codes in order to reprogram these keys?
REΛLFORCE

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #165 on: Thu, 08 December 2016, 16:28:49 »
Do you have pic of the keyboard? Just curious.

You will have to write C code to handle those keys.

Sent from my Nexus 5X


Offline Tactile

  • Posts: 1432
  • Location: Portland, OR
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #166 on: Thu, 08 December 2016, 16:34:37 »
Do you have pic of the keyboard? Just curious.

You will have to write C code to handle those keys.

Sent from my Nexus 5X

I was thinking I need to put a case into matrix.c but I'm unclear how to check for one key code then catch the next to compare.

It's a TG3 brand board and here it is...

155031-0
REΛLFORCE

Offline TioSolid

  • Posts: 15
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #167 on: Thu, 12 January 2017, 10:19:43 »
Hi everyone. I have a noppoo choc mini and im using this adapter since its original controller (for usb use) is a complete mess because of its NKRO over usb implementation.

Thing is: My noppoo sometimes has a LOT of chatter and looking through the TMK_CORE files in github I saw that the base firmware has a debounce setting in it, but the PS2 converter has not (afaik). So, would be possible to add a debounce routine in this converter and if yes, how would one go about doing it? I can code reasonably well, but since my understanding of the tmk firmware is pretty much zero, I have no clue about where to start

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #168 on: Thu, 12 January 2017, 21:53:17 »
Hi everyone. I have a noppoo choc mini and im using this adapter since its original controller (for usb use) is a complete mess because of its NKRO over usb implementation.

Thing is: My noppoo sometimes has a LOT of chatter and looking through the TMK_CORE files in github I saw that the base firmware has a debounce setting in it, but the PS2 converter has not (afaik). So, would be possible to add a debounce routine in this converter and if yes, how would one go about doing it? I can code reasonably well, but since my understanding of the tmk firmware is pretty much zero, I have no clue about where to start

In genral converters don't have debouncer and keyboard should have it. I think you better repair your keyboard,  probably by replacing switches? If it is not option you can implement debouncing in converter firmware. In matrix_scan() the converter keeps key states in matrix[] array according to key events from keyboard. You can place your logic in this function.
https://github.com/tmk/tmk_keyboard/blob/master/converter/ps2_usb/matrix.c#L144-L383

Offline Tactile

  • Posts: 1432
  • Location: Portland, OR
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #169 on: Thu, 12 January 2017, 22:34:47 »
What are the symptoms if we need pull up resistors & don't have them?
REΛLFORCE

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #170 on: Thu, 12 January 2017, 22:48:47 »
What are the symptoms if we need pull up resistors & don't have them?

It wouldn't work simply, otherwise goes mad?

Offline TioSolid

  • Posts: 15
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #171 on: Fri, 13 January 2017, 05:24:14 »
Hi everyone. I have a noppoo choc mini and im using this adapter since its original controller (for usb use) is a complete mess because of its NKRO over usb implementation.

Thing is: My noppoo sometimes has a LOT of chatter and looking through the TMK_CORE files in github I saw that the base firmware has a debounce setting in it, but the PS2 converter has not (afaik). So, would be possible to add a debounce routine in this converter and if yes, how would one go about doing it? I can code reasonably well, but since my understanding of the tmk firmware is pretty much zero, I have no clue about where to start

In genral converters don't have debouncer and keyboard should have it. I think you better repair your keyboard,  probably by replacing switches? If it is not option you can implement debouncing in converter firmware. In matrix_scan() the converter keeps key states in matrix[] array according to key events from keyboard. You can place your logic in this function.
https://github.com/tmk/tmk_keyboard/blob/master/converter/ps2_usb/matrix.c#L144-L383

Thanks very much, Will check this out!

Offline catawalks

  • Posts: 17
  • Location: Monroe, NY
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #172 on: Mon, 20 February 2017, 19:40:55 »
Alright, I think I'm missing something or I did something wrong. I've got a Dell AT101W PS/2 board that I'm wiring up a Teensy 2.0 with the default TMK PS2-USB Converter Rev.1 firmware.

I've got Vcc connected to +5v, GND connected to ground, PD0 connected to Data, and PD1 connected to Clock.

When I connect the USB connector to it, all the LEDs light up for like half a second and then they all go off. After that the teensy shows in device manager as a keyboard, but nothing on the keyboard works.

Do I have the lines backwards or am I using the wrong firmware or something? I tried putting a 4.7k resistor on the data and clock lines connecting to Vcc but still nothing.

Any ideas would be greatly appreciated.

Offline Randalljai

  • Posts: 128
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #173 on: Sun, 11 June 2017, 12:28:01 »
has anyone used this with the realforce 89u JIS? there are some keys that computer does not recognize (windows 10) so how would the hasu work in this situation?

here are some of the things i wan to do (here's a pic for reference: http://imgur.com/a/3okAc)

the red square will be all spacebar function
the blue square will turn into a windows key
the yellow line's function would swap (currently the yellow key doesn't have a function, so when swapped, it would move up a row and turn into a enter key as well, the green square
and the pink box will turn into backspace

Offline Eraicos

  • Posts: 7
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #174 on: Fri, 10 November 2017, 09:01:48 »
Hey Hasu, the USB-to-USB converter has a limited memory, does this converter have that limitation or it can store more layers? How much memory does it have?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #175 on: Fri, 10 November 2017, 17:25:53 »
Hey Hasu, the USB-to-USB converter has a limited memory, does this converter have that limitation or it can store more layers? How much memory does it have?

You will have 11kb free on flash which is enough to define 32 layers.

Offline Darkshado

  • Posts: 79
  • Location: Montréal
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #176 on: Tue, 02 January 2018, 00:52:27 »
Hello Hasu,

Trying to use an ISO modded F AT with the PS/2 converter, the modded keys send some unassigned codes. I tried merely adding the codes to the KEYMAP_ALL macros but this commit (4be3562) leads to build errors:

Code: [Select]
In file included from keymap_plain.c:1:0:
keymap_common.h:131:17: error: 'KC_K19' undeclared here (not in a function); did you mean 'KC_F19'?
     { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO    }, \
                 ^
keymap_common.h:171:1: note: in expansion of macro 'KEYMAP_ALL'
 KEYMAP_ALL( \
 ^~~~~~~~~~
keymap_common.h:196:1: note: in expansion of macro 'KEYMAP_FULL'
 KEYMAP_FULL( \
 ^~~~~~~~~~~
keymap_plain.c:21:5: note: in expansion of macro 'KEYMAP'
     KEYMAP(
     ^~~~~~

And so on. I tried searching for the declaration of existing codes to no avail, with all the preprocessor business going on, not sure what to look for either.

Help?

Thanks,

Darkshado

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #177 on: Tue, 02 January 2018, 18:26:40 »
Hello Hasu,

Trying to use an ISO modded F AT with the PS/2 converter, the modded keys send some unassigned codes. I tried merely adding the codes to the KEYMAP_ALL macros but this commit (4be3562) leads to build errors:

Code: [Select]
In file included from keymap_plain.c:1:0:
keymap_common.h:131:17: error: 'KC_K19' undeclared here (not in a function); did you mean 'KC_F19'?
     { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO    }, \
                 ^
keymap_common.h:171:1: note: in expansion of macro 'KEYMAP_ALL'
 KEYMAP_ALL( \
 ^~~~~~~~~~
keymap_common.h:196:1: note: in expansion of macro 'KEYMAP_FULL'
 KEYMAP_FULL( \
 ^~~~~~~~~~~
keymap_plain.c:21:5: note: in expansion of macro 'KEYMAP'
     KEYMAP(
     ^~~~~~

And so on. I tried searching for the declaration of existing codes to no avail, with all the preprocessor business going on, not sure what to look for either.

Help?

Thanks,

Darkshado

you have to add parameters of the macro KEYMAP_ALL within these lines for the "unassigned codes" you already added in keymap array.
https://github.com/louisrousseau/tmk_keyboard/blob/4be356231c22c6b614cd199418e41e17a335a162/converter/ps2_usb/keymap_common.h#L114-L120

Offline Darkshado

  • Posts: 79
  • Location: Montréal
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #178 on: Wed, 03 January 2018, 02:05:03 »
Got it to work, it was a matter of paying closer attention to the error messages and how C macros are processed :D

https://github.com/tmk/tmk_keyboard/pull/509

Thanks,

Darkshado

Offline equalunique

  • Posts: 539
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #179 on: Thu, 18 January 2018, 13:02:53 »
Hasu, I noticed that on github under features you have the following listed:

"Keyboard protocols - PS/2, ADB, M0110, Sun and other old keyboard protocols"

Is it possible to connect a TMK keyboard to a PS/2 port on a computer? If so, then how difficult/easy would that be to do?

Otherwise, it would seem that the only open source firmwares capable of PS/2 output are ps2avr/ps2avrgb.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project

Offline TieuNgu

  • Posts: 193
  • Location: US, AZ
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #181 on: Tue, 17 April 2018, 20:13:09 »
https://imgur.com/a/gglWr

I'm trying to make the adapter work with my BTC 5100C. This is my first time of doing this and I don't know where to start. When I plugged the keyboard in, it wasn't even recognized. Would anyone have any experience on this?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #182 on: Tue, 17 April 2018, 20:46:17 »
https://imgur.com/a/gglWr

I'm trying to make the adapter work with my BTC 5100C. This is my first time of doing this and I don't know where to start. When I plugged the keyboard in, it wasn't even recognized. Would anyone have any experience on this?


1) FIrst, without keyboard check your converter is recogized with device manager if you are on windows, use proper command or see log file if you are on Linux or something. It should have feed:6512 as USB VID:PID.

EDIT: It is recognized as normal 'HID keyboard Device' in WIndows 10. The converter should add two 'HID keyboard Device' entries when using default firmware. Note that 'Standard PS/2 Keyboard' is internal keyboard in my ThinkPad, you won't see it even if you plug your BTC keybaord into converter.




1a) This is optional. Push button to put the converter into flash mode. You should see  03eb:2ff0 as VID:PID. Refer this If you need to install driver to flash new firmware. https://github.com/tmk/tmk_keyboard/wiki/Driver-install-on-Windows

2) plug-in the keyboard. The converter should work with PS/2 keyboard now.

If not flash default firmware downloaded from here. Don't edit keymap here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb

EDIT: oh, make sure that  your USB cable has good quality enough first before that.
« Last Edit: Tue, 17 April 2018, 21:10:08 by hasu »

Offline TieuNgu

  • Posts: 193
  • Location: US, AZ
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #183 on: Tue, 17 April 2018, 21:08:30 »
Thanks for the help!

With that I'm now able to get by board recognized and I could type now. Next, I would like to remap some of my keys, could you let me know how to do it?

https://imgur.com/a/gglWr

I'm trying to make the adapter work with my BTC 5100C. This is my first time of doing this and I don't know where to start. When I plugged the keyboard in, it wasn't even recognized. Would anyone have any experience on this?


1) FIrst, without keyboard check your converter is recogized with device manager if you are on windows, use proper command or see log file if you are on Linux or something. It should have feed:6512 as USB VID:PID.
Show Image



1a) This is optional. Push button to put the converter into flash mode. You should see  03eb:2ff0 as VID:PID. Refer this If you need to install driver to flash new firmware. https://github.com/tmk/tmk_keyboard/wiki/Driver-install-on-Windows

2) plug-in the keyboard. The converter should work with PS/2 keyboard now.

If not flash default firmware downloaded from here. Don't edit keymap here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb

EDIT: oh, make sure that  your USB cable has good quality enough first before that.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #184 on: Tue, 17 April 2018, 21:13:06 »
What did you do to recognized you keyboard actually?
And what do you think your problem was?

Refer this for remap.
https://github.com/tmk/tmk_keyboard/wiki

Thanks for the help!

With that I'm now able to get by board recognized and I could type now. Next, I would like to remap some of my keys, could you let me know how to do it?

https://imgur.com/a/gglWr

I'm trying to make the adapter work with my BTC 5100C. This is my first time of doing this and I don't know where to start. When I plugged the keyboard in, it wasn't even recognized. Would anyone have any experience on this?


1) FIrst, without keyboard check your converter is recogized with device manager if you are on windows, use proper command or see log file if you are on Linux or something. It should have feed:6512 as USB VID:PID.
Show Image



1a) This is optional. Push button to put the converter into flash mode. You should see  03eb:2ff0 as VID:PID. Refer this If you need to install driver to flash new firmware. https://github.com/tmk/tmk_keyboard/wiki/Driver-install-on-Windows

2) plug-in the keyboard. The converter should work with PS/2 keyboard now.

If not flash default firmware downloaded from here. Don't edit keymap here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb

EDIT: oh, make sure that  your USB cable has good quality enough first before that.


Offline TieuNgu

  • Posts: 193
  • Location: US, AZ
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #185 on: Tue, 17 April 2018, 21:24:31 »
I was using the front USB port of my computer and the keyboard was not recognized. Then I tried the back USB port and it worked immediately. Refer to this picture (https://imgur.com/a/flaZs)

Per the remap wiki, I understand that I have to remap my key with this editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb)

However, this is my keyboard layout (https://ssli.ebayimg.com/images/g/XiUAAOSws5pZJ1uq/s-l1600.jpg). How can I use your editor to remap this layout?

What did you do to recognized you keyboard actually?
And what do you think your problem was?

Refer this for remap.
https://github.com/tmk/tmk_keyboard/wiki

Thanks for the help!

With that I'm now able to get by board recognized and I could type now. Next, I would like to remap some of my keys, could you let me know how to do it?

https://imgur.com/a/gglWr

I'm trying to make the adapter work with my BTC 5100C. This is my first time of doing this and I don't know where to start. When I plugged the keyboard in, it wasn't even recognized. Would anyone have any experience on this?


1) FIrst, without keyboard check your converter is recogized with device manager if you are on windows, use proper command or see log file if you are on Linux or something. It should have feed:6512 as USB VID:PID.
Show Image



1a) This is optional. Push button to put the converter into flash mode. You should see  03eb:2ff0 as VID:PID. Refer this If you need to install driver to flash new firmware. https://github.com/tmk/tmk_keyboard/wiki/Driver-install-on-Windows

2) plug-in the keyboard. The converter should work with PS/2 keyboard now.

If not flash default firmware downloaded from here. Don't edit keymap here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb

EDIT: oh, make sure that  your USB cable has good quality enough first before that.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #186 on: Tue, 17 April 2018, 21:42:43 »
I was using the front USB port of my computer and the keyboard was not recognized. Then I tried the back USB port and it worked immediately. Refer to this picture (https://imgur.com/a/flaZs)

Thanks for the pic. I don't know much but have heard some people said they had problem with USB 3 ports like you described.

Quote
Per the remap wiki, I understand that I have to remap my key with this editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?ps2_usb)

However, this is my keyboard layout (https://ssli.ebayimg.com/images/g/XiUAAOSws5pZJ1uq/s-l1600.jpg). How can I use your editor to remap this layout?

You can't break the converter hardware with flashing firmware. Just do trial and error you will know how this works eventually.

For example, if you want to remap ESC of you keyboard  just edit key makred as ESC (in initial keymap)  in keymap editor basically.

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #187 on: Tue, 03 July 2018, 06:23:33 »
To continue the question I put in the other thread (and trying to move it here) - the question is related to adding extra buttons to the ps2_usb converter, buttons directly connected to the Atmega32u4's pins. In addition to your answer, is it right that I need also:

1. to use the busy wait method, since the PS2 keyboard won't know to generate an interrupt when I press a button not connected to it. Or, is the PS2 keyboard interrupt generated automatically at some period, even if nothing happens?

and:

2. (if needed) add debouncing delays or treatment similar to gh60 code (using two matrixes) ?

Thanks again!

P.S. I noted that you added that question and its answer to the TMK FAQ Wiki :)
« Last Edit: Tue, 03 July 2018, 06:31:30 by Laser »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #188 on: Tue, 03 July 2018, 07:23:44 »
1. Not sure what your concern is. But I think there are no reason that you have to use 'PS2_USE_BUSYWAIT' instead of 'PS2_USE_INT'.

2. yes, you will need to debounce the button. the gh60 code won't be suitable in this case, you may want to check onekey project instead. Or you can find many good example codes on the net.

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #189 on: Tue, 03 July 2018, 07:29:59 »
Thanks again! :)

At 1, my concern is this: in my understanding, there is a physical keyboard hooked on PS2 to the Atmega32u4 controller; when I press a key on the keyboard, it generates an interrupt, and the Atmega32u4 processes it. But, if I press a button connected *directly* to the Atmega32u4 controller, the PS2 keyboard didn't generate an interrupt, so, does 'matrix_scan()' get called if there is no interrupt generated? In fewer words, is 'matrix_scan()' called if there is no keyboard interrupt? Or is the keyboard interrupt happening periodically? I hope my question is clear(er).

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #190 on: Tue, 03 July 2018, 07:47:08 »
Ah, OK.
matrix_scan() is called as frequently as possible in infinite loop in main() regardless of PS/2 keyboard signal interrupt.

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #191 on: Tue, 03 July 2018, 07:51:00 »
Ah, OK.
matrix_scan() is called as frequently as possible in infinite loop in main() regardless of PS/2 keyboard signal interrupt.

Thanks, got it! I suppose this can help with debouncing too :)

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #192 on: Tue, 03 July 2018, 11:22:02 »
The "extra buttons" code is here,  in case anybody is interested: https://github.com/VanLaser/tmk_keyboard/commit/d359581e87d2a2b64f62858ba33a6b5efb3e2cc8

It uses buttons PD4 (nr. 4 on Pro Micro) and PD7 (nr. 6 on Pro Micro). Debouncing is based on the TMK 'onekey' keyboard code. I haven't tested with an actual PS2 keyboard connected, yet, just with buttons, so the "laser" keymap may still have mapping errors (but the buttons do work).

With the testbed below, I use just one switch to trigger both "extra buttons" pins; the 2nd switch is used to reset the Pro Micro.

199152-0
« Last Edit: Tue, 03 July 2018, 11:27:03 by Laser »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #193 on: Tue, 03 July 2018, 17:01:27 »
The "extra buttons" code is here,  in case anybody is interested: https://github.com/VanLaser/tmk_keyboard/commit/d359581e87d2a2b64f62858ba33a6b5efb3e2cc8

It uses buttons PD4 (nr. 4 on Pro Micro) and PD7 (nr. 6 on Pro Micro). Debouncing is based on the TMK 'onekey' keyboard code. I haven't tested with an actual PS2 keyboard connected, yet, just with buttons, so the "laser" keymap may still have mapping errors (but the buttons do work).

With the testbed below, I use just one switch to trigger both "extra buttons" pins; the 2nd switch is used to reset the Pro Micro.

(Attachment Link)

Great job so far!
Let us know the result when you actually test with PS/2 keyboard.

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #194 on: Tue, 03 July 2018, 18:10:39 »
Sure, I'll post after testing with a PS2 keyboard attached.

Meanwhile, I added a mini joystick to pins PF6 and PF7 (A1 and A0 on the Pro Micro) and I "imported" the relevant code from Wez' flutterby QMK project, code that reads the analog values and send mouse reports based on them (described here, source code here).

So basically (still without the testing with a PS2 keyboard attached), I have a thumbstick as mouse and two mouse buttons :)

199236-0

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #195 on: Wed, 04 July 2018, 17:54:27 »

I don't have a PS2 mother socket, so I tested in another way - I flashed the new firmware in a Pro Micro already used as a converter and placed inside a PS2 keyboard. The keymap is good :) and by shorting GND and pins PD4 and PD7 (4 and 6) I saw the clicks. Without a thumbstick connected to that Pro Micro, the mouse was stuck to the left-down corner of the screen, and connecting A0 or A1 to the VCC (hope that was allowed) made the mouse move from that corner. So, I say it works, even if I didn't make the official test with everything connected at the same time.

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #196 on: Tue, 29 January 2019, 07:36:24 »

A question (sorry if asked before): if a USB keyboard comes with a passive PS/2 converter, does it mean that it could use your "PS/2 to USB" converter instead of the more expensive USB2USB converter? I read somewhere that "PS2 host to USB device adapters are passive and just convert the connector. They require the keyboard or Mouse to support both protocols and automatically detect which to use." My idea would be to hook up the pins from the PCB connector that normally go to the USB jack to the PS/2 part of the PS/2-to-USB converter. Would that work? (the keyboard would detect that it's in the PS/2 mode)

While in the end the connection is still USB, the purpose is of course that of making the keyboard fully programmable with TMK, using the cheaper to buy/make PS/2-to-USB converter.


Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #197 on: Tue, 29 January 2019, 08:09:03 »

A question (sorry if asked before): if a USB keyboard comes with a passive PS/2 converter, does it mean that it could use your "PS/2 to USB" converter instead of the more expensive USB2USB converter? I read somewhere that "PS2 host to USB device adapters are passive and just convert the connector. They require the keyboard or Mouse to support both protocols and automatically detect which to use." My idea would be to hook up the pins from the PCB connector that normally go to the USB jack to the PS/2 part of the PS/2-to-USB converter. Would that work? (the keyboard would detect that it's in the PS/2 mode)

While in the end the connection is still USB, the purpose is of course that of making the keyboard fully programmable with TMK, using the cheaper to buy/make PS/2-to-USB converter.



Yes, you can use PS/2-USB converter if your keyboard itself supports PS/2 through 'passive adapter'. I believe your keyboard does support PS/2 if it comes with the 'passive adapter' shipped from manufacturer.

I think 'passive adapter' converts just physical connector form and play no role in terms of electrics, so you can hook up the converter directly to keyboard without passive adapter.

Offline Laser

  • Posts: 102
  • Location: euROpe
Re: PS/2 to USB keyboard converter for Teensy with mousekeys and NKRO
« Reply #198 on: Tue, 29 January 2019, 08:14:27 »

Thanks again Hasu! That's actually GREAT :)

Offline youxiaojie

  • Posts: 31
Re: PS/2 to USB keyboard wireless converter
« Reply #199 on: Tue, 29 January 2019, 14:06:02 »
I am trying to extend the tmk PS 2 to USB converter by nrf 24l
01 to send and receive  USB hid, can anyone help me? I couldn't find main program in converter for atmega 32U4 or 328P.