Author Topic: How to decypher an old keyboard protocol?  (Read 2181 times)

0 Members and 3 Guests are viewing this topic.

Offline rodcastlerTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: cl
How to decypher an old keyboard protocol?
« on: March 09, 2018, 06:00:01 pm »
Hi,

I want to revive this project I put to sleep after several attempts to decypher the keyboard protocol with no luck.


It's an old brother WP-1 typewriter/word processor with a CRT monitor to edit text on it. It was with no keyboard around when I rescued it from the dumpster.

Current behavior:  Turn the unit on, and it shows "Keyboard error".

Desired behavior: Plug an arduino to the serial keyboard connector and have it emulate keystrokes so the LCD screen shows activity. It's a beautiful CRT.

Question: Where should I start in order to decypher the protocol?

I attempted to throw standard PS/2 commands and other old serial keyb commands to it. I got the unit to beep but that's it: still keyboard error.


More on the unit here: https://www.eevblog.com/forum/projects/driving-the-wide-format-crt-from-an-old-word-processor/msg723082/#msg723082


 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3508
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: How to decypher an old keyboard protocol?
« Reply #1 on: March 09, 2018, 06:11:58 pm »
This is going to be a heck of a fuzz test. Maybe trace out the keyboard connector and its interface circuit first? Also disassemble the program code (if possible) to find out what it is trying to do?
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12582
  • Country: ch
Re: How to decypher an old keyboard protocol?
« Reply #2 on: March 09, 2018, 11:04:57 pm »
Hi,

I want to revive this project I put to sleep after several attempts to decypher the keyboard protocol with no luck.


It's an old brother WP-1 typewriter/word processor with a CRT monitor to edit text on it. It was with no keyboard around when I rescued it from the dumpster.

Current behavior:  Turn the unit on, and it shows "Keyboard error".

Desired behavior: Plug an arduino to the serial keyboard connector and have it emulate keystrokes so the LCD screen shows activity. It's a beautiful CRT.

Question: Where should I start in order to decypher the protocol?

I attempted to throw standard PS/2 commands and other old serial keyb commands to it. I got the unit to beep but that's it: still keyboard error.


More on the unit here: https://www.eevblog.com/forum/projects/driving-the-wide-format-crt-from-an-old-word-processor/msg723082/#msg723082
Yikes. "Decipher" implies that you have the keyboard, and just need to figure out the encoding. But guessing it out of thin air? I'd call it nearly impossible.

In the other discussion, somebody linked to a service manual. The link seems to be dead now, but maybe you can google it, or one of the people in that thread can send it to you. They said the service manual had everything, down to memory maps, so the info is probably there.
 

Offline DC1MC

  • Super Contributor
  • ***
  • Posts: 1886
  • Country: de
Re: How to decypher an old keyboard protocol?
« Reply #3 on: March 09, 2018, 11:48:42 pm »
Hi, if the unit displays "Keyboard Error" without the keyboard attached, that means there is a way for the keyboard chip to detect that it has a keyboard attached.
Barring some sort of presence detector, like a signal that is pulled to ground when the keyboard is attached or something similar, that means the keyboard interface is bidirectional and the keyboard can be queried about its status and control commands can be send to turn on the LEDs on it and so on.
You've said that you've traced the remains of the kb cable to two active signals, considering the above is either a standard serial interface, with tx/rx signals, and you need to see who is who, or some king of synchronous interface, with clock and data.

First see for sure what kind of interface is, and then put a scope or logical analyzer on the signals to see the format of the message that the mainboard sends to the keyboard to detect it. You will get a hold of the protocol used, if it's an serial interface you will get the speed and line information ( bits per character, parity and so  on) plus the signal levels, 5V TTL, RS-232 or something else.

If it's a custom interface, at least you'll see which one is the clock signal and what speeds are uses, as well as the message format.

Do this first, make sure that you've got ALL the signals on the keyboard cable and really you've got just 2 of them to take care off, verify the levels and record what is happening at power-up, what iti is send to the keyboard.

Then and only then you can thing of a way to communicate with the unit, just blasting stuff on it with protocols that were not invented at the time (PS2)  is an exercise in uselessness, as you have observed.

 Best of luck,
 DC1MC   
 

Offline TerraHertz

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: au
  • Why shouldn't we question everything?
    • It's not really a Blog
