Split ergonomic keyboard project

ic07

02 Apr 2013, 17:33

Oh ya... they missed that. And it's an easy thing to miss, unless you're probing around with a multimeter coz you don't know what's going on and you end up asking bpiphany about it (like I did, lol).

That bridge connects the capacitor pin closest to it with GND (the other pin is connected to Vcc via a bridge that's by default joined, on the other side of the PCB). So without the bridge, as far as I can tell, the capacitor isn't doing anything.

mharrison

02 Apr 2013, 17:58

I have blogged about my new ergodox keyboard. [0]

Now I just need to spend some time with this puppy and figure out a mapping that works for me.

0 - http://hairysun.com/blog/2013/04/02/oh- ... -keyboard/

User avatar
sordna

02 Apr 2013, 18:43

ic07 wrote:Oh ya... they missed that. And it's an easy thing to miss, unless you're probing around with a multimeter coz you don't know what's going on and you end up asking bpiphany about it (like I did, lol).

That bridge connects the capacitor pin closest to it with GND (the other pin is connected to Vcc via a bridge that's by default joined, on the other side of the PCB). So without the bridge, as far as I can tell, the capacitor isn't doing anything.
Thanks! I verified what you said by looking at the PCB, so I posted about it on MD for them to update the instructions. Funny that the PCB silkscreen doesn't have the capacitor drawn, I think bpiphany should add that. BTW the switches with integrated diodes work great with your MCP23018__DRIVE_ROWS/MCP23018__DRIVE_COLUMNS options !!!

eviltobz

02 Apr 2013, 19:08

Please everyone, stop posting about how you've got your kit and how great it is while all of us non-US customers are sitting around waiting for them to arrive in our countries. That's just mean :(
;)

mharrison

02 Apr 2013, 19:53

Hey, I said it was harder to type on. That should give you some comfort :)

User avatar
sordna

02 Apr 2013, 20:18

Say, how do you momentarily access Layer 0 from another layer? I'm using the MD layer generator by the way.
When I'm in Layer 0 I can momentarily access layer 1 by holding down the ~L1 button. How come there is no ~L0 button to do the equivalent when you are in Layer 1 ? Or am I missing something?

eviltobz

02 Apr 2013, 20:52

mharrison wrote:Hey, I said it was harder to type on. That should give you some comfort :)
I've spent the last couple of months using a kinesis countoured jobby, so I'm already converted to the way of thumb buttons. You're just rubbing it in now :b

ic07

02 Apr 2013, 21:14

sordna wrote:BTW the switches with integrated diodes work great with your MCP23018__DRIVE_ROWS/MCP23018__DRIVE_COLUMNS options !!!
Good to hear :) thanks!
sordna wrote:Say, how do you momentarily access Layer 0 from another layer? I'm using the MD layer generator by the way.
When I'm in Layer 0 I can momentarily access layer 1 by holding down the ~L1 button. How come there is no ~L0 button to do the equivalent when you are in Layer 1 ? Or am I missing something?
Hmm... I don't see one either. I guess that wasn't an anticipated action ;) . You could ask them to add one, of course - but since you're already dealing with the source, you might find it just as easy to do it yourself? What you'd do, for the key position you want to be an ~L0 is, in ".../default--layout.c" :
  • in "_kb_layout", put the number "0"
  • in "_kb_layout_press" put an unused "push" function ("lpush10" perhaps? the number has nothing to do with the layer being pushed onto the stack in the firmware, though it appears to correspond in the files generated by the massdrop configurator)
  • in "_kb_layout_release" put the corresponding "pop" function ("lpop10", for example)
Just be careful to modify the correct position in each of the three matrices... lol. Modding layouts in the source in this version of the firmware is actually kind of a pain. It'll be easier (at least that's my goal!) once the rewrite is finished, but that might be a little while - and then of course it will be longer before any UI supports it.

User avatar
ironman31

03 Apr 2013, 06:31

I got mine put together and now the O, L, '.' up column does not work. Any ideas on how I could fix this? All switches work and the diodes are all correct and work properly.

User avatar
ironman31

03 Apr 2013, 07:12

Turns out some pins on the teensy werent soldered very well. Everything works well now.
Image

User avatar
litster

03 Apr 2013, 07:29

guys, any feedback on the case designs? what is your feet solution?

User avatar
sordna

