Keyboard firmwares for Atmel AVR and Cortex-M
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Sun to USB keyboard protocol converter
  2. ======================================
  3. Target MCU is ATMega32u4 but other USB capable AVR will also work.
  4. This converter will work with Sun Type 2-5 Keyboards.
  5. Tested on:
  6. Sun Type 3 Keyboard: http://blog.daveastels.com.s3-website-us-west-2.amazonaws.com/2014/12/27/type-3-keyboard.html
  7. CTCSP SHORT TYPE KEYBOARD(Type 5): http://imgur.com/a/QIv6p
  8. Keymap of Type 3(keymap_sun3.c) were impoted from dastels's repository.
  9. https://github.com/dastels/tmk_keyboard/tree/master/converter/sun3_usb
  10. Connector
  11. ---------
  12. 8Pin mini DIN
  13. ___ ___
  14. / |_| \
  15. / 8 7 6 \
  16. | 5 4 3 |
  17. \_ 2 1 _/
  18. \_____/
  19. (receptacle)
  20. Wiring:
  21. Pin mini DIN MCU
  22. ----------------------------------
  23. 1 GND GND
  24. 2 GND GND
  25. 3 5V
  26. 4 RX/TX(Mouse)
  27. 5 RX PD3
  28. 6 TX PD2
  29. 7 GND GND
  30. 8 5V VCC
  31. Protocol
  32. --------
  33. Signal: Asynchronous, Negative logic, 1200baud, No Flow control
  34. Frame format: 1-Start bit, 8-Data bits, No-Parity, 1-Stop bit
  35. AVR USART engine expects positive logic while Sun keyboard signal is negative.
  36. To use AVR UART engine you need external inverter in front of RX and TX pin.
  37. Otherwise you can software serial routine to communicate the keyboard.
  38. This converter uses software method, you doesn't need any inverter part.
  39. Commands From System To Keyboard
  40. 0x01 Reset
  41. Keyboard responds with following byte sequence:
  42. Success: 0xFF 0x04 0x7F
  43. Fail: 0x7E 0x01 0x7F
  44. 0x02 Bell On
  45. 0x03 Bell Off
  46. 0x0A Click On
  47. 0x0B Click Off
  48. 0x0E LED
  49. followed by LED status byte:
  50. bit: 3 2 1 0
  51. LED: CapsLk ScrLk Compose NumLk
  52. 0x0F Layout
  53. Keyboard responds with 'Layout Response' 0xFE 0xXX
  54. Commands From Keyboard To System
  55. 0x7F Idle
  56. means no keys pressed.
  57. 0xFE Layout Response
  58. 0xFF Reset Response(followed by 0x04)
  59. Reference
  60. http://kentie.net/article/sunkbd/page2.htm
  61. http://kentie.net/article/sunkbd/KBD.pdf
  62. Build Firmware
  63. --------------
  64. Just use 'make'
  65. $ cd sun_usb
  66. $ make
  67. Then, load the binary to MCU with your favorite programmer.
  68. Sun commands
  69. ------------
  70. You can send Sun protocol commands with TMK `Magic` key combo. By default `Magic` key is `LShift` + `RShift`, `LAlt` + `RAlt' or `LMeta` + `RMeta`.
  71. https://github.com/tmk/tmk_keyboard#magic-commands
  72. Following Sun specific commands are available. For example, to send 'Bell On' you can press `LShift` + `RShift` + `Up` keys simultaneously.
  73. ```
  74. ----- Sun converter Help -----
  75. Up: Bell On
  76. Down: Bell Off
  77. Left: Click On
  78. Right: Click Off
  79. PgUp: LED all On
  80. PgDown: LED all On
  81. Insert: Layout
  82. Delete: Reset
  83. ```