Skip to content

Soarer's Converter

hasu@tmk edited this page Mar 25, 2020 · 21 revisions

Discussion Threads

Wiring

Connector	Breakout board
------------------------------
GND	        GND
Vcc/+5V	        VCC
Data	        PD0
Clock	        PD1
Keyboard Reset 	PB7

Reset is needed for some of XT keyboards likes IBM XT Type-1, Zenith Z-150 and Leading Edge. https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol#keyboard-hard-reset

For Reset Pro Micro users need to use modified version firmware because Pro Micro has no pin for PB7. https://deskthority.net/viewtopic.php?p=187874#p187874

Diagnostic Output

The converter outputs some cryptic diagnostic information when in use - it's especially useful to see what is happening when it starts up.

The hid_listen program (from PJRC) can display this output, which mostly just consists of bytes read from and written to the keyboard when things are working correctly.

Most of the output takes the form of a prefix code, followed by a hex value, followed by a space. For example, 'r4A '.

Prefix	Description
r	byte read from keyboard
w	byte written to keyboard
R	read error
W	write error
+	HID code output from first translation stage (for key-press)
-	HID code output from first translation stage (for key-release)
d	HID code output (for key-press) v1.03+
u	HID code output (for key-release) v1.03+

Error codes

Code	Error	Description
R03	unknown	something bad happened!
R04	clock	missed one edge of the clock signal, usually because of a short spike
R05	timeout	started receiving clock from the board, but didn't receive enough for a full code
R06	start bit	read a start bit, but it was incorrect
R07	parity bit	failed to correctly read a parity bit
R08	stop bit	failed to correctly read a stop bit
W005	timeout	timeout while writing a command to the keyboard
W105	timeout	timeout while writing the first byte of a 2-byte command
W205	timeout	timeout while writing the second byte of a 2-byte command

XT Protocol

This is my wild guess and sepeculation for how it works.

The converter will have to use ISR at falling edge of clock line to support both AT and XT protocol. For AT signal it reads data line just after the interrupt, while it may wait for rising edge of clock and then read for XT signal.

Note: In XT protocol data line should be read at falling edge of clock for legitimate implementation. https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol

Leading Edge DC-2014

The covnerter had had problem with Leading Edge DC-2014 XT keyboard until it was fixed at v1.10. Period between falling and rising edge on the keyboard is very short and the converter could have missed the rising edge until then.

https://geekhack.org/index.php?topic=17458.msg701240#msg701240

Lynk 122-key Terminal

This keyboard doesn't work with (v1.10-)v1.12 and does with v1.03.

https://geekhack.org/index.php?topic=62168.msg1469995#msg1469995

The fix at v1.10 for Leading Edge DC-2014 causes this probably. Lynk low part period of clock is a little longer than IBM XT and much longer than Leading Edge at the last clock in particular.

My guess is that v1.10 fix shortened waiting time for rising edge and the converter doesn't wait enough for Lynx slow clock since then. In the result the converter misses rising edge of (the last) clock of Lynk.

https://geekhack.org/index.php?topic=62168.msg1469706#msg1469706

Release History

v1.12  Added workaround for Linux kernel v3.x bug which causes Delete key not to repeat
v1.11  Added support for IBM RT keyboard
       Added display of boot mode state by making converter lock LEDs glow dimly.
       Added extra error codes to help determine where timeouts occur more precisely.
       Prevented debug and rawhid output when keyboard_protocol is not set (i.e. in BIOS mode).
v1.10  Added support for 'almost' PC/XT protocol keyboards, e.g. Leading Edge DC-2014
       Added Keyboard Reset output (required by some PC/XT keyboards).
       Added five auxiliary key inputs (for extra keys, buttons, or footswitches)
       Updated and expanded documentation generally, and added GH and DT Thread Contents pages and History page.
Fixed error LED timeout so it now stays on for 3 seconds after an error instead of flickering.
v1.03  Fixed bug which caused the converter to lose config or reboot after using the scrd tool.
       Fixed minor USB errors revealed by using the Command Verifier compliance testing tool.
       Added debug print of final output HID codes.
v1.02  Fixed bug which could cause the converter to lock up if a key was pressed at certain times during system boot
v1.01  Fixed bug in jump to bootloader affecting Teensy++
v1.0   Added jump to bootloader function, triggered by a macro or a command line tool
       Added scboot tool to jump to bootloader.
       Added scinfo tool to display version and memory use.
       Added tools built for Linux and Mac OS-X.
       Improved reliability of the settings protocol.
       Reduced memory use when not using onbreak macros and/or not using layers.
       Reduced hex size, allowing use of CPUs with only 16kB of flash.
       Added documentation.
v0.997 Added user-definable remaps, macros, layers, selects, media keys, and config tools
v0.996 Fixed 'slow' responding keyboards.
       Improved robustness when keys are being pressed before init has completed.
       Added alternative layouts for terminal keyboards
v0.995 Fixed missing 122-key mapping (top right numpad key is 'pause').
       Simplified the code testing which keyboard type is attached.
v0.994 Added suspend support, with remote wake-up
v0.992 Fixed minor incompatibility with Linux (backslash key not repeating etc.)
v0.99  First public release

Simple Logic Analyzer

https://deskthority.net/viewtopic.php?f=7&t=4567

Clone this wiki locally