You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

README 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Sun to USB keyboard protocol converter
  2. ======================================
  3. Target MCU is ATMega32u4 but other USB capable AVR will also work.
  4. Supported keyboards: Sun Type 5 Keyboard, CTCSP SHORT TYPE KEYBOARD(CKUB)
  5. CTCSP SHORT TYPE KEYBOARD: http://imgur.com/a/QIv6p
  6. Connector
  7. ---------
  8. 8Pin mini DIN
  9. ___ ___
  10. / |_| \
  11. / 8 7 6 \
  12. | 5 4 3 |
  13. \_ 2 1 _/
  14. \_____/
  15. (receptacle)
  16. Wiring:
  17. Pin mini DIN MCU
  18. ----------------------------------
  19. 1 GND GND
  20. 2 GND GND
  21. 3 5V
  22. 4 RX/TX(Mouse)
  23. 5 RX PD3
  24. 6 TX PD2
  25. 7 GND GND
  26. 8 5V VCC
  27. Protocol
  28. --------
  29. Singnal: Asynchronous, Negative logic, 1200baud, No Flow control
  30. Frame format: 1-Start bit, 8-Data bits, No-Parity, 1-Stop bit
  31. AVR USART engine expects positive logic while Sun keyboard signal is negative.
  32. To use AVR UART engine you need exteral inverter in front of RX and TX pin.
  33. Otherwise you can software serial routine to communicate the keyboard.
  34. This converter uses software method, you doesn't need any inverter part.
  35. Commands From System To Keyboard
  36. 0x01 Reset
  37. Keyboard responds with following byte sequence:
  38. Success: 0xFF 0x04 0x7F
  39. Fail: 0x7E 0x01 0x7F
  40. 0x02 Bell On
  41. 0x03 Bell Off
  42. 0x0A Click On
  43. 0x0B Click Off
  44. 0x0E LED
  45. followed by LED status byte:
  46. bit: 3 2 1 0
  47. LED: CapsLk ScrLk Compose NumLk
  48. 0x0F Layout
  49. Keyboard responds with 'Layout Response' 0xFE 0xXX
  50. Commands From Keyboard To System
  51. 0x7F Idle
  52. means no keys pressed.
  53. 0xFE Layout Response
  54. 0xFF Reset Response(followed by 0x04)
  55. Reference
  56. http://kentie.net/article/sunkbd/page2.htm
  57. http://kentie.net/article/sunkbd/KBD.pdf
  58. Build Firmware
  59. --------------
  60. Just use 'make'
  61. $ cd sun_usb
  62. $ make
  63. Then, load the binary to MCU with your favorite programmer.