Hey Redditors, I've been working on a custom keyboard for my [[publish/technolush/m103]] project, and I've run into blocker. So far, I've 3D printed the base, added switches and custom keycaps, hand-wired everything to a Pro Micro board, and successfully compiled and flashed a configuration. However, when I'm pressing the keys, I'm not getting what I expect. ### physical build + wiring ![[m103-help-front.png]] ^ 5 rows of keys (including 12 function keys at the top not yet installed in this photo) ![[m103-help-wiring.png]] ^ Wiring layout. Diodes are connected to the top left of each switch. Black end of diodes is on the lower end, and diode legs are soldered together all the way across horizontally. ![[m103-help-promicro.png]] ^ Pro Micro board Here is how I have the wires connected: | KB row | 1 Top | 2 | 3 | 4 | 5 Bottom | | ------------ | ----- | --- | --- | --- | -------- | | Board legend | 2 | 3 | 4 | 5 | 6 | | in QMK | D1 | D0 | D4 | C6 | D7 | (Note I've also tried it the other way, D7 C6 D4 D0 D1) | KB column | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | | ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | Board legend | A3 | A2 | A1 | A0 | 16 | 15 | 14 | 10 | TX0 | 9 | | | | Connection | F4 | F5 | F6 | F7 | B2 | B1 | B3 | B6 | D3 | B5 | B4 | E6 | ### programming I've installed QMK on my computer (Intel, Ubuntu) and am able to successfully compile and flash files onto my Pro Micro. Here are my files that I am compiling: keyboard.json: ``` { "keyboard_name": "m103", "manufacturer": "Bill Westerman", "url": "https://utilware.com/technolush/m103", "usb": { "vid": "0x1234", "pid": "0x5678", "device_version": "0.0.1" }, "diode_direction": "COL2ROW", "matrix_pins": { "rows": ["D7", "C6", "D4", "D0", "D1"], "cols": ["F4", "F5", "F6", "F7", "B2", "B1", "B3", "B6", "D3", "B5", "B4", "E6"] }, "processor": "atmega32u4", "bootloader": "caterina", "layouts": { "LAYOUT": { "layout": [ {"matrix": [0,0], "x":0, "y": 0 }, {"matrix": [0,1], "x":1, "y": 0 }, {"matrix": [0,2], "x":2, "y": 0 }, {"matrix": [0,3], "x":3, "y": 0 }, {"matrix": [0,4], "x":4, "y": 0 }, {"matrix": [0,5], "x":5, "y": 0 }, {"matrix": [0,6], "x":6, "y": 0 }, {"matrix": [0,7], "x":7, "y": 0 }, {"matrix": [0,8], "x":8, "y": 0 }, {"matrix": [0,9], "x":9, "y": 0 }, {"matrix": [0,10], "x":10, "y": 0 }, {"matrix": [0,11], "x":11, "y": 0 }, {"matrix": [1,0], "x":0, "y": 1 }, {"matrix": [1,1], "x":1, "y": 1 }, {"matrix": [1,2], "x":2, "y": 1 }, {"matrix": [1,3], "x":3, "y": 1 }, {"matrix": [1,4], "x":4, "y": 1 }, {"matrix": [1,5], "x":5, "y": 1 }, {"matrix": [1,6], "x":6, "y": 1 }, {"matrix": [1,7], "x":7, "y": 1 }, {"matrix": [1,8], "x":8, "y": 1 }, {"matrix": [1,9], "x":9, "y": 1 }, {"matrix": [1,10], "x":10, "y": 1 }, {"matrix": [1,11], "x":11, "y": 1 }, {"matrix": [2,0], "x":0, "y": 2 }, {"matrix": [2,1], "x":1, "y": 2 }, {"matrix": [2,2], "x":2, "y": 2 }, {"matrix": [2,3], "x":3, "y": 2 }, {"matrix": [2,4], "x":4, "y": 2 }, {"matrix": [2,5], "x":5, "y": 2 }, {"matrix": [2,6], "x":6, "y": 2 }, {"matrix": [2,7], "x":7, "y": 2 }, {"matrix": [2,8], "x":8, "y": 2 }, {"matrix": [2,9], "x":9, "y": 2 }, {"matrix": [2,10], "x":10, "y": 2 }, {"matrix": [2,11], "x":11, "y": 2 }, {"matrix": [3,0], "x":0, "y": 3 }, {"matrix": [3,1], "x":1, "y": 3 }, {"matrix": [3,2], "x":2, "y": 3 }, {"matrix": [3,3], "x":3, "y": 3 }, {"matrix": [3,4], "x":4, "y": 3 }, {"matrix": [3,5], "x":5, "y": 3 }, {"matrix": [3,6], "x":6, "y": 3 }, {"matrix": [3,7], "x":7, "y": 3 }, {"matrix": [3,8], "x":8, "y": 3 }, {"matrix": [3,9], "x":9, "y": 3 }, {"matrix": [3,10], "x":10, "y": 3 }, {"matrix": [3,11], "x":11, "y": 3 }, {"matrix": [4,0], "x":0, "y": 4 }, {"matrix": [4,1], "x":1, "y": 4 }, {"matrix": [4,2], "x":2, "y": 4 }, {"matrix": [4,3], "x":3, "y": 4 }, {"matrix": [4,4], "x":4, "y": 4 }, {"matrix": [4,5], "x":5, "y": 4 }, {"matrix": [4,6], "x":6, "y": 4 }, {"matrix": [4,7], "x":9, "y": 4 }, {"matrix": [4,8], "x":10, "y": 4 }, {"matrix": [4,9], "x":11, "y": 4 } ] } } } ``` keymap.c: ``` #include QMK_KEYBOARD_H // Define the keymap layout const uint16_t keymaps[][5][12] = { [0] = LAYOUT( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_ESCAPE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BACKSPACE, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, KC_LEFT_SHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_UP, KC_NO, KC_LEFT_CTRL, KC_LEFT_ALT, KC_LEFT_GUI, KC_NO, KC_NO, KC_SPACE, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT ) }; ``` These compile successfully with no errors: ``` $ qmk flash Ψ Compiling keymap with gmake -r -R -f builddefs/build_keyboard.mk -s flash KEYBOARD=m103 KEYMAP=default KEYBOARD_FILESAFE=m103 TARGET=m103_default VERBOSE=false COLOR=true SILENT=false QMK_BIN="qmk" Generating: .build/obj_m103_default/src/community_modules.c [OK] avr-gcc (GCC) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Size before: text data bss dec hex filename 0 13726 0 13726 359e m103_default.hex Generating: .build/obj_m103_default/src/info_config.h [OK] Generating: .build/obj_m103_default/src/community_modules.h [OK] Generating: .build/obj_m103_default/src/community_modules_introspection.c [OK] Generating: .build/obj_m103_default/src/community_modules_introspection.h [OK] Generating: .build/obj_m103_default/src/default_keyboard.c [OK] Generating: .build/obj_m103_default/src/default_keyboard.h [OK] Copying m103_default.hex to qmk_firmware folder [OK] Checking file size of m103_default.hex [OK] * The firmware size is fine - 13726/28672 (47%, 14946 bytes free) Flashing for bootloader: caterina Waiting for USB serial port - reset your controller now (Ctrl+C to cancel)................ Device /dev/ttyACM0 has appeared; assuming it is the controller. Waiting for /dev/ttyACM0 to become writable. avrdude: AVR device initialized and ready to accept instructions avrdude: device signature = 0x1e9587 (probably m32u4) avrdude: Note: flash memory has been specified, an erase cycle will be performed. To disable this feature, specify the -D option. avrdude: erasing chip avrdude: reading input file .build/m103_default.hex for flash with 13726 bytes in 1 section within [0, 0x359d] using 108 pages and 98 pad bytes avrdude: writing 13726 bytes flash ... Writing | ################################################## | 100% 1.07 s avrdude: 13726 bytes of flash written avrdude: verifying flash memory against .build/m103_default.hex Reading | ################################################## | 100% 0.13 s avrdude: 13726 bytes of flash verified avrdude done. Thank you. ``` ### the problem However, when I try to use the keyboard, here is what I get: | Pressing this key | Gives this result | | ------------------------------- | ------------------------------------- | | F1, F2, F10 | Ctrl Left + Shift Left + Alt Left | | Any key on row 2 (Esc thru Del) | Nothing | | Tab | Ctrl Left + Win | | A | b + Ctrl Right + Alt RIght | | ; | Alt Left | | Shift | Undefined + Win | | Z | Left Click + Ctrl Left | | X | b + Ctrl Left + Shift Left + Alt Left | | C | v | | B | Capital R | | Up arrow | Ctrl Left + Alt Left | | CAP \* | Capital E + Ctrl Right + Win | | Ctrl | b + Ctrl Left | | Alt | Capital F + Shift Left + Alt Left | | Super | Ctrl Left | | IZQa | b + Ctrl Left + Shift Left + Alt Left | | Spacebar | Capital R | | DERa | Win | | Left arrow | Undefined + Ctrl Left | | Down arrow | Left Click + Left Shift \*\* | | Right arrow | Ctrl Left | \* Note: "CAP" means "Capture", not "Capital", and is not used for shifting to uppercase \*\* This also appears to do "volume down" What am I doing wrong?