03 Apr 2013, 08:08

My solution to avoid scratching my desk is to put the screws from the bottom, and the nut at the top, since the screw heads aren't as sharp as the screw ends are :-) It also makes it easier to open up the top plate and access the teensy. But I'll probably stick some rubber feet over the screw heads.

Hey, I wanted to ask you, does the aluminum case have the same thickness switch plate as the acrylic case? In normal keyboards, the metal plate is thin and the switch lower body "clips" lodge into it and can't be pulled out. However with the acrylic case, the material is very thick and of course the switch "clips" don't reach the edge of the plate, so switches can be pulled out. Is that the case also with the aluminum plates, or are switches securely attached to them?

User avatar
litster

03 Apr 2013, 16:49

I have not seen the aluminum case myself and I didn't design it, so I don't know how it is made. It is all Mass Drop's. For the acrylic case, since acrylic is much weaker, you can't use a 1/16" thick acrylic plate as the mounting plate because it would flex too much. All acrylic cases I have seen so far that has an integrated acrylic mounting plate have a thick mounting plate. As long as the switches are soldered correctly onto the PCB, you can't pull out the switches. Well, you could, but you would have to rip the PCB apart. :-)

User avatar
sordna

03 Apr 2013, 18:17

ic07 do you know why there is voltage on D4 and D5 on the teensy ? I put an LED between D4 and GND and it light up, dimly. I measured 1.7 volts across the LED. If I instruct the firmware to actually light it properly (doing it on a keypress) it goes to 2.6 volts and on key release back to 1.7volts.
If I don't put a LED I can measure over 4 volts even though it's supposed to be off. Any ideas?

BTW I noticed this while getting on a buzzer for clicky sounds. It worked by the way, I'm using sparkfun part number COM-07950, here is the code, "led4" is the buzzer (D5) and "led5" is an led (D4) that is lit as long as any key is held down.
Another buzzer I tried was very sensitive and made a light sound even without a keypress, any idea why the voltage doesn't drop to zero on either D4 or D5 ?

Code: Select all

--- ../../src/keyboard/ergodox/controller/teensy-2-0--led.h	2013-04-01 15:06:12.000000000 -0700
+++ ./keyboard/ergodox/controller/teensy-2-0--led.h	2013-04-03 08:41:12.000000000 -0700
@@ -30,17 +30,23 @@
 	#define _kb_led_3_set(n)         (OCR1C = (uint8_t)(n))
 	#define _kb_led_3_set_percent(n) (OCR1C = (uint8_t)((n) * 0xFF))
 
+	#define _kb_led_4_on()           (DDRD |=  (1<<5))
+	#define _kb_led_4_off()          (DDRD &= ~(1<<5))
+	#define _kb_led_5_on()           (DDRD |=  (1<<4))
+	#define _kb_led_5_off()          (DDRD &= ~(1<<4))
 
 	#define _kb_led_all_on() do {	\
 		_kb_led_1_on();		\
 		_kb_led_2_on();		\
 		_kb_led_3_on();		\
+		_kb_led_5_on();		\
 		} while(0)
 
 	#define _kb_led_all_off() do {	\
 		_kb_led_1_off();	\
 		_kb_led_2_off();	\
 		_kb_led_3_off();	\
+		_kb_led_5_off();	\
 		} while(0)
 
 	#define _kb_led_all_set(n) do {	\
