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