Author Topic: IBM Terminal Keyboard converter  (Read 17290 times)

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 2532
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
IBM Terminal Keyboard converter
« on: Mon, 13 February 2012, 11:10:50 »
Yet Another converter for IBM Terminal Keyboard(PS/2 Scan Code Set 3)




Keyboard converter for IBM terminal keyboard
============================================                                                                                                                                                         
It supports PS/2 Scan Code Set 3 and runs on USB AVR chips such like PRJC Teensy.
I tested the converter on ATMega32U4 with 1392595(102keys) and 6110345(122keys).
 
Source code: https://github.com/tmk/tmk_keyboard
Article: http://geekhack.org/showwiki.php?title=Island:27272
 
 
CONNECTION
----------
Keyboard    ATMega32U4
----------------------
Data:       PD2
Clock:      PD5
 
And VCC and GND, of course. See RESOURCE for keyboard connector pin assign.
 
 
BUILD
-----
$ git clone https://github.com/tmk/tmk_keyboard.git
$ cd converter/terminal_usb                                                                       
$ make                                                                                             
                                                                                                   
                                                                                                   
RESOURCE                                                                                           
--------                                                                                           
Soarer's Converter: http://geekhack.org/showwiki.php?title=Island:17458                           
102keys(1392595): http://geekhack.org/showthread.php?10737-What-Can-I-Do-With-a-Terminal-Model-M   
122keys(1390876): http://www.seasip.info/VintagePC/ibm_1390876.html                               
KbdBabel: http://www.kbdbabel.org/                                                                 
RJ45 Connector: http://www.kbdbabel.org/conn/kbd_connector_ibmterm.png                             
DIN Connector: http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png                   
WinAVR: http://winavr.sourceforge.net/                                                             
                                                                                                   
EOF
« Last Edit: Sat, 04 May 2013, 01:06:33 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2532
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM Terminal Keyboard converter
« Reply #1 on: Sat, 04 May 2013, 01:25:55 »
I updated code to support 122 keys terminal keyboard(6110345).

I got this beast due to favor of generous members. Thanks a lot, guys.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Hak Foo

  • Posts: 1199
  • Make America Clicky Again!
Re: IBM Terminal Keyboard converter
« Reply #2 on: Sat, 04 May 2013, 01:58:03 »
If I may ask, what makes it different and/or better than the Soarer converter?
Home: Tactile Pro 4 PC
Work: Customizer 104
Spare: Quickfire XT, Greens, Retro DSA

Offline hasu

  • Thread Starter
  • Posts: 2532
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM Terminal Keyboard converter
« Reply #3 on: Sat, 04 May 2013, 02:29:24 »
hmm, availability of source code? In theory, you can fix problem yourself and add anything you want without bothering Soarer. In fact  there is no reason for using mine if you are happy with Soarer's converter.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline SmallFry

  • ** Moderator Emeritus
  • Posts: 3876
  • Location: Wisconsin, USA
  • Leaving 6/15; returning 6/22 or so.
Re: IBM Terminal Keyboard converter
« Reply #4 on: Sat, 04 May 2013, 02:33:12 »
I think Hasu is just happy to get the F from HaaTa. Congrats on that Hasu! How did meeting HaaTa go?

Offline hasu

  • Thread Starter
  • Posts: 2532
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM Terminal Keyboard converter
« Reply #5 on: Sat, 04 May 2013, 04:57:40 »
It was great. I'm a lucky guy because i met him at my first GH(or DT?) meetup!
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline ikoma

  • Posts: 28
  • Location: Austin, Texas
Re: IBM Terminal Keyboard converter
« Reply #6 on: Sun, 05 May 2013, 02:10:02 »
Just picked up this exact keyboard for $15
Looking forward to converting it and getting it working.
QFR x2 | HHKB Pro2 | IBM Model M2 x2 | IBM Model M | Razer Blackwidow | NeXT Keyboard (Alps)

Offline wyatt8740

  • Posts: 73
  • Machine code enthusiast
Re: IBM Terminal Keyboard converter
« Reply #7 on: Sat, 27 December 2014, 19:26:55 »
I know this hasn't been posted on for a very long time, but I think this is probably the best place to put it... If not, sorry for the necromancing.

I just made this with my arduino leonardo and upon plugging in my keyboard I get... squat.
Is there any way to figure out what is happening? does this use an indicator LED?

I believe PD2 is the leonardo's RX pin and PD5 is its TX pin.


Part number is 1386303.
« Last Edit: Sat, 27 December 2014, 19:29:00 by wyatt8740 »
I don't usually collect things, but when I do, they're from the 70's, 80's, and 90's. My typing speed: 79 WPM
IBM Model M 1386303, 1985 / IBM Model M 59G7980, 1993 / IBM Model M 1391401, 1993 / Dell AT101W, 1994 / Apple Extended Keyboard, 1987

Offline dorkvader

  • Posts: 6274
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: IBM Terminal Keyboard converter
« Reply #8 on: Sat, 27 December 2014, 19:57:08 »
I know this hasn't been posted on for a very long time, but I think this is probably the best place to put it... If not, sorry for the necromancing.

