]> git.donarmstrong.com Git - qmk_firmware.git/blob - FAQ.md
159959e33711d7de4b864236b3bfd0e483e37d29
[qmk_firmware.git] / FAQ.md
1 ## READ FIRST\r
2 - **README** of top directory : https://github.com/tmk/tmk_keyboard/blob/master/README.md\r
3 - **README** of target project(keyboard/converter) directory.\r
4 \r
5 Note that you'll need to read **both**.\r
6 \r
7 \r
8 # Build\r
9 - [[FAQ/Build]]\r
10 \r
11 \r
12 # Keymap\r
13 - [[FAQ/Keymap]]\r
14 \r
15 \r
16 # Debug Console\r
17 ## hid_listen can't recognize device\r
18 When debug console of your device is not ready you will see like this:\r
19 \r
20     Waiting for device:.........\r
21 \r
22 once the device is pluged in then *hid_listen* finds it you will get this message:\r
23 \r
24     Waiting for new device:.........................\r
25     Listening:\r
26 \r
27 Check if you can't get this 'Listening:' message:\r
28 - build with `CONSOLE_ENABLE=yes` in **Makefile**.\r
29 \r
30 ## Can't get message on console\r
31 Check:\r
32 - *hid_listen* finds your device. See above.\r
33 - Enable debug with pressing **Magic**+d. See [Magic Commands](https://github.com/tmk/tmk_keyboard#magic-commands).\r
34 - set `debug_enable=yes` usually in `matrix_init()` in **matrix.c**.\r
35 - try using 'print' function instead of debug print. See **common/print.h**.\r
36 - disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).\r
37 \r
38 ## Linux or UNIX like system requires Super User privilege\r
39 Just use 'sudo' to execute *hid_listen* with privilege.\r
40 ```\r
41 $ sudo hid_listen\r
42 ```\r
43 \r
44 Or add an *udev rule* for TMK devices with placing a file in rules directory. The directory may vary on each system.\r
45 \r
46 File: /etc/udev/rules.d/52-tmk-keyboard.rules(in case of Ubuntu)\r
47 ```\r
48 # tmk keyboard products     https://github.com/tmk/tmk_keyboard\r
49 SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"\r
50 ```\r
51 \r
52 ***\r
53 \r
54 # Miscellaneous\r
55 ## NKRO Doesn't work\r
56 First you have to compile frimware with this build option `NKRO_ENABLE` in **Makefile**.\r
57 \r
58 Try `Magic` **N** command(`LShift+RShift+N` by default) when **NKRO** still doesn't work. You can use this command to toggle between **NKRO** and **6KRO** mode temporarily. In some situations **NKRO** doesn't work you need to switch to **6KRO** mode, in particular when you are in BIOS.\r
59 \r
60 If your firmeare built with `BOOTMAGIC_ENABLE` you need to turn its switch on by `BootMagic` **N** command(`Space+N` by default). This setting is stored in EEPROM and keeped over power cycles.\r
61 \r
62 https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch\r
63 \r
64 \r
65 ## TrackPoint needs reset circuit(PS/2 mouse support)\r
66 Without reset circuit you will have inconsistent reuslt due to improper initialize of the hardware. See circuit schematic of TPM754.\r
67 \r
68 - http://geekhack.org/index.php?topic=50176.msg1127447#msg1127447\r
69 - http://www.mikrocontroller.net/attachment/52583/tpm754.pdf\r
70 \r
71 \r
72 ## Can't read comlumn of matrix beyond 16 \r
73 Use `1UL<<16` intead of `1<<16` in `read_cols()` in **matrix.h** when your columns goes beyond 16.\r
74 \r
75 In C `1` means one of **int** type which is **16bit** in case of AVR so you can't shift left more than 15. You will get unexpected zero when you say `1<<16`. You have to use **unsigned long** type with `1UL`.\r
76 \r
77 http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279\r
78 \r
79 \r
80 \r
81 ## Pull-up Resistor\r
82 In some case converters needed to have pull-up resistors to work correctly. Place the resistor between VCC and signal line in parallel.\r
83 \r
84 For example:\r
85 ```\r
86 Keyboard       Conveter\r
87                ,------.\r
88 5V------+------|VCC   |\r
89         |      |      |\r
90         R      |      |\r
91         |      |      |\r
92 Signal--+------|PD0   |\r
93                |      |\r
94 GND------------|GND   |\r
95                `------'\r
96 R: 1K Ohm resistor\r
97 ```\r
98 \r
99 https://github.com/tmk/tmk_keyboard/issues/71\r
100 \r
101 \r
102 ## Arduino Micro's pin naming is confusing\r
103 Note that Arduino Micro PCB marking is different from real AVR port name. D0 of Arduino Micro is not PD0, PD0 is D3. Check schematic yourself.\r
104 http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf\r
105 \r
106 \r
107 \r
108 ## Bootloader jump doesn't work\r
109 Properly configure bootloader size in **Makefile**. With wrong section size bootloader won't probably start with **Magic command** and **Boot Magic**.\r
110 ```\r
111 # Size of Bootloaders in bytes:\r
112 #   Atmel DFU loader(ATmega32U4)   4096    \r
113 #   Atmel DFU loader(AT90USB128)   8192    \r
114 #   LUFA bootloader(ATmega32U4)    4096             \r
115 #   Arduino Caterina(ATmega32U4)   4096             \r
116 #   USBaspLoader(ATmega***)        2048             \r
117 #   Teensy   halfKay(ATmega32U4)   512              \r
118 #   Teensy++ halfKay(AT90USB128)   1024\r
119 OPT_DEFS += -DBOOTLOADER_SIZE=4096\r
120 ```\r
121 AVR Boot section size are defined by setting **BOOTSZ** fuse in fact. Consult with your MCU datasheet.\r
122 Note that **Word**(2 bytes) size and address are used in datasheet while TMK uses **Byte**.\r
123 \r
124 AVR Boot section is located at end of Flash memory like the followings.\r
125 ```\r
126 byte     Atmel/LUFA(ATMega32u4)          byte     Atmel(AT90SUB1286)\r
127 0x0000   +---------------+               0x00000  +---------------+\r
128          |               |                        |               |\r
129          |               |                        |               |\r
130          |  Application  |                        |  Application  |\r
131          |               |                        |               | \r
132          =               =                        =               =\r
133          |               | 32KB-4KB               |               | 128KB-8KB\r
134 0x6000   +---------------+               0x1FC00  +---------------+\r
135          |  Bootloader   | 4KB                    |  Bootloader   | 8KB\r
136 0x7FFF   +---------------+               0x1FFFF  +---------------+\r
137 \r
138  \r
139 byte     Teensy(ATMega32u4)              byte     Teensy++(AT90SUB1286)\r
140 0x0000   +---------------+               0x00000  +---------------+\r
141          |               |                        |               |\r
142          |               |                        |               |\r
143          |  Application  |                        |  Application  |\r
144          |               |                        |               |\r
145          =               =                        =               =\r
146          |               | 32KB-512B              |               | 128KB-1KB\r
147 0x7E00   +---------------+               0x1FC00  +---------------+\r
148          |  Bootloader   | 512B                   |  Bootloader   | 1KB\r
149 0x7FFF   +---------------+               0x1FFFF  +---------------+\r
150 ```\r
151 \r
152 And see this discussion for further reference.\r
153 https://github.com/tmk/tmk_keyboard/issues/179\r
154 \r
155 \r
156 ## Special Extra key doesn't work(System, Audio control keys)\r
157 You need to define `EXTRAKEY_ENABLE` in **makefile** to use them in TMK.\r
158 ```\r
159 EXTRAKEY_ENABLE = yes          # Audio control and System control\r
160 ```\r
161 http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-60.html#p157919\r
162 \r
163 \r
164 ## Wakeup from sleep doesn't work\r
165 In Windows check `Allow this device to wake the computer` setting in Power **Management property** tab of **Device Manager**. Also check BIOS setting.\r
166 \r
167 Pressing any key during sleep should wake host.\r
168 \r
169 \r
170 ## Using Arduino?\r
171 **Note that Arduino pin naming is different from actual chip.** For example, Arduino pin `D0` is not `PD0`. Check circuit with its schematics yourself.\r
172 \r
173 - http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf\r
174 - http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf\r
175 \r
176 Arduino leonardo and micro have **ATMega32U4** and can be used for TMK, though Arduino bootloader may be a problem.\r
177 \r
178 \r
179 ## Using PF4-7 pins of USB AVR?\r
180 You need to set JTD bit of MCUCR yourself to use PF4-7 as GPIO. Those pins are configured to serve JTAG function by default. MCUs like ATMega*U* or AT90USB* are affeteced with this.\r
181 \r
182 If you are using Teensy this isn't needed. Teensy is shipped with JTAGEN fuse bit unprogrammed to disable the function.\r
183 \r
184 See this code.\r
185 ```\r
186     // JTAG disable for PORT F. write JTD bit twice within four cycles.\r
187     MCUCR |= (1<<JTD);\r
188     MCUCR |= (1<<JTD);\r
189 ```\r
190 https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hbkb/matrix.c#L67\r
191 \r
192 And read **26.5.1 MCU Control Register – MCUCR** of ATMega32U4 datasheet.\r
193 \r
194 \r
195 ## Adding LED indicators of Lock keys\r
196 You need your own LED indicators for CapsLock, ScrollLock and NumLock? See this post.\r
197 \r
198 http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p191560\r
199 \r
200 ## Program Arduino Micro/Leonardo\r
201 Push reset button and then run command like this within 8 seconds.\r
202 \r
203 ```\r
204 avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:adb_usb.hex -P/dev/ttyACM0\r
205 ```\r
206 \r
207 Device name will vary depending on your system.\r
208 \r
209 http://arduino.cc/en/Main/ArduinoBoardMicro\r
210 https://geekhack.org/index.php?topic=14290.msg1563867#msg1563867