qmk-firmware/keyboards/converter/sun_usb
Ryan 5629ba1807
Remove legacy keycodes, part 4 (#18683)
* `KC_PGDOWN` -> `KC_PGDN`

* `KC_PSCREEN` -> `KC_PSCR`

* `KC_SCOLON` -> `KC_SCLN`

* `KC_BSLASH` -> `KC_BSLS`

* `KC_BSPACE` -> `KC_BSPC`
2022-10-13 18:28:14 +01:00
..
type3 Remove legacy keycodes, part 4 (#18683) 2022-10-13 18:28:14 +01:00
type5 Remove legacy international keycodes (#18588) 2022-10-09 14:51:09 +11:00
.noci Initial list of keyboards to exclude from CI (#11213) 2020-12-21 15:38:39 +01:00
command_extra.c Remove legacy keycodes, part 4 (#18683) 2022-10-13 18:28:14 +01:00
config.h Move keyboard USB IDs and strings to data driven, pass 2: B-C (#17945) 2022-08-14 12:16:16 +10:00
info.json Move keyboard USB IDs and strings to data driven, pass 2: B-C (#17945) 2022-08-14 12:16:16 +10:00
led.c Migrate serial_uart usages to UART driver (#15479) 2021-12-15 11:00:39 +00:00
matrix.c Remove matrix_key_count() (#16603) 2022-03-10 12:18:07 +00:00
readme.md Modified URLs to point to new locations 2019-01-13 09:11:18 -08:00
rules.mk Migrate serial_uart usages to UART driver (#15479) 2021-12-15 11:00:39 +00:00

Sun to USB keyboard protocol converter

A converter for using non-USB Sun keyboards.

Original code from the TMK firmware. Ported to QMK by Yann Hodique.

Keyboard Maintainer: Yann Hodique
Hardware Supported: See hardware section below
Hardware Availability: self-built

Make example for this keyboard (after setting up your build environment):

make converter/sun_usb/type5:default

See build environment setup then the make instructions for more information.

Hardware

Target MCU is ATMega32u4 but other USB capable AVR will also work. The maintainer mostly uses Teensy 2.0 boards. Supported keyboards: Sun Type 3 and 5 Keyboards,

Connector

8Pin mini DIN

   ___ ___
  /  |_|  \
 / 8  7  6 \
| 5    4  3 |
 \_ 2   1 _/
   \_____/
(receptacle)

Wiring:

Pin mini DIN        MCU
----------------------------------
1   GND             GND
2   GND             GND
3   5V
4   RX/TX(Mouse)
5   RX              PD3
6   TX              PD2
7   GND             GND
8   5V              VCC

Protocol

Signal: Asynchronous, Negative logic, 1200baud, No Flow control
Frame format: 1-Start bit, 8-Data bits, No-Parity, 1-Stop bit

AVR USART engine expects positive logic while Sun keyboard signal is negative.
To use AVR UART engine you need external inverter in front of RX and TX pin.
Otherwise you can software serial routine to communicate the keyboard.

This converter uses software method, you doesn't need any inverter part.

Commands From System To Keyboard

0x01 Reset
        Keyboard responds with following byte sequence:
        Success: 0xFF 0x04 0x7F
        Fail:    0x7E 0x01 0x7F
0x02 Bell On
0x03 Bell Off
0x0A Click On
0x0B Click Off
0x0E LED
        followed by LED status byte:
        bit: 3       2       1       0
        LED: CapsLk  ScrLk   Compose NumLk
0x0F Layout
        Keyboard responds with 'Layout Response' 0xFE 0xXX

Commands From Keyboard To System

0x7F Idle
        means no keys pressed.
0xFE Layout Response
0xFF Reset Response(followed by 0x04)

References