Amstrad 2386 Keyboard

 

Resources

There are no resources about this keyboard and the protocol it uses to communicate with the PC. This keyboard works with Amstrad 2386 and 3386 computers, also branded as Sinclair-Amstrad APC 286 and 386, respectively. This keyboard is pretty rare to get nowadays. Without it, it is impossible to change BIOS setting and effectively to make the PC boot, assuming the CMOS battery in a vintage machine is likely dead.

Internals

 

Membrane

 

Encoder Board

 

Communication Protocol

Unlike most of the other keyboards, including PC XT/AT and PS2, this keyboard has a keyboard encoder chip located inside the keyboard. Key presses are analysed and communicated to the PC, using Intel P8050AH micro-controller.

Pinout

Keyboard is connected to the PC using a 5-wire cable with a 5-pin 240-degree DIN connector. The pin numbers and colors relate to the encoder board connector, internal to the keyboard, on the other side of the cable.

DSC_0001

Signals available on the connector:

  • GND – ground.
  • +5V – power.
  • CLOCK – clock generated by the keyboard. Clock’s falling edge indicates that the DATA signal contains a valid bit state.
  • DATA – data bit transmitted by the keyboard.
  • READY/ACK – signal set by the PC, when high, keyboard can send the data to the PC. Upon boot, this signal is initially low and goes high during BIOS initialisation. It is not clear whether PC can use this signal in any point in time, to indicate that it is not capable of receiving data and to stop the keyboard from sending it. PC seems to be using it in repeatable points in time, which looks like it acknowledges reception of data sequences from the keyboard. On the other hand, if we remove the signal from the keyboard, the keyboard still seems to operate correctly. It is also not clear why the signal has always the form as presented on the picture below. More investigation is needed.

SDS00009

Communication

When READY/ACK signal from the PC is high, the keyboard can transmit data to the PC serially, using DATA signal and strobing the data with CLOCK signal (at its falling edge). The transmission speed is about 24450 bits per second. There are 3 different types of data sequences transmitted:

  • Initialisation sequence – sent by the keyboard after boot
  • Scan code sequence – for most of the keys there is 1 byte transmitted per key, but some keys transmit 2, 4 or 6 bytes at once. A single byte is transmitted using 11 bits of data.
  • LED status sequence – sent following a scan code for a key that has a LED status.

After one byte of a scan code is transmitted, the PC sends a READY/ACK signal to the keyboard. When this signal is low, keyboard will not transmit subsequent data, waiting for it to become high.

SDS00005

Initialisation sequence

After the PC and keyboard are powered on, READY/ACK signal is low. During BIOS initialisation, PC sets this signal high. As a response, the keyboard transmits two sequences of 33 and 22 bits to the PC:

010100010110011110011110111110101
0000000000110111110101

The meaning and purpose of these sequences are not known.

SDS00012

Scan code sequence

A key press on the keyboard results in sending a scan code sequence to the PC. Most of the keys generate 1 byte of code. A byte is transmitted as 2 opening bits (always 1), 8 bits of the code and 1 closing bit (always 1) – a total of 11 bits.

SDS00004

Some keys generate more than 1 byte of code. ALT GR, right CTRL, keypad divide and keypad ENTER generate 2 bytes. Print screen, Break, Page Up/Down, Home, End, Insert, Delete and cursor keys generate 4 bytes. Pause generates 6 bytes.

SDS00007

LED status sequence

A scan code for a key with LED (CAPS LOCK, NUM LOCK, SCROLL LOCK) is always immediately followed by the current status of all three LEDs. The status is encoded using two 22-bit sequences:

0011101101110111100000
0000000CNS110111110101

The status of LEDs is put into bits indicates as C,N,S. The purpose of all other bits is not clear.

SDS00006

All scan codes

amstrad-2386-3386-keyboard-scan-codes.png

5 thoughts on “Amstrad 2386 Keyboard

  1. Good job! I’ve the service manual of Service Manual Amstrad PC2386-65 (first revision). There are some additional information about it that I could scan for you to publicate it.

    I’m actually repairing the power supply of an old PC2386, but I think that this keyboard is compatible also with models PC2286 and PC3286, as observed in service manuals of PC2286/PC2386 models.

    Like

  2. Hello,

    I have a keyboard from a PC4386SX. I’ve seen your article, asumed that the keyboard could be similar to the one in the article, and I tried to replace the 240 5 pin din with a USB. Power to power, ground to ground and the other 2: Data – and Data +, using different combinations of DATA, CLOCK and ACK. I couldn’t make it work. I have no clue about electronics. Could you please tell me if there is a way to use such a keyboard with todays computers? Do you know where I can find additional information on how to do it?

    Thank you for article, despite I can’t hardly follow it.

    Regards

    Like

    1. Hi. You can’t connects USB to anything other than USB without an active adapter. These interfaces just are completely different. To hook that keyboard up to a modern PC we would need some device that would translate between the both protocols. To my knowledge, unfortunatelly, no such device exists for this keyboard.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s