My goal is to have a keyboard interface that would enable the use of a USB keyboard with a Kaypro computer. The Interface will allow input from a USB Keyboard and communicate via TTL serial (transistor-transistor logic) through the J2 serial interface using the (rj9) connection on the back of the Kaypro (4 wire, 300 baud interface).
While 300 baud may seem somewhat slow, it is equivalent to 30 characters per second, which is faster than I can type.
I plan to use a Raspberry Pi Zero, with a USB Keyboard to interface to the Kaypro 10 via TTL.
Section of the Motherboard schematic for the rj9 keyboard cable connector. Kaypro utilized a (RJ9 / RJ10 / RJ22) 4p4C 28 gauge wire headset cord to connect the keyboard to the computer.
Notes:
- The Raspberry Pi 2 and Pi Zero (non wireless, non bluetooth) support 300 baud for the serial TTL using the PL011 UART. (May have a few in the parts bin)
- Another option would be an Arduino USB Shield on an Arduino Mega 2560 to handle the translation.
- The USB Host - Keyboard to ASCII Converter by www.hobbytronics.co.uk, look interesting, but at a minimum will only do 1200 baud.
USB Keyboard Key to ASCII Translation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
Lock |
|
|
| ||||
|
|
|
|
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
|
|
Up | ||||||
|
|
|
|
|
|
|
|
|
| Num 8 |
Down | |||||
|
|
|
|
|
|
|
|
|
|
| Arrow | |||||
|
|
|
|
|
|
|
|
|
|
|
Arrow | |||||
|
|
|
|
|
|
|
|
|
|
|
Arrow | |||||
|
|
|
|
|
|
|
|
LFTWIN |
LFTWIN |
|
| Arrow | ||||
|
|
|
|
|
|
|
|
RTWIN |
RTWIN |
|
|
Screen | ||||
|
|
|
|
|
|
|
|
|
| |||||||
|
|
|
|
|
|
|
|
|
|
| ||||||
|
|
|
|
|
|
|
| |||||||||
|
|
|
|
|
|
|
|
| ||||||||
|
|
|
|
|
|
|
| |||||||||
|
|
|
|
|
|
|
1. Blank Table entries indicate no output. 2. M - make code only (simulates "stuck" key); B - break code only (releases "stuck" key) 3. LCNT/RCNT - left/right control keys; LSHF/RSHF - left/right shift keys; LALT/RALT - left/right Alt keys; LFTWIN/RTWIN - left/right Windows keys. 4. NUM prefix denotes keys from NUM pad. 5. PRT SCR is Print Screen key. 6. WINAPP is Windows key. 7. Keys are specified by US English keyboard keycap legends. |
To use the table, find the key in the table, then read the code in hex from the column/row digits. The most significant hex digit is in the top row, the least significant is in the left column. For example, the @ sign will produce hex 40.
Codes beyond the standard ASCII table have been added to support keys found on the PC keyboard, but not in the ASCII character set. For instance, hex codes A0 to AB will be generated for the twelve function keys, F1 to F12.
The ASCII code is generated when a keyboard key is pressed. No code is generated when a key is released. The Alt and Control keys, both left and right, are an exception, as shown in the Table above. Separate codes are generated when one of these key is pressed, and when it is released. If the Shift key is held down, upper case ASCII characters, or characters, such as the @ sign, will be generated.
Top Comments