--- ../../src/main.c	2013-04-01 15:06:12.000000000 -0700
+++ ./main.c	2013-04-03 08:39:26.000000000 -0700
@@ -82,15 +82,21 @@ int main(void) {
 		#define is_pressed   main_arg_is_pressed
 		#define was_pressed  main_arg_was_pressed
 		for (row=0; row<KB_ROWS; row++) {
+			if (row == 0)
+				_kb_led_4_off();
+
 			for (col=0; col<KB_COLUMNS; col++) {
 				is_pressed = (*main_kb_is_pressed)[row][col];
 				was_pressed = (*main_kb_was_pressed)[row][col];
 
 				if (is_pressed != was_pressed) {
 					if (is_pressed) {
+					        _kb_led_4_on();
+					        _kb_led_5_on();
 						layer = main_layers_peek(0);
 						main_layers_pressed[row][col] = layer;
 					} else {
+					        _kb_led_5_off();
 						layer = main_layers_pressed[row][col];
 					}
 
buzzer_and_led.gif
buzzer_and_led.gif (673.99 KiB) Viewed 7178 times

ic07

03 Apr 2013, 22:25

I'm pretty sure it's because both D4 and D5 are initialized as inputs with internal pull up on, in .../controller/teensy-2-0.c, and it looks like your code doesn't reinitialize them. Take a look at this file (in the same directory). Probably what you want to do, is somewhere in your custome main(), after calling kb_init(), clear the 4th and 5th bits of PORTD with "PORTD &= ~(1<<4)" and PORTD &= ~(1<<5)".

Hope I got all that right... :) I'm on my phone right now.

User avatar
sordna

03 Apr 2013, 23:11

Hmm I tried it but no luck. If I put those 2 commands after kb_init(); then they don't light up at all, they become unoperational.
If I put them before the kb_init(); call, then D4 and D5 still hame some current going into them instead of turning completely off.

ic07

04 Apr 2013, 00:03

Ahhh... when you put those commands after kb_init(), it makes the pins alternate between drive-low and hi-z - so the things you're driving would have to have their other pin connected to Vcc. I feel like this is safer, in general - but since it looks from your picture like you have stuff pretty much set, you could try this in main()

Code: Select all

// ... kb_init() ...

// set internal pull-up off for both pins
PORTD &= ~(1<<4);
PORTD &= ~(1<<5);

// set the pins as output
// (because we cleared the applicable PORT bits above, the pins will now be driving low)
DDRD |= (1<<4);
DDRD |= (1<<5);
and then in teensy-2-0--led.h

Code: Select all

#define _kb_led_4_on()           (PORTD |=  (1<<5))
#define _kb_led_4_off()          (PORTD &= ~(1<<5))
#define _kb_led_5_on()           (PORTD |=  (1<<4))
#define _kb_led_5_off()          (PORTD &= ~(1<<4))
This will make the pins alternate between drive high (when they're turned "on") and drive low (when they're "off") - so in this case, the pin of the buzzer or LED not connected to the Teensy should be connected to GND (through a resistor of course, at least for the LED).

User avatar
sordna

04 Apr 2013, 00:51

Bingo!! Changing _kb_led_on to use PORTD instead of DDRD made the new LEDs operational after the initialization! Thank you so much.

Strange why the other 3 LEDs use DDRD, as well as some register stuff that I don't understand :-)

User avatar
ne0phyte
Toast.

04 Apr 2013, 08:36


ic07

04 Apr 2013, 08:55

@sordna: lol. np, glad you got it working :)

zet13

04 Apr 2013, 16:08

Great news :o is it possible to have a «service» that can assembly the board ? I have never done it.

coredumb

04 Apr 2013, 18:50

Ok now i hope i'll like the full hand layout :D

hoggy

04 Apr 2013, 19:15

Yay! Mine arrived today.

Image

heuristicist

06 Apr 2013, 05:47

Mine arrived yesterday (I'm in Canada) and I'm typing on it now! To be frank I think I would have been fine with my CM Storm, but... well, what can I say, the ErgoDox is just too cool :) I'm finding myself ambivalent to non-staggered layouts; while they're theoretically better I have trouble doing some common bigrams quickly. In particular, "in" is a bit of a stretch for me

FWIW, I'm pretty happy that the switches can be taken off of the plate easily if they're desoldered. I decided, after having put the caps on, that I wanted labelled caps (yanked from my CM Storm), even though I'm a good touch typist (I find this useful for the nonstandard keys as well as the home row marker on the j and f keys). The caps that were sold in the MassDrop GB are insane; they're damn near impossible to remove from the switch. I managed to actually destroy one switch so I had to desolder it and put in a new one. I'm really glad that MD included extra switches! And I had little blue flecks on my desk when I was done from all the slightly broken switches. They work, but I may have to replace them at some point.

Overall I like it. I think the thumb cluster is too far from the main keys, and I wouldn't mind some LEDs to indicate which layer I'm in. It's a pity that the tinkering cost for this is so high (PCBs and cases are expensive, and I want a nice design---no LEDs sticking out of my case! But these are, I think, some minor gripes and it's awesome to see this project come to fruition.

Now all we need is a labelled keycap GB, at least if I can get everyone to agree to my layout >:)

User avatar
sordna

06 Apr 2013, 06:18

heuristicist wrote: Overall I like it. I think the thumb cluster is too far from the main keys, and I wouldn't mind some LEDs to indicate which layer I'm in.
It shouldn't be hard to implement a layer LED in firmware at all. And if you don't want to add LEDs on top of the case, you can program say the existing scroll lock LED.

Regarding the thumbclusters, a few folks noted that on Geeckhack as well. They are a bit hard to reach... I think it would be an improvement if they could move either down and to the right, or, by making one of the vertical keys a 1x key, just to the right. Below photo (I doctored litster's original photo) illustrates the 2 alternative solutions to improve the thumb cluster position:
ergodoxsuggestion.gif
ergodoxsuggestion.gif (308.46 KiB) Viewed 6905 times

User avatar
sordna

06 Apr 2013, 07:06

You gave me a great idea, now I made the teensy built-in led light up whenever you are not in the main layer. Shines great through the acrylic case. My code patch includes 2 additional leds, one that momentarily lights up when a key is pressed (using it to connect a buzzer for audible feedback) and the other lights up continuously as long as any key is held down.
Wow the layer LED is so useful, highly recommended firmware mod !
Spoiler:

Code: Select all

diff -upr ../src/keyboard/ergodox/controller/teensy-2-0--led.h src/keyboard/ergodox/controller/teensy-2-0--led.h
--- ../src/keyboard/ergodox/controller/teensy-2-0--led.h	2013-04-01 15:06:12.000000000 -0700
+++ src/keyboard/ergodox/controller/teensy-2-0--led.h	2013-04-05 21:52:11.000000000 -0700
@@ -30,17 +30,29 @@
 	#define _kb_led_3_set(n)         (OCR1C = (uint8_t)(n))
 	#define _kb_led_3_set_percent(n) (OCR1C = (uint8_t)((n) * 0xFF))
 
+	#define _kb_led_4_on()           (PORTD |=  (1<<5))
+	#define _kb_led_4_off()          (PORTD &= ~(1<<5))
+	#define _kb_led_5_on()           (PORTD |=  (1<<4))
+	#define _kb_led_5_off()          (PORTD &= ~(1<<4))
+	#define _kb_led_6_on()           (PORTD |=  (1<<6))
+	#define _kb_led_6_off()          (PORTD &= ~(1<<6))
 
 	#define _kb_led_all_on() do {	\
 		_kb_led_1_on();		\
 		_kb_led_2_on();		\
 		_kb_led_3_on();		\
+		_kb_led_4_on();		\
+		_kb_led_5_on();		\
+		_kb_led_6_on();		\
 		} while(0)
 
 	#define _kb_led_all_off() do {	\
 		_kb_led_1_off();	\
 		_kb_led_2_off();	\
 		_kb_led_3_off();	\
+		_kb_led_4_off();	\
+		_kb_led_5_off();	\
+		_kb_led_6_off();	\
 		} while(0)
 
 	#define _kb_led_all_set(n) do {	\
