How to build your very own keyboard firmware
-
- Location: Denmark
- Main keyboard: Toshiba Satellite Pro A120
- Main mouse: Logitech MX600
- DT Pro Member: -
Sorry no pics at the moment, all parts are scattered all over the place.
But I am building on a PC-MOD. Its a PC but it looks like a Laptop.
The last two pieces are about to get in place. Display and Keyboard.
But I am building on a PC-MOD. Its a PC but it looks like a Laptop.
The last two pieces are about to get in place. Display and Keyboard.
-
- Location: Centreville, VA
- Main keyboard: GON NerD 60
- Main mouse: Microsoft Intellimouse 3.0 Legends Edition
- Favorite switch: Cherry MX Black
- DT Pro Member: -
If I wanted to hand wire a numpad, could I just use the lightpad TMK firmware and use all of the same pins on a teensy? The Lightpad also uses ATmega32u4 right?
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Yes. (It's specified in Makefile.lufa in the lightpad directory.) (You can read off the pins used in matrix.c.)wes1099 wrote: ↑If I wanted to hand wire a numpad, could I just use the lightpad TMK firmware and use all of the same pins on a teensy? The Lightpad also uses ATmega32u4 right?
-
- Location: College
- Main keyboard: Cooler Master Quickfire rapid (Cherry MX Green)
- Main mouse: Mionix Avior SK
- Favorite switch: membrane for life
- DT Pro Member: -
Hey guys, Thanks for the help with this, all of you. I just wanted to show what I have so far, and hopefully I could inspire someone else to try. I have little to no experience with CAD software, and the code was very easy for me to change and modify to what I wanted.
The aperture on my phone is broken, so I apologize for the darkness of these images.
You can see the wires from the diodes are uncovered, but they do not contact the column wires (which are insulated by some sort of copper colored paint, so if they did contact, it would not matter any way. I took this insulation off the areas that I soldered to the switches). I am building a case for this as well, but for now (during testing) I am using motherboard standoffs. I also have a tip for anyone who is having trouble wiring the rows and columns to the teensy, you don't have to do it like I did, and send the wires to the end of each row/column you can hook them anywhere in that row/column. I just did it this way, and a lot of other people do too, because it was easier to trace the wires and figure out where they belong.
My Matrix (sorry about orientation)
Closer picture of matrix. You can also see my plate. It is aluminum that has been bead blasted in my college shop. I made the plate with a 1/16th inch end mill with help from some people from the Mech department at my school.
Here is image of my layout (or what it will be... also I just noticed the second "END" key... Will have to come up with something else to put there)The red outlined keys will be one color, and the green will be another. I am thinking Grey for the green section and a red for the red section. I have another design getting worked on right now, I will check back soon.
I will post more pictures, and update this post as time goes on, but this is what I have for now. Thanks for checking it out.
----------------NINJA EDIT----------------------------
This was originally a help request... I made very silly mistakes in code. I had b's where d's should have been.
The aperture on my phone is broken, so I apologize for the darkness of these images.
You can see the wires from the diodes are uncovered, but they do not contact the column wires (which are insulated by some sort of copper colored paint, so if they did contact, it would not matter any way. I took this insulation off the areas that I soldered to the switches). I am building a case for this as well, but for now (during testing) I am using motherboard standoffs. I also have a tip for anyone who is having trouble wiring the rows and columns to the teensy, you don't have to do it like I did, and send the wires to the end of each row/column you can hook them anywhere in that row/column. I just did it this way, and a lot of other people do too, because it was easier to trace the wires and figure out where they belong.
My Matrix (sorry about orientation)
Closer picture of matrix. You can also see my plate. It is aluminum that has been bead blasted in my college shop. I made the plate with a 1/16th inch end mill with help from some people from the Mech department at my school.
Here is image of my layout (or what it will be... also I just noticed the second "END" key... Will have to come up with something else to put there)The red outlined keys will be one color, and the green will be another. I am thinking Grey for the green section and a red for the red section. I have another design getting worked on right now, I will check back soon.
I will post more pictures, and update this post as time goes on, but this is what I have for now. Thanks for checking it out.
----------------NINJA EDIT----------------------------
This was originally a help request... I made very silly mistakes in code. I had b's where d's should have been.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Well, you had a couple of typos in your sources. I'm attaching the fixed sources, and the dir also contains the compiled hex file. Not sure that it'll do what you expect it to do - I didn't actually check the C code, apart from fixing the typos that generated compilation error. Feel free to ask if there's more problems.
- Attachments
-
- gh60.7z
- (25.06 KiB) Downloaded 154 times
-
- Location: Romania
- Main keyboard: K70 RGB
- DT Pro Member: -
Hey guys,
I'm trying to make a small keyboard but I'm stuck at making the firmware. For some reason I get this error when I run make -f makefile I've duble-triple checked all the code in the H60 folder but I don't seem to see any problem with it (considering that I mostly copy/paste-ed everyting....the tutorial was almost exactly with what I had in mind 15 columns and 5 rows. I've attached the files if someone is nice enough to look at them and/or just compile them. Also I have Windows 10 installed so I'm not sure if that's the problem considering that make.exe had it's last update some 5 years ago.
I'm trying to make a small keyboard but I'm stuck at making the firmware. For some reason I get this error when I run make -f makefile I've duble-triple checked all the code in the H60 folder but I don't seem to see any problem with it (considering that I mostly copy/paste-ed everyting....the tutorial was almost exactly with what I had in mind 15 columns and 5 rows. I've attached the files if someone is nice enough to look at them and/or just compile them. Also I have Windows 10 installed so I'm not sure if that's the problem considering that make.exe had it's last update some 5 years ago.
- joc
- Location: The Lone Star State
- Main keyboard: IBM F104 (Unsaver) || IBM SSK
- Main mouse: Logitech M570
- Favorite switch: IBM Beam Spring
- DT Pro Member: -
nexaddo@gmail.com wrote: ↑Hey guys,
I'm trying to make a small keyboard but I'm stuck at making the firmware. For some reason I get this error when I run make -f makefile
I've duble-triple checked all the code in the H60 folder but I don't seem to see any problem with it (considering that I mostly copy/paste-ed everyting....the tutorial was almost exactly with what I had in mind 15 columns and 5
I've attached the files if someone is nice enough to look at them and/or just compile them. Also I have Windows 10 installed so I'm not sure if that's the problem considering that make.exe had it's last update some 5 years ago.
Code: Select all
keymap_common.h:44:68: error: parameter name missing
Code: Select all
keymap_common.h:45:75: error: macro parameters must be comma-separated
Code: Select all
keymap_poker.c:25:1: error: expected '}' before 'RNS'
-
- Location: Romania
- Main keyboard: K70 RGB
- DT Pro Member: -
well....I feel stupid...there I was trying to make a boot-able linux stick (which I plan on doing anyway just to have it)....Thank you joc, it actually worked.
@gogusrl...nice to see other keyboard-obsessed Romanians
@gogusrl...nice to see other keyboard-obsessed Romanians
-
- Location: Israel
- Favorite switch: Cherry MX Clear
- DT Pro Member: -
Hey, I keep getting these errors on the cmd when I compile, even when I try to compile the gh60 right from the source.
I tried this on multiple computers, tried uninstalling and reinstalling WinAVR, tried different sources...
Nothing! I have Windows 10 x64 bits if that matters.
Does anyone know what I should do?
Code: Select all
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\kagan>cd C:\Users\kagan\Desktop\tmk_keyboard-master\keyboard\gh60
C:\Users\kagan\Desktop\tmk_keyboard-master\keyboard\gh60>make -f Makefile.pjrc
0 [main] sh 1604 sync_with_child: child 7596(0x170) died before initialization with status code 0xC0000142
618 [main] sh 1604 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 2904 sync_with_child: child 5440(0x1B0) died before initialization with status code 0xC0000142
347 [main] sh 2904 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 7480 sync_with_child: child 5996(0x1C) died before initialization with status code 0xC0000142
238 [main] sh 7480 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 1816 sync_with_child: child 5876(0x1B8) died before initialization with status code 0xC0000142
234 [main] sh 1816 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 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.
0 [main] sh 5400 sync_with_child: child 2940(0x104) died before initialization with status code 0xC0000142
222 [main] sh 5400 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
mkdir -p obj_gh60_pjrc
Compiling C: keymap_poker.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DPROTOCOL_PJRC -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DSLEEP_LED_ENABLE -DNO_SUSPEND_POWER_DOWN -DVERSION= -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_gh60_pjrc/keymap_poker.lst -I. -I../../tmk_core -I../../tmk_core/protocol/pjrc -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_gh60_pjrc_keymap_poker.o.d keymap_poker.c -o obj_gh60_pjrc/keymap_poker.o
keymap_poker.c:13: fatal error: opening dependency file .dep/obj_gh60_pjrc_keymap_poker.o.d: No such file or directory
compilation terminated.
make: *** [obj_gh60_pjrc/keymap_poker.o] Error 1
C:\Users\kagan\Desktop\tmk_keyboard-master\keyboard\gh60>
Nothing! I have Windows 10 x64 bits if that matters.
Does anyone know what I should do?
- Halvar
- Location: Baden, DE
- Main keyboard: IBM Model M SSK / Filco MT 2
- Favorite switch: Beam & buckling spring, Monterey, MX Brown
- DT Pro Member: 0051
Hi Tomer, welcome to DT!
Yes, that's a known problem. Solution is here:
http://www.avrfreaks.net/forum/windows- ... tion-error
Yes, that's a known problem. Solution is here:
http://www.avrfreaks.net/forum/windows- ... tion-error
-
- Location: Israel
- Favorite switch: Cherry MX Clear
- DT Pro Member: -
Hi Halvar, thank you for your welcome!Halvar wrote: ↑Hi Tomer, welcome to DT!
Yes, that's a known problem. Solution is here:
http://www.avrfreaks.net/forum/windows- ... tion-error
I tried the fix, and this is what I got:
Code: Select all
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\kagan>cd C:\Users\kagan\Documents\Keyboard Software\tmk_keyboard-master\keyboard\gh60
C:\Users\kagan\Documents\Keyboard Software\tmk_keyboard-master\keyboard\gh60>make -f Makefile.pjrc
/usr/bin/sh: dfu-programmer: command not found
/usr/bin/sh: dfu-programmer: command not found
-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 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.
mkdir -p obj_gh60_pjrc
Compiling C: keymap_poker.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DPROTOCOL_PJRC -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DSLEEP_LED_ENABLE -DNO_SUSPEND_POWER_DOWN -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_gh60_pjrc/keymap_poker.lst -I. -I../../tmk_core -I../../tmk_core/protocol/pjrc -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_gh60_pjrc_keymap_poker.o.d keymap_poker.c -o obj_gh60_pjrc/keymap_poker.o
keymap_poker.c:8: error: 'KC_F0' undeclared here (not in a function)
make: *** [obj_gh60_pjrc/keymap_poker.o] Error 1
C:\Users\kagan\Documents\Keyboard Software\tmk_keyboard-master\keyboard\gh60>
- Halvar
- Location: Baden, DE
- Main keyboard: IBM Model M SSK / Filco MT 2
- Favorite switch: Beam & buckling spring, Monterey, MX Brown
- DT Pro Member: 0051
Is that with the unchanged source?
The error message
keymap_poker.c:8: error: 'KC_F0' undeclared here (not in a function)
looks like a pretty normal error in your keymap_poker.c file. If this is your code and you don't find the error, post your poker.c file.
The error message
keymap_poker.c:8: error: 'KC_F0' undeclared here (not in a function)
looks like a pretty normal error in your keymap_poker.c file. If this is your code and you don't find the error, post your poker.c file.
-
- Location: Israel
- Favorite switch: Cherry MX Clear
- DT Pro Member: -
Hey Halvar, thanks for your quick response. I tried that with my own source. Here is my poker.c file:Halvar wrote: ↑Is that with the unchenged source?
The error message
keymap_poker.c:8: error: 'KC_F0' undeclared here (not in a function)
looks like a pretty normal error in your keymap_poker.c file. If this is your code and you don't find the error, post your poker.c file.
Code: Select all
#include "keymap_common.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty */
KEYMAP(ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, \
TAB, A, S, D, F, G, H, J, K, L, ENT, \
LSFT, Z, X, C, V, B, N, M, COMM,DOT, RSFT, \
LCTL, LALT,F0, F1, SPC, F2, WHOM,RCTL,SLSH),
/* 1: FN 1 */
KEYMAP(INS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DELETE, \
TRNS,TRNS,TRNS,TRNS,GRV, MINS, EQL, LBRC, RBRC, BSLS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, SCOLON, QUOT,TRNS,UP,TRNS, \
TRNS, TRNS,TRNS, TRNS, TRNS, TRNS, LEFT,DOWN,RIGHT),
/* 2: FN 2 */
KEYMAP(PSCR, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DELETE, \
CAPS,TRNS,TRNS,TRNS,GRV, MINS, EQL, LBRC, RBRC, BSLS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, SCOLON, QUOT,TRNS,PGUP,TRNS, \
TRNS, TRNS,TRNS, TRNS, TRNS, TRNS, CALC,PGDOWN,TRNS),
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(3),
[1] = ACTION_LAYER_TOGGLE(1),
[2] = ACTION_LAYER_TOGGLE(2),
};
-
- Location: Israel
- Favorite switch: Cherry MX Clear
- DT Pro Member: -
Yes!!!Halvar wrote: ↑F0 in your first layer is an undefined keycode. Maybe you mean FN0?
You can look up the available codes in the file /common/keycode.h
That was my mistake - I wrote my function keys as "Fx" instead of "FNx"!
Thank you, Halvar!
-
- Location: Israel
- Favorite switch: Cherry MX Clear
- DT Pro Member: -
After a few days of programming and re-soldering what apparently was a non-functioning diode, the keyboard works perfectly!Halvar wrote: ↑You're welcome! Does the keyboard work?
Thanks again for the help.
Now I need to figure out how to program toggle LEDs on my two toggle function keys and on my CAPS lock key.
- rockosmodlife
- Location: United States
- Main keyboard: Rosewill RK9000 TKL Custom
- Main mouse: Zowie FK1
- Favorite switch: Cherry Blue
- DT Pro Member: -
hey guys, I have an issue that I cant seem to shake here.
The above is what cmd spits out after trying to compile. I do not wish to include any LEDs or a FN layer. What items need to be edited to reflect a keyboard that does not have a FN layer or LED array?
I am no coder by any amount, but I assume that there are empty variables that are causing this error because I have not defined the led_set or a fn key or layer.
Thanks
Code: Select all
obj_gh60_lufa/common/keyboard.o: In function `keyboard_set_leds':
C:\Users\Administrator\Downloads\tmk_keyboard-master\tmk_keyboard-master\keyboard\gh60/../../tmk_core/common/keyboard.c:176: undefined reference to `led_set'
obj_gh60_lufa/common/keymap.o: In function `action_for_key':
C:\Users\Administrator\Downloads\tmk_keyboard-master\tmk_keyboard-master\keyboard\gh60/../../tmk_core/common/keymap.c:36: undefined reference to `keymap_fn_to_action'
make: *** [gh60_lufa.elf] Error 1
I am no coder by any amount, but I assume that there are empty variables that are causing this error because I have not defined the led_set or a fn key or layer.
Thanks
- Halvar
- Location: Baden, DE
- Main keyboard: IBM Model M SSK / Filco MT 2
- Favorite switch: Beam & buckling spring, Monterey, MX Brown
- DT Pro Member: 0051
Hi, welcome to DT!
Did you delete or edit the file led.c? Or the file keymap_common.c? Because these are the files where the function belong that cannot be found.
If you don`t want to use LEDs, you can empty the function led_set(), but you should not delete it.
I would leave keymap_fn_to_action() untouched.
Did you delete or edit the file led.c? Or the file keymap_common.c? Because these are the files where the function belong that cannot be found.
If you don`t want to use LEDs, you can empty the function led_set(), but you should not delete it.
Code: Select all
void led_set(uint8_t usb_led)
{
}
I would leave keymap_fn_to_action() untouched.
Code: Select all
/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}
- rockosmodlife
- Location: United States
- Main keyboard: Rosewill RK9000 TKL Custom
- Main mouse: Zowie FK1
- Favorite switch: Cherry Blue
- DT Pro Member: -
Halvar wrote: ↑Hi, welcome to DT!
Did you delete or edit the file led.c? Or the file keymap_common.c? Because these are the files where the function belong that cannot be found.
If you don`t want to use LEDs, you can empty the function led_set(), but you should not delete it.
Code: Select all
void led_set(uint8_t usb_led) { }
I would leave keymap_fn_to_action() untouched.
Code: Select all
/* translates Fn keycode to action */ action_t keymap_fn_to_action(uint8_t keycode) { return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; }
Thanks!
Now I get the following:
Code: Select all
keymap_common.c: In function 'keymap_fn_to_action':
keymap_common.c:29: error: 'fn_actions' undeclared (first use in this function)
keymap_common.c:29: error: (Each undeclared identifier is reported only once
keymap_common.c:29: error: for each function it appears in.)
make: *** [obj_gh60_lufa/keymap_common.o] Error 1
-
- Location: United Kingdom
- Main keyboard: Custom 65% (Gateron Blue-Gateron Black MODS)
- Main mouse: Logitech M235
- Favorite switch: Gateron Blue
- DT Pro Member: -
Good evening all, has anyone any experience using any of the other members of the Teensy family? or possibly with an Arduino? I have a Teensy 3.1 and an Arduino Mini Pro. Wondering if it's worth pursuing these or wait for a Teensy 2. As a side to this, has anyone developed Bluetooth capabilities? I have an RN42HID on its way which I'll hopefully look to integrate into a project next year.
Thanks
Nic
Thanks
Nic