PS/2 Encoder interfaces industry standard PS/2 PC-compatible keyboards to devices requiring TTL-level RS232 or parallel data signaling. All ASCII key sequences are decoded, as well as common keyboard sequences like “CTRL-ALT-DEL”. To provide maximum flexibility for various uses while retaining ease of operation, the unit’s configuration can be modified in-circuit using the PS/2 keyboard itself.
The PS/2 Encoder can be purchased as a bare PCB, minimal kit (PCB, uC only), full kit with DIP 24 pin header, full kit with 2×12 IDC header, or assembled with either type of connector.
- A PS/2 compatible keyboard (USB keyboards with PS/2 converters may not work) with a Mini-DIN6 plug.
- Regulated 5VDC Power source.
- For RS232 operation, a TTL to RS232 level converter.
PS/2 Encoder models can be purchased at the RETRO Innovations Online Store.
PS/2 Encoder consists of an Atmel ATMEGA88 AVR microcontroller and associated connectors. GPLv2 licensed C application reads data from a PS/2 compliant keyboard, converting PS/2 scan codes into ASCII values that are presented via an 8-bit parallel and 5V RS232 connections. The PCB features include:
- Supports 24 pin .6″ IC socket connection as well as 2×12 header connection.
- Crystal footprint included on PCB
- PS/2 connector footprint included on PCB
- Through hole design makes “do-it-yourself” construction easy.
Bill of Materials
|X1||Mini-DIN6 PS/2 Connector|
|R1||10K 1/8W resistor|
|IC1||Atmel ATMEGA48/88/128/328 uC|
|C1,C2||18pF ceramic capacitor|
|C3||.1uF ceramic capacitor|
|SV1||DIP24 IC header|
|SV2||2×12 breakaway header|
|CONFIG||1×2 .1″ breakaway header|
- Populate and trim C1,C2,C3
- Populate and trip R1
- Populate IC1 with socket if desired
- Populate and trim Q1
- If SV1 desired, populate on bottom of PCB
- If SV2 desired, populate from top of PCB
- Populate X1
- (Optional) populate CONFIG or simply solder pads
|IC pin||IDC pin||Description|
- Connect VCC to regulated +5VDC
- Connect GROUND to appropriate ground line.
- Data connection
- For parallel operation, connect D0-7 and STROBE to appropriate parallel keyboard input lines.
- For serial operation, connect keyboard 5V SND line to PS/2 Encoder RS232 Receive pin, and keyboard 5V RCV line to PS/2 Encoder RS232 Send pin.
- If desired, /INTERRUPT can be connected to active low wired-or IRQ line on target system.
- Apply power to system
Configuration mode can only be accessed when the CONFIG jumper is present (or the pins are otherwise connected). To enter configuration mode, hold CTRL and ALT and press the Backspace key on the keyboard. Once in configuration mode, only certain keys will respond to keypresses:
|Shift + ENTER||ENTER will send CRLF|
|&||Set RS232 to 7-bit data length|
|*||Set RS232 to 8-bit data length|
|T||Increase inter-character delay|
|R||Increase keyboard typematic rate|
|D||Increase keyboard typematic delay|
|S||Increase oscillator speed (on units without crystal)|
|ENTER||ENTER will send CR only|
|t||Decrease inter-character delay|
|r||Decrease keyboard typematic rate|
|d||Decrease keyboard typematic delay|
|s||Decrease oscillator speed (on units without crystal)|
|l||Set STROBE as active-low|
|h||Set STROBE as active-high|
|0||Set RS232 to 110bps|
|1||Set RS232 to 300bps|
|2||Set RS232 to 600bps|
|3||Set RS232 to 1200bps|
|4||Set RS232 to 2400bps|
|5||Set RS232 to 4800bps|
|6||Set RS232 to 9600bps|
|7||Set RS232 to 19200bps|
|8||Set RS232 to 38400bps|
|9||Set RS232 to 57600bps|
|o||Set RS232 to ODD parity|
|e||Set RS232 to EVEN parity|
|n||Set RS232 to NONE parity|
|Backspace||BS sends Backspace|
|Delete||Backspace sends Delete|
|p||Print current configuration|
|w||Save current configuration|
Once the desired configuration is set, pressing ‘w’ will save the settings, and CTRL+ALT+BS will exit configuration mode and apply the new settings. If configuration mode is exitted without saving, settings will last only until power is removed.
Source code and EAGLE schematics/PCB files will be available shortly.
- Add functionality for C0,B0-2,/AUX
- Add support for /INTERRUPT line
- Add Support for various escape sequences