diff -upr ../src/main.c src/main.c
--- ../src/main.c	2013-04-01 15:06:12.000000000 -0700
+++ src/main.c	2013-04-05 21:54:38.000000000 -0700
@@ -24,6 +24,7 @@
 
 // ----------------------------------------------------------------------------
 
+uint8_t       layers_head = 0;
 static bool _main_kb_is_pressed[KB_ROWS][KB_COLUMNS];
 bool (*main_kb_is_pressed)[KB_ROWS][KB_COLUMNS] = &_main_kb_is_pressed;
 
@@ -50,6 +51,17 @@ bool    main_arg_was_pressed;
 int main(void) {
 	kb_init();  // does controller initialization too
 
+	// set internal pull-up off for both pins
+	PORTD &= ~(1<<4);
+	PORTD &= ~(1<<5);
+	PORTD &= ~(1<<6);
+
+	// set the pins as output
+	// (because we cleared the applicable PORT bits above, the pins will now be driving low)
+	DDRD |= (1<<4);
+	DDRD |= (1<<5);
+	DDRD |= (1<<6);
+
 	kb_led_state_power_on();
 
 	usb_init();
@@ -63,6 +75,7 @@ int main(void) {
 		bool (*temp)[KB_ROWS][KB_COLUMNS] = main_kb_was_pressed;
 		main_kb_was_pressed = main_kb_is_pressed;
 		main_kb_is_pressed = temp;
+		_kb_led_4_off(); // buzzer off
 
 		kb_update_matrix(*main_kb_is_pressed);
 
@@ -82,15 +95,23 @@ int main(void) {
 		#define is_pressed   main_arg_is_pressed
 		#define was_pressed  main_arg_was_pressed
 		for (row=0; row<KB_ROWS; row++) {
+				if (layers_head != 0)
+					_kb_led_6_on(); // layer led on
+				else
+					_kb_led_6_off(); // layer led off
+
 			for (col=0; col<KB_COLUMNS; col++) {
 				is_pressed = (*main_kb_is_pressed)[row][col];
 				was_pressed = (*main_kb_was_pressed)[row][col];
 
 				if (is_pressed != was_pressed) {
 					if (is_pressed) {
+					        _kb_led_4_on(); // buzzer on
+					        _kb_led_5_on(); // key led on
 						layer = main_layers_peek(0);
 						main_layers_pressed[row][col] = layer;
 					} else {
+						_kb_led_5_off(); // key led off
 						layer = main_layers_pressed[row][col];
 					}
 
@@ -175,7 +197,6 @@ struct layers {
 // ----------------------------------------------------------------------------
 
 struct layers layers[MAX_ACTIVE_LAYERS];
-uint8_t       layers_head = 0;
 uint8_t       layers_ids_in_use[MAX_ACTIVE_LAYERS] = {true};
 
 /*
diff -upr ../src/makefile-options src/makefile-options
--- ../src/makefile-options	2013-04-01 15:06:12.000000000 -0700
+++ src/makefile-options	2013-04-03 16:54:14.000000000 -0700
@@ -9,7 +9,7 @@
 
 TARGET   := firmware  # the name we want for our program binary
 KEYBOARD := ergodox   # keyboard model; see "src/keyboard" for what's available
-LAYOUT   := default-kinesis-mod  # keyboard layout
+LAYOUT   := default--layout  # keyboard layout
 				# see "src/keyboard/*/layout" for what's
 				# available
 

heuristicist

06 Apr 2013, 09:28

Regarding the thumb cluster, I'm finding it a little bit easier if I angle the two halves a little bit more. Still not perfect, but very workable. Of your two pictures I prefer the second---it puts the innermost thumb key right under my thumb.

Regarding your patch: holy balls. This is genius. It should be merged upstream---you might want to consider submitting it on github. I've never worked with a Teensy before so it would have taken me much longer to make the change myself! Thanks so much sordna. Unfortunately now I'll have to recompile anytime I tweak the layout, but I think we can class that issue firmly in the nerd-world problems category (although the fact that I'm not used to non-staggered columns is slowing me down in the terminal...). FTR I also checked in on the Geekhack thread and only used the second patch, obviously, since I don't have anything else attached to the Teensy. I don't imagine your other code would do anything detrimental, though, from the looks of it.

User avatar
sordna

06 Apr 2013, 17:44

If you compiled with my patch, please post a photo with the layer indicator lit!
Compiling is no issue, it's an 3 extra seconds at most for me to load my layout. After downloading my layout source code, I do this into my already existing code directory:

unzip ../../user_xxx.zip keyboard/ergodox/layout/default--layout.c keyboard/ergodox/layout/default--layout.h && make

Basically I only unzip the default--layout.c and .h files, that's the only thing the massdrop configurator changes. I also have the teensy app running on my linux box, and "auto" selected, so I hit a key combo on the ergodox and it loads the new firmware immediately.

heuristicist

06 Apr 2013, 23:26

Here you go :)

Now all I need is some rubber feet and some tenting!
Attachments
Layer LED closeup
Layer LED closeup
IMG_2821.jpg (386.01 KiB) Viewed 6810 times
Layer LED
Layer LED
IMG_2820.jpg (606.15 KiB) Viewed 6810 times

User avatar
sordna

07 Apr 2013, 00:06

Gorgeous pics! Here are mine, with some poor man's tenting:
ergodox_tent1.jpg
ergodox_tent1.jpg (96.17 KiB) Viewed 6801 times
ergodox_tent2.jpg
ergodox_tent2.jpg (55.26 KiB) Viewed 6801 times

Post Reply

Return to “Workshop”