Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 The Scrap Keyboard, Ground up hardwired keyboard

views
     
TSfaridr
post May 24 2014, 05:24 AM, updated 12y ago

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
End Result

Prototype Model:
- Acrylic plate with Aristotle Cherry MX clone
- Poker 2 (60%) layout
user posted image

Final Result:
- Clearminium (I'm bad at naming, wth)
- Aluminium plate, Cherry MX white ergo (Cherry blue spring)
- Minimize mixture of 60% layout and TKL layout
- USB suspend breathing LED (the only bling bling sad.gif )

user posted image


This project was possible thank to weilung, 'the god' 0168257061, hmwgbworld, nemofish, Vasil, matt30, hasu, Robin from PJRC and many more.

This project was inspired after opening up my mechanical keyboard for cleaning. After examining the switch, it hits me that it is possible to build a mechanical keyboard from ground up, without usage of pcb as the switch are similar in concept to normal switches (on - off state). Further googling, I stumble upon matt30 work on his brownfox keyboard here , and decided to use this as a guidelines.

The true advantage of this project is that you can design any kind of keyboard with your own key requirement without limitation of pcb design. This is a test project as I just graduated and being unemployed, there is no budget for custom made switch plate and case, so I'll be using mass produced poker 2 plate and case.

And no, this wont be cheap compared to buying fully manufactured keyboard. Even with cheap switches, plate and case, this project already cost me around RM300++, blame postage fee from m'urica land of the free and europe, and more money needed later on for keycaps (+100 - 200 maybe?) , where you can just buy a brand new Poker 2 keyboard for RM290, and better build quality, I think.

Much suffering, much pain, much hole in wallet, but priceless satisfication of making your own brows.gif brows.gif

Item needed:
- Keyboard switches (cherry, alps and so on)
- Mounting plate
- 1N4148 diodes
- Teensy 2.0 (or teensy 2.0 ++ for larger keyboard)
- Multimeter
- Soldering iron & solder
- Soldering skill and creativity (sadly I lack both skill sad.gif )

Part 1: Disassembling switches
Part 2: The Case (skip this part and go to part 7, the whole purpose of this project)
Part 3: The wiring (the fun and frustrating part)
Part 4: Meet teensy 2.0, the brain, wiring the teensy
Part 5: Programming the brain, teensy 2.0 firmware (now with full nkro)
Part 6: Programming the brain, Part 2, and final result
Part 7: Custom case and plate using CAD (Guide)
Part 8: Casing Production and Result

Part 1: Disassembling switches

The switch donor will be a broken Leo KB-6251 keyboard which I've gotten for USD 1 dollar from ebay thanks to Vasil from K-system Store. The keyboard uses Aristotle Cherry MX clone switch, and from the photo below the biggest different from the german made Cherry MX is that the clone lack LED mounting hole. The white clone switch has similar feel and clicky sound to Cherry MX blue switch.

Not Cherry MX switches, but 100+ switches for USD 1 dollar, no complaint there sweat.gif

Disassembling the switches from original pcb. Further inspection shows sign of water damage to original pcb, I'm guessing the cause of Leo KB-6251 death.

From Bulgaria with love wub.gif
user posted image

Hello Mr Leo KB-6251, sorry to hear you're dead. But at least your organ are useful.
user posted image

user posted image

user posted image

user posted image

Internal view of Aristotle Cherry MX clone
user posted image

This post has been edited by faridr: Aug 6 2014, 03:38 PM
TSfaridr
post May 24 2014, 06:18 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Part 2: The case

For the case, I bought a cheap Poker 2 acrylic case and Poker 2 switch mounting plate from a seller (sorry seller I dont know you nickname sad.gif ) from taobao through nemofish. The plate came with 2 type of thickness, 2mm and 3mm. For a tight fit, Cherry MX or its clone switches has maximum height of 1.6mm for mounting, but able to fit nicely with thickness thicker than 1.6mm, only downside is that you cant change keycap easily as switches will comes off easily if you pull it hard. For constantly changing the keycap, a plate of thickness around 1.4mm - 1.6mm is recommended (think so?), similar to plate used by mechanical keyboard manufacturer.

The plate and the case can be separated into 3 part, top layer, thick middle layer and bottom cover. I've decided to combine the plates and case top layer together to provide extra strength and rigidity to the keyboard. I use super glue and acrylic weld/sealant to combine the case. The sealant are thicker and gooey like, so it works best as base layer to for sticking the keyboard, to prevent leaking when pouring super glue.

To start combining the plate and case top layer, I use tape to hold the plate and the case top layer together, which also act as a layer to ensure acrylic weld/sealent stay in place. Not possible to use tape and super glue as super glue are to watery.

As the plate comes with 2mm and 3mm thickness, I've combined both becoming 5mm thickness plate.

This is how it looks like after combining 2mm and 3mm plate and top layer part of the case. Lots of sanding needed. I've uses some kind of hard sand paper, then to 400 grit sandpaper, and finish it off with 800 grit sandpaper.

user posted image

user posted image

user posted image

The bottom part of the case comes with predrilled hole for mounting and screwing Poker 2 pcb, I drilled it a little bit bigger and inserted a 1/2 inch screw, which was just perfect for screwing the bottom plate of the case to the plate. I use super glue to stick nut to the bottom of the top plate, and the bolt goes to the bottom of the bottom part of the case.

user posted image

user posted image

This is how it looks like after everything completed (though still not finish with sanding)
user posted image

This post has been edited by faridr: May 24 2014, 07:55 AM
TSfaridr
post May 24 2014, 07:15 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Part 3: The wiring (the fun and frustrating part)

This is the important part, a mistake here will make you suffer, I've completed the project in a day, but had to desolder again and redo the next day due to some wiring mishap. The suffering shakehead.gif shakehead.gif shakehead.gif

The first thing to do is to check every switch is working by using multimeter. I've set the multimeter to direct current (in an easier way, as long as there is a "beep beep beep" sound when both multimeter pin touching each other, thats the mode you want to set it to.

Anyhow meet my multimeter I stole from my dad, and its older than me and still serving just fine. Good old chap! rclxms.gif

user posted image

user posted image

The picture above shows the Cherry switch, and you'll see 2 metal pin sticking out. Thats the point to test the switch using multimeter.
To test the switch, same logic applies any kind of switch, where it has to be at -on state, so make sure that the key is pressed. Lay down all the switches on the plate, and put an eraser (that eraser I use during my studying days tongue.gif ) or anything under each switch that needed to be tested. The weight of the plate + switches inserted is enough to pressed down one key at a time.

I've found 7 dead switches. better safe than sorry.

Now comes the wiring part.

I solder each switch with 1N4148 diode, and make sure the black marking of the diode face the bottom part. The connection of the diode have to be in parallel.

My really damn not pretty drawing

user posted image

The real life result

user posted image

user posted image

And the final completed wiring and soldering of the diodes!

user posted image

After completion of wiring the diodes, its time to wire up each switches together in a column.

Start of with my bad bad drawing, the switches can be wired anyhow preferred, but do take note of the wiring for future reference in setting up firmware for teensy.

user posted image

Wiring in progress, I use IDE cable as it is thin and less intrusive, but soldering is a pain because of it thin-est factor.

user posted image

user posted image

Ignore the wire I'm holding in my hand
user posted image

End of suffering and inhaling solder smoke, part 1.

This post has been edited by faridr: May 24 2014, 08:02 AM
TSfaridr
post May 24 2014, 08:06 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Part 4: Meet teensy 2.0, the brain, wiring the teensy

Meet teensy 2.0, the awesome little thinggie. All the ports available can be use in this project except for VCC, RESET and Pin D6 ( pin D6 is for teensy internal LED stuff)

user posted image

To know how many port you will be using, calculate how switch columns connection you've made, and how many row of diode connection. From the picture below, I have 14 switch column connection, and 5 row of diode connection, therefore 14+5 = 19 ports needed. Total port I use is 21, 2 more additional port for caps lock LED and function key LED.

user posted image



user posted image

Above is the teensy 2.0 pinout diagram, I use pin F0, F1, F4 F5, F6 for the diode connection and refer to my not so pretty handwriting. There is no order to use the port, so its up to you to decide which port to use depending on ease of wiring.

user posted image

And my drawing of the connection, purple colour. There's no LED connection to teensy as my connection does not seems to work, but in theory I connect LED +ve to 330ohm resistor then wire up to port B2, and -ve of LED to ground port. Does not seem to work though, not sure due to wiring or firmware, still waiting for matt3o and hasu reply.

user posted image

The end result of hard wiring labour and inhaling lots of solder smoke. Its really.... messy, really messy, as soldering on teensy is not easy for someone without steady hand like me but hell I'll use cable tie or something later on.

user posted image

user posted image

user posted image

user posted image

This post has been edited by faridr: May 24 2014, 01:45 PM
TSfaridr
post May 24 2014, 08:07 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Part 5: Programming the brain, teensy 2.0 firmware

Thanks to matt3o for his guide on building keyboard firmware using hasu's code.

My first attempt is on my linux laptop, but there seems to be a problem on my laptop to detect unflashed teensy (working fine after flashing teensy firmware), so for linux/mac guide, you can refer on matt30 guide. So I move on to my pc, with Windows 8.1 64 bit.

For windows you need to install:
- teensy loader
- winavr ( windows 8.1 user, maybe win 7 64 bit too, need this, copy and paste to utils/bin in WinAVR directory)
- hasu's code
- notepad++ or anything to edit programming language

1st step
Download and unzip hasu's code, and navigate to "tmk_keyboard-master\keyboard\gh60" directory.
Open Makefile and edit with notepad++

CODE
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
...
...
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA



The MCU=atmega32u4 is teensy 2.0 processor, the other one is for teensy 2.0++. As I'm using teensy 2.0, I've disable the MCU = at90usb1287 by putting # at the front. The NKRO_ENABLE = yes need to be disable to by putting # to the front as it is not supported. By default 6kro is enable. For full nkro, can be enable by pressing lshift + rshift + n . Not enable by default to some bios interference issue


2nd step
Open config.h file, and look for

CODE
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 14


This define they rows and columns available, and as stated in part 4, I have 14 columns and 5 rows. Can be change according to your own design.


3rd step

In part 4, I list down the wiring diagram of each columns and rows on a piece of paper, and add binary numbering to the note. Binary number basically just start from 0, those with programming background should know, those without, well, just start with (computer) 0 = 1 (human) , (computer) 1 = 2 (human), 2 = 3....

Remember that when you flip the case, the numbering will start from the opposite side. If bottom view the numbering is read from left to right, flipping the keyboard will make the numbering start from right to left.

View from bottom
user posted image

View from top
user posted image

Now open up matrix.c and look for "static void init_cols(void)"

CODE
static void  init_cols(void)
{
   // Input with pull-up(DDR:0, PORT:1)
   DDRF  &= ~(1<<0 | 1<<1);
   PORTF |=  (1<<0 | 1<<1);
   DDRE  &= ~(1<<6);
   PORTE |=  (1<<6);
   DDRD  &= ~(1<<7 | 1<<6 | 1<<4);
   PORTD |=  (1<<7 | 1<<6 | 1<<4);
   DDRC  &= ~(1<<7 | 1<<6);
   PORTC |=  (1<<7 | 1<<6);
   DDRB  &= ~(1<<7 | 1<<6 | 1<< 5 | 1<<4 | 1<<3 | 1<<1 | 1<<0);
   PORTB |=  (1<<7 | 1<<6 | 1<< 5 | 1<<4 | 1<<3 | 1<<1 | 1<<0);
}


DDRF and PORTF refers to pin F, so for pin B just change to DDRB and PORTB and so on for other pin.

CODE
DDRF  &= ~(1<<0 | 1<<1);
PORTF |=  (1<<0 | 1<<1);


(1<<0 | 1<<1) shows the pin that you want to enable. From code above it means that pin F0 and pin F1 is enabled.

Following my design and teensy connection, this is the code for the pin that I wanted to enable.
» Click to show Spoiler - click again to hide... «



4th Step

3rd step is for pin initialization, now 4th step will be on reading the code. Search for "static matrix_row_t read_cols(void)" and you'll see

CODE
static matrix_row_t read_cols(void)
{
   return (PINF&(1<<0) ? 0 : (1<<0)) |
          (PINF&(1<<1) ? 0 : (1<<1)) |
          (PINE&(1<<6) ? 0 : (1<<2)) |
          (PINC&(1<<7) ? 0 : (1<<3)) |
          (PINC&(1<<6) ? 0 : (1<<4)) |
          (PINB&(1<<6) ? 0 : (1<<5)) |
          (PIND&(1<<4) ? 0 : (1<<6)) |
          (PINB&(1<<1) ? 0 : (1<<7)) |
          ((PINB&(1<<0) && PINB&(1<<7)) ? 0 : (1<<8)) |     // Rev.A and B
          (PINB&(1<<5) ? 0 : (1<<9)) |
          (PINB&(1<<4) ? 0 : (1<<10)) |
          (PIND&(1<<7) ? 0 : (1<<11)) |
          (PIND&(1<<6) ? 0 : (1<<12)) |
          (PINB&(1<<3) ? 0 : (1<<13));
}

The code above shows the columns associated with each pin, so for a closer look I'll take 2 code from above,

CODE
(PIN[B]D[/B]&(1<<[B]4[/B]) ? 0 : (1<<[B]9[/B])) |
(PIN[B]B[/B]&(1<<[B]1[/B]) ? 0 : (1<<[B]3[/B])) |


Which means that pin D4 is connected to 10th column (9 in binary)
pin b1 is connected to 4th column (3 in binary)

And here is the final code for my keyboard
» Click to show Spoiler - click again to hide... «



5th Step

Now its time to initialize the rows. Search for "static void unselect_rows(void)" and here is the default code

CODE
static void unselect_rows(void)
{
   // Hi-Z(DDR:0, PORT:0) to unselect
   DDRD  &= ~0b00101111;
   PORTD &= ~0b00101111;
}


The most important part that need to be change is the last 8 binary number, 0b01110011 , 0b can be ignored, just leave it there.
The numbering is read from right to left where pin F0 start from the most right, 1 is use to enable the pin, and 0 to disable the pin.

I did a mistake at this part, keyboard went haywire when tested, took 1 day to desolder and resolder back, till I realised I've made a mistake here. So my word of advice, check firmware coding before panicking and desolder everything...

Code that I use which is finally work, and since I use port F0, F1, F4, F5, F6
» Click to show Spoiler - click again to hide... «



6th Step

Now after enabling the pin for rows, its time to read from row. Search for "static void select_row(uint8_t row)"

CODE
static void select_row(uint8_t row)
{
   // Output low(DDR:1, PORT:0) to select
   switch (row) {
       case 0:
           DDRD  |= (1<<0);
           PORTD &= ~(1<<0);
           break;
       case 1:
           DDRD  |= (1<<1);
           PORTD &= ~(1<<1);
           break;
       case 2:
           DDRD  |= (1<<2);
           PORTD &= ~(1<<2);
           break;
       case 3:
           DDRD  |= (1<<3);
           PORTD &= ~(1<<3);
           break;
       case 4:
           DDRD  |= (1<<5);
           PORTD &= ~(1<<5);
           break;
   }
}


Case 0 means first row, case 1 means second row. Since I have 5 rows, case 0 - case 4 is enough.

CODE
DDRD  |= (1<<0);
PORTD &= ~(1<<0);


And this part means that pin D0 is selected.

And here is my final code, using pin F

» Click to show Spoiler - click again to hide... «


7th Step
» Click to show Spoiler - click again to hide... «


In the 3rd step above, I forgot to declare pin for led. I use pin D5 for the led, hence DDRD &= ~(1<<5); and PORTD &= ~(1<<5);
I use 3v LED with 330ohm resistor to reduce the voltage outputted by teensy pin. According to few discussion, teensy pin is outputting less than 5v, and resistor might not be needed, but my multimeter is showing 5-5.1v at the pin. If LED is dim or not lighting up, I would suggest on removing the resistor, or use less powerful resistor. Best is to check with multimeter.

This is the led code that I use. I did not put the default code in hasu's original file because there were something not right with the code. Few people in Geekhack forum were having same issue, and as far as it is concern, this is one of the working code available. The /* ... */ at USB_LED_SCROLL_LOCK were there to disable the code, as I dont use scroll lock light.

Full led effect can be enable, but I ignore this part since Aristotle switch does not have LED mounting hole. Read more on rklm minimal animal build to learn on enabling LED backlighting.

I'm trying to figure out fn layer LED indicator, as Hasu did not implement it, but it is possible. There's too much linking files and code to go through. Not sure if I ever manage to figure it out. Hopefully someone else with better programming skill on geekhack could figure it out first.

This post has been edited by faridr: Jun 23 2014, 03:41 AM
TSfaridr
post May 24 2014, 08:07 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Part 6: Defining key matrix

1st step
And now, a little bit confusing part, in defining the function of key mapping. I havent finalized this part especially for the fn second layer function, as I'm waiting for my keycap. But the normal keyboard qwerty asdfg zxcvb is already coded and working fine.

I've open keymap_common.h file in the same gh60 directory and look for #define KEYMAP function. Here is the original code

CODE
#define KEYMAP( \
   K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
   K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
   K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
   K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
   K40, K41, K42,           K45,                K49, K4A, K4B, K4C, K4D  \
) { \
   { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \
   { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \
   { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \
   { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \
   { KC_##K40, KC_##K41, KC_##K42, KC_NO,    KC_NO,    KC_##K45, KC_NO,    KC_NO,    KC_NO,    KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D }  \
}


My first reaction was watef*** is this. After further reading, this part is actually simple, though requires lots of attention.
What you see here is the layout design of each keyboard key, and the view is from the top, where all the letters and numbering will be.
Lets take K00 and K12 for example. In K00, the first 0 is for the row, and the second 0 is for the column. So for K12, its mean row 1 columns 2.
Notice that there's no K43, this is due to empty slot in gh60 pcb. K42 is basiccaly alt key, and k45 is spacebar key.

As the program use hex/binary or whatever computer instruction is, the numbering start from 0 till 9, then A, B, C... . Basically A = 10, B = 11, C = 12 and so on. And remember to add comma( , ) and blackslash ( \ ) at the end, and only backslash ( \ ) at the last keyboard layout, as shown in the default code.

Now the second part of the code, its still the same thing, same logic, except that unused slot has to be declare by putting KC_NO.

For my scrappy banger keyboard, since I use a different wiring from gh60 pcb, I've made changes. Forget all the previous numbering method to avoid confusion. I took a look at bottom layout of the keyboard and wiring.
user posted image

And the view of top part, remember that when you flip from bottom to top view and vice versa, you have make sure of the numbering. Notice the location of K00 and K0D between bottom and top view.
user posted image

And here is my final code for my scrap banger
» Click to show Spoiler - click again to hide... «


******************************** ONLY DO THIS PART IF THERE IS COMPILING ERROR DURING MAKEFILE (in last part)********************

According to matt30, #define KEYMAP_ANSI function can be ignored and no change is needed. But during my compilation of the code, there was lots of error preventing compilation, and log shows that the error comes from function in #define KEYMAP_ANSI , as there is conflict in layout. So I beg to differ, change needed tongue.gif

So I copy the code from #define KEYMAP function, and paste the whole thing at #define KEYMAP_ANSI . Just copy the content, dont change the function name. This was the changes I've made.

» Click to show Spoiler - click again to hide... «


*****************************************************************************************************************************

2nd step
Now time to define what each key does smile.gif And there is no limitation, what each key does is up to you. As I use Poker 2 layout, I'll be using keymap_poker.c file. Other like keymap_hhkb.c , keymap_hasu.c and so on can also be use, depending on which code suit the keyboard design best.

I would suggest a read on matt3o guide in defining the layout part too as this part are usually comes down to own preferences.

I've made my keymap here, although its a little bit harder to explain, but I'll try my best.


3rd and final step laugh.gif

Now its time to compile the code and flash it to teensy. I use Windows 8.1 in compiling and WinAvr need to be installed (refer to part 5 for link and fix). After installation, fire up command line console, and then navigate to gh60 folder, and I've compiled the code by typing make -f Makefile

user posted image

No compilation error, yaaaaay!. I navigate back to gh60 folder, and there it is, gh60_lufa.hex drool.gif drool.gif drool.gif

To finish it up, I connect the teensy to PC using mini usb to usb cable (the same adapter on you external hdd), load up teensy loader.
user posted image

Now to complete the process, I just press the tiny winnie button on teensy, click the auto button, and open the gh60_lufa.hex file in teensy loader. The loader then automatically flash the teensy and reboot teensy.

And for the moment of truth, I fire up notepad, and press the buttons on my scrap banger, and seeing the output on the screen..... ITS DONE! YAAAAAAAAAAY




To sum it up, this project might look complicated at first, but its actually quite do-able even for anyone without programming language background and can be completed within 1 day (took me 2 days because of my stupidity not checking the firmware code before desoldering back the whole thing).

And you can actually make specific keyboard for specific function, for example like any game with its own specific design keyboard. Hoping that someone else with higher creativity level would come out with their own keyboard design, as this is just a base experiment and guidelines.

This post has been edited by faridr: Jun 8 2014, 07:30 PM
unequalteck
post May 24 2014, 11:17 AM

Custom member title
*******
Senior Member
2,690 posts

Joined: Dec 2008
From: Kota Kinabalu Current: Wangsa Maju


passionate level is too high. fully respect
TSfaridr
post May 25 2014, 01:48 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
QUOTE(unequalteck @ May 24 2014, 11:17 AM)
passionate level is too high. fully respect
*
This is what happen when you're jobless and have nothing much to do tongue.gif
ntw
post Jun 1 2014, 07:26 PM

One Each At A Time
******
Senior Member
1,432 posts

Joined: Aug 2010
From: Ipoh mali~~~


can't give enough thumbup.gif

This post has been edited by ntw: Jun 4 2014, 01:14 AM
-oc-gassa
post Jun 2 2014, 12:21 AM

Enthusiast
*****
Senior Member
967 posts

Joined: Jan 2003
From: setapak
nice bro... keep up.. please update once complete with case..
AceCombat
post Jun 3 2014, 05:10 PM


Group Icon
Elite
5,434 posts

Joined: Dec 2006


justnits
Have you seen this?
TSfaridr
post Jun 3 2014, 06:54 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Keycap and stabilizer just arrived, but need to modified the stabilizer to fit the mount. Should have stick with standard thickness meh.

Too big to fit costar stabilizer, too thick to fit cherry plate stabilizer, so had to modified cherry pcb stabilizer. Lesson here, dont ignore stabilizer mounting during planning.
0168257061
post Jun 3 2014, 10:25 PM

EimiFukada
********
All Stars
14,242 posts

Joined: Jul 2007
From: JAVABUS


your plate,
should fit plate mounted cherry stabilizer.
instead of costar.

since you dont have a pcb underneath,
pcb mounted also don't work?
TSfaridr
post Jun 4 2014, 12:33 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
QUOTE(0168257061 @ Jun 3 2014, 10:25 PM)
your plate,
should fit plate mounted cherry stabilizer.
instead of costar.

since you dont have a pcb underneath,
pcb mounted also don't work?
*
I've tried plate mounted stabilizer taken from ducky, but cant fit due to plate thickness, 5mm. I figured might try all the available stab type. Manage to mount pcb stabilizer by sticking it with super glue from bottom. Seems to works and can withstand typing rage, will upload the picture.
TSfaridr
post Jun 4 2014, 01:19 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Time to install the stabilizer, which should has never been overlook when picking the plate. End up had to do some nasty stuff to the poor stabilizer, but at least it work and served it purpose.

I had to stick the stabilizer to the bottom of the plate using superglue, at the places circled red. I did not put it on the side with metal because I'm afraid that the metal going to stick and lost it purpose as stabilizer. After 1 hour, test by mashing the keys with stabilizer, seems to hold without any issue, and the stabilizer does it job.

user posted image

user posted image


Video showing mashing of the keys, to test the stabilzer, and rigidity. Seems to be no flex. Mine was 5mm plate, but according to matt30 (BrownFox keyboard) and rklm (minimal animal keyboard), they uses around 1.5mm plate, and seems to be no flex after combining with case. I would recommend 1.5mm plate too as it is much easier to change keycap and uses plate mount stabilizer.

Mashing the key sound a little different to cherry mx blue, could be down to aristotle cherry clone switch, or because of acrylic plate.





And this is the final look of the keyboard, with numlock light on. The case isnt pretty due to superglue effect and lots of slash and hacking that goes behind the scene (broke some part of the casing). Spray paint should be able to hide the superglue effect, but it just for personal use, so I'm kinda lazy for that. I would recommend acrylic glue because it doesnt leave any residue effect, too bad I've just learn that from the hardware store uncle after I've glued the plate.

user posted image

user posted image

A really really really messy look on the inside, but I'm the "as long as it work" kind of guy. Never have been artistic.

Now all that left is to remap the key, which should be similar to poker 2, but with some function that I dont use removed. Time to figure out the keymapping.

I will post a few tips and things to avoid when doing hardwired method later on, because thats the whole point of doing this on cheap case in the first place. Better safe than sorry with expensive items.

This post has been edited by faridr: Jun 4 2014, 01:25 AM
0168257061
post Jun 4 2014, 01:32 AM

EimiFukada
********
All Stars
14,242 posts

Joined: Jul 2007
From: JAVABUS


thumbup.gif

the first diy mkb in forum lyn ever.
TSfaridr
post Jun 6 2014, 03:06 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Updated the LED part.

Been busy lately with interviews and real life stuff, so update going to be slow.

Neeeeeeed to find job asap for custom laser cut plate and cherry switches cry.gif cry.gif
amirinz
post Jun 7 2014, 04:26 PM

Getting Started
**
Junior Member
268 posts

Joined: Oct 2008


Congrats bro! Fully DIY keyboard are ultimate "brag"able and full conversation starters! A very nice looking MKB indeed!
BurgerRI
post Jun 7 2014, 05:34 PM

Enthusiast
*****
Senior Member
905 posts

Joined: Aug 2006



This is amazing!! respect!!! thumbup.gif

quovadis123
post Jun 7 2014, 06:22 PM

Keys
*******
Senior Member
2,882 posts

Joined: Oct 2009
From: Land of Denial
curious to know how much is the shipping fee for the Leo keyboard?
Sentinel92
post Jun 7 2014, 06:32 PM

20000% Chinaman Certified Discount Hunter.
*******
Senior Member
3,573 posts

Joined: Nov 2013
From: The Deathlands of Audio Poisoning.


Epicness. notworthy.gif
hmwgbworld
post Jun 7 2014, 07:24 PM

Look at all my stars!!
*******
Senior Member
3,375 posts

Joined: Apr 2012
From: Sarawak


Very nicely done worklog notworthy.gif .
I have spent for more than 30min reading your Part 4 -6, really and truly amaze and inspire me a lot towards programming.
Because the first time i approach the tmk firmware is just by reading and looking at those codes without a guide, now think back i was so lame haha doh.gif .

TSfaridr
post Jun 8 2014, 12:18 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
QUOTE(hmwgbworld @ Jun 7 2014, 07:24 PM)
Very nicely done worklog  notworthy.gif .
I have spent for more than 30min reading your Part 4 -6, really and truly amaze and inspire me a lot towards programming.
Because the first time i approach the tmk firmware is just by reading and looking at those codes without a guide, now think back i was so lame haha  doh.gif .
*
Mostly thank to matt3o though, or else I would have a hard time understanding the code too laugh.gif


-------------------------------------------------------------------------------------------------------------------------------------------------------

Keyboard layout update still on hold till I can figure out what causing fn function to go haywire after pressing fn key. Problem still appear after flashing with last known working layout, and default poker layout, so cant be the firmware.

Reflash with teensy blink test code, working fine, so not the teensy.

The culprit could be fn key, or this laptop. Only can figure that out in few days as I'm currently away from my house.
hmwgbworld
post Jun 8 2014, 12:40 PM

Look at all my stars!!
*******
Senior Member
3,375 posts

Joined: Apr 2012
From: Sarawak


QUOTE(faridr @ Jun 8 2014, 12:18 PM)
Mostly thank to matt3o though, or else I would have a hard time understanding the code too  laugh.gif
-------------------------------------------------------------------------------------------------------------------------------------------------------

Keyboard layout update still on hold till I can figure out what causing fn function to go haywire after pressing fn key. Problem still appear after flashing with last known working layout, and default poker layout, so cant be the firmware.

Reflash with teensy blink test code, working fine, so not the teensy.

The culprit could be fn key, or this laptop. Only can figure that out in few days as I'm currently away from my house.
*
Probably the fn key implementation not yet stable or complete, maybe just disable fn in the end sweat.gif .
TSfaridr
post Jun 8 2014, 01:01 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
QUOTE(quovadis123 @ Jun 7 2014, 06:22 PM)
curious to know how much is the shipping fee for the Leo keyboard?
*
Was around rm50, euro and us delivery are quite expensive sad.gif

QUOTE(hmwgbworld @ Jun 8 2014, 12:40 PM)
Probably the fn key implementation not yet stable or complete, maybe just disable fn in the end  sweat.gif .
*
Works fine before this. So must be my screw up , or something happen when I mash left shift + right shift + fn + k to reset teensy as Im too lazy to open the case for the reset button
s7ran9er
post Jun 8 2014, 03:25 PM

ლ(;◉;益;◉;ლ)
*******
Senior Member
4,210 posts

Joined: Jan 2003
I came here, quick glance through the posts, I have no idea what you're doing but it sure is epic.

That sure took a lot of effort for rewiring.
TSfaridr
post Jun 8 2014, 04:34 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Keymapping

Few tips for keymapping
- make whole tmk_keyboard folder backup before making any changes. If something goes wrong, start back from old backup. The code changes seems to affect another files, so dont copy and replace, but start back from old backup.
- to reset teensy 2.0 without pressing the button, open teensy loader and press lshift + rshift + pause (in my case, lshift + rshift + fn + k)
- sometimes after pressing lshift + rshift + pause, nothing happen and keyboard doest work, just unplug usb and reconnect, and try again.
- its a little bit harder for me to explain this part as it is more down to trial and error and my own understanding, so feel free to ask if anyone interested. laugh.gif

I use keymap_poker.c as my basis, since this is after all a poker 2 layout.
A look at const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] function

CODE
   /* 0: qwerty */
   KEYMAP_ANSI(
       GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC, \
       TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
       CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,  \
       LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT, \
       LCTL,LGUI,LALT,          SPC,                     FN0, RGUI,APP, RCTL),
   /* 1: colemak */
   ...
   /* 2: dvorak */
  ...
   /* 3: workman */
  ...
   /* 4: Poker with Arrow */
  ...
   /* 5: Poker with Esc */
 ...
   /* 6: Poker Fn*/
   KEYMAP_ANSI(
       ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS, \
       TRNS,FN2, UP,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, FN4,  \
       TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END,      TRNS, \
       TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL,           TRNS, \
       TRNS,TRNS,TRNS,          FN1,                     TRNS,TRNS,TRNS,TRNS),


Dont worry about the space or anything, this is just to make it readable. Here is the example from tmk_keyboard default code. The first part is the default qwerty layout, while the second part shows the function layer fn. TRNS means that the same keys applies with the default layout, no changes made, in this case, default qwerty layout.

And remember to change numbering of /* 6: Poker FN */ if other code above is remove. Although in programming anything inside /* */ is disable, this will be an important reference when setting up the const uint16_t PROGMEM fn_actions[] = { function. The code will take the first declared KEYMAP_ANSI as 0, and next declared KEYMAP_ANSI as 1, and so on.

Let say if colemak, dvorak and workman layout is removed
CODE
   /* 0: qwerty */
   KEYMAP_ANSI(
       GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC, \
       TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
       CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,  \
       LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT, \
       LCTL,LGUI,LALT,          SPC,                     FN0, RGUI,APP, RCTL),
   /* 1: Poker with Arrow */
  ...
   /* 2: Poker with Esc */
 ...
   /* 3: Poker Fn*/
   KEYMAP_ANSI(
       ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS, \
       TRNS,FN2, UP,  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, FN4,  \
       TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END,      TRNS, \
       TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL,           TRNS, \
       TRNS,TRNS,TRNS,          FN1,                     TRNS,TRNS,TRNS,TRNS),,


There's also fn1, fn2 fn3, fn4 in the layout, and the purpose and how to set it up will be explained in second code function.

I've removed 3 layout a few other stuff, leaving only 1 default layout and 3 function layer
» Click to show Spoiler - click again to hide... «


Now to the second function, const uint16_t PROGMEM fn_actions[] = {, this is where to define the fn0, fn1, fn2 and so on function. This is the default hasu's tmk_keyboard code.
CODE
const uint16_t PROGMEM fn_actions[] = {
   /* Poker Layout */
   [0] = ACTION_LAYER_MOMENTARY(6),  // to Fn overlay
   [1] = ACTION_LAYER_TOGGLE(4),     // toggle arrow overlay
   [2] = ACTION_LAYER_TOGGLE(5),     // toggle Esc overlay
   [3] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // Task(RControl,RShift+Esc)
   [4] = ACTION_LAYER_MOMENTARY(7),  // to Layout selector
   [5] = ACTION_DEFAULT_LAYER_SET(0),  // set qwerty layout
   [6] = ACTION_DEFAULT_LAYER_SET(1),  // set colemak layout
   [7] = ACTION_DEFAULT_LAYER_SET(2),  // set dvorak layout
   [8] = ACTION_DEFAULT_LAYER_SET(3),  // set workman layout
};


This is the meaning of each function and how it work as far as I understand
ACTION_LAYER_MOMENTARY ---> press and hold down designated function key to initiate
ACTION_LAYER_TOGGLE ---> press the designated function key to turn on/off
ACTION_MODS_KEY ---> press the designated function key to initiate specified command
ACTION_DEFAULT_LAYER_SET ---> press to set the default layout.

[1] = ACTION_LAYER_TOGGLE(4)
[1] refers to the function key fn number. So [0] means fn0, [1] means fn1 and etc etc
(4) refers to the KEYMAP_ANSI function position, in the default hasu's code, (4) refers to function    /* 4: Poker with Arrow */

This part is a little bit harder to explain, it is more down to trial and error that I had to go through.
For example, using default hasu's poker 2 code, to change layout, a combination of fn1 + fn4 + fn* (* = fn5, fn6, fn7, fn8)
to toggle arrow on, combination of fn0 + fn1, and same thing again to turn it off.

and following changes I've made to the layout, I've made changes here following my layout.
» Click to show Spoiler - click again to hide... «


=======================================================================================================================
Extra features that I found out:
2 or more function layer for the same key. I did not implement this, but has tested it out and it work. Here is the example

   [0] = ACTION_LAYER_MOMENTARY(5),  // to 1st Fn overlay
   [1] = ACTION_LAYER_MOMENTARY(6),  // to 2nd Fn overlay

Let say fn0 = right alt while fn1= right ctrl, and in function overlay (5), letter P is set as PAGE UP, while in function overlay (6) P is set as PAGE DOWN, by pressing right alt + P, it will initiate PAGE UP function, and pressing right ctrl + P, it will initiate PAGE DOWN. In theory, you can have limitless function for one key.

This post has been edited by faridr: Jun 8 2014, 07:55 PM
TSfaridr
post Jun 8 2014, 06:45 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
I've got a reply from Ms Tong from Oh Tung Sang Hardware for aluminium lasercut, based on matt3o brownfox. Total is less than rm200, seems quite reasonable brows.gif

Price breakdown using aluminium:
1.5mm Plate with top cover - RM90
1.5mm (might change to 1mm) Bottom plate - RM23
3mm thickness for middle part -RM28/pc, can add more for height adjustment, minimum 3x3=9mm

Price for stainless steel is abit more expensive, no idea on acrylic, still waiting for final quotation.

Minimum height for handwiring is 9mm inside the case as I've calculated, but have to do some proper wiring. Best is around 10-13mm space inside the case. I opted for 3mm x3 plate since its cheaper compared to 9mm thickness, and you can always adjust the height by adding or removing the plate.

The screw hole is designed for M3 screw (3mm diameter screw), 1.5mm + 9mm + 1mm = 11.5, so minimum screw height is 13mm.

Update 2:

user posted image

Finish with CAD design, print 1:1 scale, and everything fits alright. Best to use 1mm-2mm cardboard for easier cutting. From the picture, the gap between keys are uneven, but this is due to my bad hand cutting technique.

This post has been edited by faridr: Jun 11 2014, 01:30 PM
TSfaridr
post Jun 11 2014, 10:05 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Custom Case and Plate CAD Design

**Warning: only tested on 1:1 scale printing, final lasercut still in process**
- I know I havent done with lasercut, slow reply from lasercut company tongue.gif , but since I have time to spare, I'll write the guide first. Will update if there's any changes.
- This is based on matt3o CAD design, but I've added design kit for quick and simple design process
- The guide will be on designing the plate using starter kit, calculating distance, moving by distance, just the basic. Building the case, 1:1 scale printing will be in video in my gdrive link below.
- Stick with 1.5mm plate size so you can mount switch and stabilizer easily.
- Cherry switch requires 6.8mm of space inside, and teensy around 6mm. Minimum suggested height is 9mm, where teensy will be mounted under spacebar.
- Stabilizer hole will only fit costar stabilizer. Cherry stabilizer requires more precision, so its harder to be done.
- The redline in this CAD design is just a reference point, must be deleted after completion
- Feel free to ask any question, help or checking of CAD design, I'll be more than happy to help. Just dont ask for design from scratch since I've put and effort into this kit. Took me 2 days to learn CAD, so can others nod.gif

Two choice for designing keyboard layout:
1. Keyboard Layout Editor
2. Keyboard template courtesy of matt3o. Go to this link, save as, then open using Inkscape or any vector drawing software.

gdrive file link: here (last updated on 11/6/14)
to open Starter-kit.dwg, download Draftsight free edition


Plate Design
user posted image
Preview : This is the view of the kit, and my setting at the bottom

user posted image
1. Select the whole of top left by left clicking
tip: dont have to hold left click, just click at one end, and click again at another end

user posted image
2. Right click and select copy, or ctrl+c

user posted image
3. Right click and paste (or ctrl+v) and put it at any empty space. For this guide, I'll be making poker 2 plate.

user posted image
4. Go to key layout kit, and since poker 2 top left button size is 1u, select 1u size. Right click and select copy with reference point

user posted image
5. Hover mouse to the redline, close to the end, and it will snap automatically. Left click to confirm selection.
tip: hovering close to the redline end for around 2 sec will display End Point popup similar in the picture. Just to be sure.

user posted image
6. Paste and the pasted design will appear with the reference point selected as it axis. Move it to the top left in step 1, aligning the redline at the top left with the pasted design.

user posted image
7. Continue doing the same thing in step 6.

user posted image
8. Since the 14th button in poker 2 uses 2u size, select 2u size and repeat copy with reference point step

**Continue in next post due to picture limitation**

This post has been edited by faridr: Aug 6 2014, 07:57 PM
TSfaridr
post Jun 11 2014, 11:03 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
user posted image
9. After button placement is complete for first row, select top right design , copy with reference point, and select the point as in the picture above.

user posted image
10. Paste it and align the reference axis with the premade key layout redline as in picture.

user posted image
11. For designing second row, select row minimum key spacing, copy with reference point, and choose the top end point.

user posted image
12. Paste it at the top end of redline on previous row key.

user posted image
13. The result after all key has been placed. Click on line icon somewhere top left, And just combine the line between top left and top right design kit. Do the same with the rest.
tip: You'll notice the dotted line, that will appear automatically to show that its a straight line.

user posted image
14. After the design is complete, delete all the redline.
tip: sometimes after deleting, the line is still there, delete again till its gone. This is due to copy and paste method, so there's a few layer of the same line.
tip 2: even after deleting few times, line still there, just spam esc key and try deleting again.

user posted image
15. And here it is, a complete Poker 2 plate. Ready to be send out to shop for cutting.

TSfaridr
post Jun 11 2014, 11:28 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Calculating Diameter and Distance

- This is just some extra knowledge that might be useful for creating you own design
- The unit use in this calculation is milimiter (mm)

Calculating Diameter

user posted image
1. Click on dimension tab, and choose diameter

user posted image
2. Click on the circle, and the diameter size will be shown, zoom using scroll mouse.


Calculating Linear line distance

user posted image
1. Click on dimension tab, and choose linear

user posted image
2. Click on the first line, and then to the second line, the distance will be shown.



Move using distance

- Method for moving any selected design/object by entering the distance

user posted image
1. Get the linear distance between two object. In picture above its 81.1452mm. Our goal is to change the distance to 90.0000mm

user posted image
2. Select the object to be moved, right click and select move

user posted image
3. Click at the point which were used in step 1, as distance were calculated from that point.

user posted image
4. Press and hold left shit, and right click. A menu will appear, click on from

user posted image
5. Two different step here:
- Click again on the same point as previous step.
- On bottom left, enter the distance here by adding @X,Y. The distance is in X,Y coordinate from the point clicked. Moving to the left requires negative symbol.
To get the X distance, 90.0000 - 81.1452 = 8.8548.
Y coordinate distance is 0 since we are not moving it up or down
Base point(Offset)@-8.8548,0
Press enter to end this X,Y math lesson.

user posted image
6. Get the liner distance again. TADA!

This post has been edited by faridr: Jun 11 2014, 12:35 PM
TSfaridr
post Jun 11 2014, 11:30 AM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Move object to midpoint between two object

- I use this method to place the keys when making starter kit. Not sure if this ever needed, but just for extra knowledge.

user posted image
1. Aim is to place that box in the middle of the other two boxes.

user posted image
2. Select the box to be move, right click and choose move. Hover (dont click) for 2-3 seconds at each side to get mid point reference

user posted image
3. Move mouse to the middle of the box, Draftsight will automatically provide a reference to the middle of the box. Left click in the middle of the box

user posted image
4. Press and hold shift, and right click, a menu will appear, choose mid between 2 points

user posted image
5. Click on the left side of the box on the right.

user posted image
6. CLick on the right side of the box on the left

user posted image
7. And tada! Just to be sure, use linear dimension in previous guide to check the distance

This post has been edited by faridr: Jun 11 2014, 01:00 PM
ainuddin
post Jun 11 2014, 01:41 PM

September 11th, 2001
******
Senior Member
1,957 posts

Joined: Jul 2008
waiting for futher updates faridr. you should open this thread in geekhack as well, to share your awesome work.
TSfaridr
post Jun 11 2014, 08:00 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
QUOTE(ainuddin @ Jun 11 2014, 01:41 PM)
waiting for futher updates faridr. you should open this thread in geekhack as well, to share your awesome work.
*
matt3o is actually in the process of making the same thing for CAD design, as I just found out. So its better for him with more experience to do it on geekhack. He told me that he'll be sending a few more references, due to few variation with laser cut machine which may vary, so have to wait for that.
dadudeneverabides
post Jun 17 2014, 01:04 PM

Mechanical Kuda Ping Keyboard
******
Senior Member
1,105 posts

Joined: May 2009
From: On the computer


Bro, any update on the case?
yukihatsu
post Jun 21 2014, 12:48 AM

On my way
****
Senior Member
672 posts

Joined: Dec 2006
Dude, much respect. What a project you have there. thumbup.gif
TSfaridr
post Jun 21 2014, 09:21 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
Custom Casing Production

Completed my casing, although the casing is solid, the quality control of the company is bad, as there's lots of scratch on aluminium part, and acrylic had burn laser mark spot on it. My mistake for not checking on the spot because I was trying to beat rush hour traffic. Thankfully the company will replace the acrylic part with laser burn mark. As for aluminium, I actually have to ask for polishing service, but the company did not inform me before this.

Here is few tips for anyone wanting their own case:
- Ask for 6061 and 7075 type aluminium (tips from ainuddin, thank you bro smile.gif)
- Make sure they include polishing service
- For colour, choose anodizing method, not spray paint
- Always go for company that interested to help (who will personally call and check your design)
- And if it just a standard layout, just go for ready made case, less hassle. Unless you still want custom case whistling.gif

And here is the few places to get started:
laser cut and CNC milling (company I use not included)
- Ng Kah Weng (0193318728), kajang
- Oh Tung Sang, Ms Tong (016-2087161), kepong

Screws (unless you have luck with normal hardware store)
- Advance bolts supplies , seri kembangan (50set of 16mm m3 screw nuts + bolt for less than RM2...)

And here is the end result

user posted image

user posted image
Scratches, scrathes everywhere vmad.gif vmad.gif vmad.gif vmad.gif vmad.gif vmad.gif

user posted image
Really? 18 years of experience? whistling.gif

user posted image
Top part + switch mount

user posted image
Brushed effect using sand paper to cover up scratches

user posted image
Still few visible scratch, need to get more sand paper, PITA to sand aluminium


13th
post Jun 26 2014, 09:30 PM

rakshaha
***
Junior Member
413 posts

Joined: Sep 2008
this is awesome!! i really admire your work. keep it up
KUROsaki23
post Aug 12 2014, 11:55 AM

Casual
***
Junior Member
330 posts

Joined: Sep 2007
woah so this is what u mean, damn, too much respect bro
ectt
post Aug 27 2014, 03:48 AM

Regular
******
Senior Member
1,049 posts

Joined: Apr 2012


QUOTE(faridr @ May 24 2014, 08:07 AM)
Part 6: Defining key matrix

1st step
And now, a little bit confusing part, in defining the function of key mapping. I havent finalized this part especially for the fn second layer function, as I'm waiting for my keycap. But the normal keyboard qwerty asdfg zxcvb is already coded and working fine.

I've open keymap_common.h file in the same gh60 directory and look for #define KEYMAP function. Here is the original code

CODE
#define KEYMAP( \
   K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
   K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
   K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
   K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
   K40, K41, K42,           K45,                K49, K4A, K4B, K4C, K4D  \
) { \
   { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \
   { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \
   { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \
   { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \
   { KC_##K40, KC_##K41, KC_##K42, KC_NO,    KC_NO,    KC_##K45, KC_NO,    KC_NO,    KC_NO,    KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D }  \
}


My first reaction was watef*** is this. After further reading, this part is actually simple, though requires lots of attention.
What you see here is the layout design of each keyboard key, and the view is from the top, where all the letters and numbering will be.
Lets take K00 and K12 for example. In K00, the first 0 is for the row, and the second 0 is for the column. So for K12, its mean row 1 columns 2.
Notice that there's no K43, this is due to empty slot in gh60 pcb. K42 is basiccaly alt key, and k45 is spacebar key.

As the program use hex/binary or whatever computer instruction is, the numbering start from 0 till 9, then A, B, C... . Basically A = 10, B = 11, C = 12 and so on. And remember to add comma( , ) and blackslash ( \ ) at the end, and only backslash ( \ ) at the last keyboard layout, as shown in the default code.

Now the second part of the code, its still the same thing, same logic, except that unused slot has to be declare by putting KC_NO.

For my scrappy banger keyboard, since I use a different wiring from gh60 pcb, I've made changes. Forget all the previous numbering method to avoid confusion. I took a look at bottom layout of the keyboard and wiring.
user posted image

And the view of top part, remember that when you flip from bottom to top view and vice versa, you have make sure of the numbering. Notice the location of K00 and K0D between bottom and top view.
user posted image

And here is my final code for my scrap banger
» Click to show Spoiler - click again to hide... «


******************************** ONLY DO THIS PART IF THERE IS COMPILING ERROR DURING MAKEFILE (in last part)********************

According to matt30, #define KEYMAP_ANSI function can be ignored and no change is needed. But during my compilation of the code, there was lots of error preventing compilation, and log shows that the error comes from function in #define KEYMAP_ANSI , as there is conflict in layout. So I beg to differ, change needed  tongue.gif

So I copy the code from #define KEYMAP function, and paste the whole thing at #define KEYMAP_ANSI . Just copy the content, dont change the function name. This was the changes I've made.

» Click to show Spoiler - click again to hide... «


*****************************************************************************************************************************

2nd step
Now time to define what each key does smile.gif And there is no limitation, what each key does is up to you. As I use Poker 2 layout, I'll be using keymap_poker.c file. Other like keymap_hhkb.c , keymap_hasu.c and so on can also be use, depending on which code suit the keyboard design best.

I would suggest a read on matt3o guide in defining the layout part too as this part are usually comes down to own preferences.

I've made my keymap here, although its a little bit harder to explain, but I'll try my best.
3rd and final step  laugh.gif

Now its time to compile the code and flash it to teensy. I use Windows 8.1 in compiling and WinAvr need to be installed (refer to part 5 for link and fix). After installation, fire up command line console, and then navigate to gh60 folder, and I've compiled the code by typing make -f Makefile

user posted image

No compilation error, yaaaaay!. I navigate back to gh60 folder, and there it is,  gh60_lufa.hex  drool.gif  drool.gif  drool.gif

To finish it up, I connect the teensy to PC using mini usb to usb cable (the same adapter on you external hdd), load up teensy loader.
user posted image

Now to complete the process, I just press the tiny winnie button on teensy, click the auto button, and open the gh60_lufa.hex file in teensy loader. The loader then automatically flash the teensy and reboot teensy.

And for the moment of truth, I fire up notepad, and press the buttons on my scrap banger, and seeing the output on the screen..... ITS DONE! YAAAAAAAAAAY


To sum it up, this project might look complicated at first, but its actually quite do-able even for anyone without programming language background and can be completed within 1 day (took me 2 days because of my stupidity  not checking the firmware code before desoldering back the whole thing).

And you can actually make specific keyboard for specific function, for example like any game with its own specific design keyboard. Hoping that someone else with higher creativity level would come out with their own keyboard design, as this is just a base experiment and guidelines.
*
well done thumbup.gif
interesting
perhaps can supply you many mechanical switch later thumbup.gif

TSfaridr
post Aug 27 2014, 10:53 PM

Getting Started
**
Junior Member
214 posts

Joined: May 2011
From: here
QUOTE(ectt @ Aug 27 2014, 03:48 AM)
well done  thumbup.gif
interesting
perhaps can supply you many mechanical switch later thumbup.gif
*
Becoming cherry distibutor?
Although for now I have more than enough keyboard, but then everytime last keyboard tapi end up getting another one again laugh.gif

 

Change to:
| Lo-Fi Version
0.5660sec    0.68    5 queries    GZIP Disabled
Time is now: 15th December 2025 - 12:38 PM