I just made this with my arduino leonardo and upon plugging in my keyboard I get... squat.
Is there any way to figure out what is happening? does this use an indicator LED?

I believe PD2 is the leonardo's RX pin and PD5 is its TX pin.


Part number is 1386303.

I think its a difference with Hasu's teensy (atmel) pin names and the leonardo's arduino pin names. Based on the following:
http://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html


Here's arduino's image:
http://arduino.cc/en/Hacking/PinMapping32u4

Hasu requires PD2 (data) and PD5 (clock)
On the ardiono pro micro PD2 is RX and PD5 controls one of the LEDs

I recommend reassigning clock to PD3 (TX) and reflashing.

Offline hasu

  • Thread Starter
  • Posts: 2532
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM Terminal Keyboard converter
« Reply #9 on: Sat, 27 December 2014, 21:05:14 »
Those figrues are useful. Thanks.

And leonardo schematic: http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf

Hasu requires PD2 (data) and PD5 (clock)
On the ardiono pro micro PD2 is RX and PD5 controls one of the LEDs

I recommend reassigning clock to PD3 (TX) and reflashing.

Yes, PD5 is needed but unfortuantely leonardo and pro micro have no pinout and drive TXLED with the pin.

As dorkvader said, you better change pin configuration, you need to edit Makefile and config.h and
connect data line to PD2(RX) and clock line to PD3(TX).

Code: [Select]
diff --git a/converter/terminal_usb/Makefile b/converter/terminal_usb/Makefile
index 6154d86..77b8228 100644
--- a/converter/terminal_usb/Makefile
+++ b/converter/terminal_usb/Makefile
@@ -78,9 +78,9 @@ COMMAND_ENABLE = yes    # Commands for debug and configuration
 #      USART is recommended if it is available, others are for reference purpose.
 #      INT implementation will drop simultaneous key strokes.
 #
-PS2_USE_USART = yes    # uses hardware USART engine for PS/2 signal receive(recomened)
+#PS2_USE_USART = yes   # uses hardware USART engine for PS/2 signal receive(recomened)
 #PS2_USE_INT = yes     # uses external interrupt for falling edge of PS/2 clock pin
-#PS2_USE_BUSYWAIT = yes        # uses primitive reference code
+PS2_USE_BUSYWAIT = yes # uses primitive reference code
 
 ifdef PS2_USE_USART
     SRC += protocol/ps2_usart.c
diff --git a/converter/terminal_usb/config.h b/converter/terminal_usb/config.h
index ea5ce62..2349740 100644
--- a/converter/terminal_usb/config.h
+++ b/converter/terminal_usb/config.h
@@ -127,12 +127,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define PS2_CLOCK_PORT  PORTD
 #define PS2_CLOCK_PIN   PIND
 #define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   1
+#define PS2_CLOCK_BIT   3
 
 #define PS2_DATA_PORT   PORTD
 #define PS2_DATA_PIN    PIND
 #define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    0
+#define PS2_DATA_BIT    2
 #endif
 
 #endif
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Mittles

  • Posts: 1
Re: IBM Terminal Keyboard converter
« Reply #10 on: Wed, 11 March 2015, 22:00:25 »
hasu, why does PS2_USE_USART have to be disabled for a pin change?

I've tried this suggestion, and changed my breadboard to match for my RJ45 122 key board, still with no response. dmesg does detect your converter however and all seems to be running fine on the controller, just messy pin configuration.

I'm trying to get a similar setup to wyatt8740 (PN 1394100) working with an arduino micro, which should have the same pinout as the leonardo. Any ways to test to make sure I've not made a wiring mistake? I did get Soarer's to work, but I'd prefer to use something I can hack away at later on. That patch in your last post no longer directly applies to master.
« Last Edit: Wed, 11 March 2015, 22:47:45 by Mittles »

Offline hasu

  • Thread Starter
  • Posts: 2532
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: IBM Terminal Keyboard converter
« Reply #11 on: Wed, 11 March 2015, 23:21:42 »
Yes, for the pin change, PS2_USART implement requires PD5(XCK1) but Leonardo has pinout for those pin. You can't use PS2_USART, have to use PS2_BUSYWAIT(or PS2_INT) instead.
PS2_BUSYWAIT works with any pin combination, it is useful in this case.

Post photos of your converter wiring so that I can check.

And use PJRC 'hid_listen' tool to see message on debug console.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline darky_mtp

  • Posts: 1
Re: IBM Terminal Keyboard converter
« Reply #12 on: Tue, 18 April 2017, 16:53:54 »
I've tried this suggestion, and changed my breadboard to match for my RJ45 122 key board, still with no response. dmesg does detect your converter however and all seems to be running fine on the controller, just messy pin configuration.
I had the same behaviour.
You have to short J1 pad.
It works !

Edit : It's doesn't work everytime, I have to unplug/plug many times to get the keyboad alive. Once it's working, it will stay alive as long as it's connected.
I have to use Soerer's firmware to get it working everytime.
« Last Edit: Wed, 19 April 2017, 13:01:17 by darky_mtp »