logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

readme.md (2501B)


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