Re: How to decypher an old keyboard protocol?
« Reply #4 on: March 10, 2018, 12:04:35 am »
Plan of attack:
1. Trace the circuitry relevant to the keyboard interface. From the keyboard plug, right back to the system CPU.
2. From that, work out what IO address range is used for keyboard interface.
3. Extract the system firmware code, to a binary file.
4. Examine code in a hex editor. Is it sensible op codes for the system processor? Can you identify the reset start point and interrupt vectors? Is almost all the binary in machine code, or is there something more complicated going on, like a byte-code interpreter or encrypted/compressed sections?
5. Obtain disassembler utility for the CPU type.
6. First pass disassemble all the code.
7. Search for any mention of the keyboard IO addresses.
8. Comment and refine the disassembled code related to the keyboard, until you understand it.
    There will be several segments: verify present, initialize, operational protocol.

If you think any of those stages are not possible for any reason, then your only other alternative is to try and find an intact system, and capture the interface activity during normal operation. Then work from that.

Otherwise, give up.
Collecting old scopes, logic analyzers, and unfinished projects. http://everist.org
 
The following users thanked this post: rodcastler

Offline rodcastlerTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: cl
Re: How to decypher an old keyboard protocol?
« Reply #5 on: March 10, 2018, 12:55:41 pm »
All of you bring super interesting ideas, but I'm afraid they are beyond my current limitations of equipment, knowledge and time.

I remember going as far as clearly identifying the clock line and the data line. It was most likely a bi-directional communication pretty much like PS/2. (BTW user DC1MC made me remember that I was indeed aware that this machine came before the PS/2 protocol. I tried different protocols including PS/2 just to see the effects.

I think it's time to drop this effort and see if I can drive the CRT instead of the keyboard interface. User tooki brings a good point about guessing out of thin air. I did get a hold of the service manual at one point, but it had nothing on the keyboard but replacing it when facing any errors.

Thank you!
 

Offline ahbushnell

  • Frequent Contributor
  • **
  • Posts: 747
  • Country: us
Re: How to decypher an old keyboard protocol?
« Reply #6 on: March 10, 2018, 08:20:52 pm »
All of you bring super interesting ideas, but I'm afraid they are beyond my current limitations of equipment, knowledge and time.

I remember going as far as clearly identifying the clock line and the data line. It was most likely a bi-directional communication pretty much like PS/2. (BTW user DC1MC made me remember that I was indeed aware that this machine came before the PS/2 protocol. I tried different protocols including PS/2 just to see the effects.

I think it's time to drop this effort and see if I can drive the CRT instead of the keyboard interface. User tooki brings a good point about guessing out of thin air. I did get a hold of the service manual at one point, but it had nothing on the keyboard but replacing it when facing any errors.

Thank you!

Buy a key board and measure the output.  :)
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 836
  • Country: es
Re: How to decypher an old keyboard protocol?
« Reply #7 on: March 11, 2018, 12:41:31 am »
Can you dump the ROM and post it?
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: How to decypher an old keyboard protocol?
« Reply #8 on: March 11, 2018, 06:19:53 am »
Looking at a picture of the WP-1 jogged my memory, I think I might actually have one of those over at my mom's place, I remember there being an old word processor with a funky wide aspect ratio mono CRT. I'm planning to go over there tomorrow so I'll try to remember to look around for it. Shouldn't be too hard to scope the keyboard signal.
 
The following users thanked this post: rodcastler

Offline DBecker

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: How to decypher an old keyboard protocol?
« Reply #9 on: March 11, 2018, 09:14:57 pm »
Google suggests that is a 1985-era machine.

I expect that they used something similar to the PC-XT keyboard hardware and protocol, with different scan code for gratuitous incompatibility.

What is the frequency of the data clock?
 

Offline rodcastlerTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: cl
Re: How to decypher an old keyboard protocol?
« Reply #10 on: March 12, 2018, 03:14:19 am »
I'll try to remember to look around for it. Shouldn't be too hard to scope the keyboard signal.

You need to take the unit apart in order to access the keyboard connector. there is a metal cover on the underside. I can’t remember for sure if there was access to it from there, in which case it would indeed be easy.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: How to decypher an old keyboard protocol?
« Reply #11 on: March 12, 2018, 03:17:38 am »
Well shoot, I knew I was forgetting something while I was over there, I'll set a reminder to grab it next time I drop by.
 
The following users thanked this post: rodcastler

Offline rodcastlerTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: cl
Re: How to decypher an old keyboard protocol?
« Reply #12 on: March 13, 2018, 02:53:04 pm »
I appreciate the intention. Please bear in mind that later models had the keyboard matrix fed into the main CPU which is not my case.
WP-1 looks like this:

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf