readme.md (2501B)
1 # Sun to USB keyboard protocol converter 2 3 A converter for using non-USB Sun keyboards. 4 5 Original code from the [TMK firmware](https://github.com/tmk/tmk_keyboard/tree/master/converter/sun_usb). Ported to QMK by [Yann Hodique](https://github.com/sigma). 6 7 Keyboard Maintainer: [Yann Hodique](https://github.com/sigma) 8 Hardware Supported: See hardware section below 9 Hardware Availability: self-built 10 11 Make example for this keyboard (after setting up your build environment): 12 13 make converter/sun_usb/type5:default 14 15 See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. 16 17 18 ## Hardware 19 20 Target MCU is ATMega32u4 but other USB capable AVR will also work. The maintainer mostly uses Teensy 2.0 boards. 21 Supported keyboards: Sun Type 3 and 5 Keyboards, 22 23 ### Connector 24 25 8Pin mini DIN 26 27 ___ ___ 28 / |_| \ 29 / 8 7 6 \ 30 | 5 4 3 | 31 \_ 2 1 _/ 32 \_____/ 33 (receptacle) 34 35 36 Wiring: 37 38 Pin mini DIN MCU 39 ---------------------------------- 40 1 GND GND 41 2 GND GND 42 3 5V 43 4 RX/TX(Mouse) 44 5 RX PD3 45 6 TX PD2 46 7 GND GND 47 8 5V VCC 48 49 50 ### Protocol 51 52 Signal: Asynchronous, Negative logic, 1200baud, No Flow control 53 Frame format: 1-Start bit, 8-Data bits, No-Parity, 1-Stop bit 54 55 AVR USART engine expects positive logic while Sun keyboard signal is negative. 56 To use AVR UART engine you need external inverter in front of RX and TX pin. 57 Otherwise you can software serial routine to communicate the keyboard. 58 59 This converter uses software method, you doesn't need any inverter part. 60 61 62 Commands From System To Keyboard 63 64 0x01 Reset 65 Keyboard responds with following byte sequence: 66 Success: 0xFF 0x04 0x7F 67 Fail: 0x7E 0x01 0x7F 68 0x02 Bell On 69 0x03 Bell Off 70 0x0A Click On 71 0x0B Click Off 72 0x0E LED 73 followed by LED status byte: 74 bit: 3 2 1 0 75 LED: CapsLk ScrLk Compose NumLk 76 0x0F Layout 77 Keyboard responds with 'Layout Response' 0xFE 0xXX 78 79 Commands From Keyboard To System 80 81 0x7F Idle 82 means no keys pressed. 83 0xFE Layout Response 84 0xFF Reset Response(followed by 0x04) 85 86 References 87 88 * http://kentie.net/article/sunkbd/page2.htm 89 * http://kentie.net/article/sunkbd/KBD.pdf