geekhack

geekhack Projects => Making Stuff Together! => Topic started by: help-14 on Thu, 09 June 2016, 07:59:06

Title: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Thu, 09 June 2016, 07:59:06
I'm new to kicad and PCB design, working on my first custom TKL keyboard. The problem is I don't know which controller should I use. The TKl have 6 rows and 17 columns, plus 3 pin for RGB led so I need at least 26 pins, ATMEGA32U4 is only have 20 digital pins :(

(https://scontent-hkg3-1.xx.fbcdn.net/t31.0-8/13350512_10208653176900360_6922976466881285036_o.jpg)
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: suicidal_orange on Thu, 09 June 2016, 11:50:46
If you're making your own PCB the 32u4 has 26 I/O pins as stated on the Atmel webpage (http://www.atmel.com/devices/ATMEGA32U4.aspx), the analogue inputs and pins with special features can be used as digital ones :)
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Thu, 09 June 2016, 12:30:03
Oh, thank for your answer. When googling ATMEGA32u4 I saw it said 20 digital pins, didn't know other pins can be use as digital too  ;D
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: Findecanor on Thu, 09 June 2016, 20:20:06
You could optimize the number of pins needed by making the logical matrix closer to a square.
A typical ANSI TKL has 87 keys. 9×10 or 8×11 would need 19 pins.
The downside is of course that it would make routing and programming a little bit more difficult.
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Fri, 10 June 2016, 02:05:34
Another question, can I use this to control the keyboard? I mean I'll use this design controller for GMK firmware.

(http://i.imgur.com/Alub4Br.png)
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: suicidal_orange on Fri, 10 June 2016, 02:24:54
I don't know what all that extra stuff is but Port B.1, 2 and 3 are three of the special pins you need for I/O and they're being used to connect to another chip, so you can't use this schematic.  Unless you just mean the USB part?  That should work...
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Fri, 10 June 2016, 02:39:26
Do you happed to have a schematic that I can use :D
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: suicidal_orange on Fri, 10 June 2016, 02:51:10
The GH60 (http://blog.komar.be/wp-content/uploads/2013/02/gh60_revC_2016-06-02.pdf) doesn't have anything extra, but it does have expansion headers at the top, bottom and on the left side.
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Fri, 10 June 2016, 02:53:10
Thanks, I'll study it.
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Fri, 10 June 2016, 23:13:53
@suicidal_orange : I did some research and write down the digital code to the pins, but I can only found 24 of them. You said some special port can be use too so which are the last two :D

(http://i.imgur.com/0SOxGla.png)
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: suicidal_orange on Sat, 11 June 2016, 02:53:09
I didn't say it, the datasheet did :p

Having just woken up inverting the pinout on a tiny screen is not going well, I've spotted 22 as one of them but can't see the other - figure 2 here (http://www.brck.com/2014/05/the-brck-gpio-expansion-datasheet/#.V1u-1kzTXqA) has 26 pins labelled PAx so it's whichever of them you've not used.
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Sat, 11 June 2016, 13:36:14
It is the pin 22 :D
Just done wiring all the stuff, re-check twice, now print and test :D https://github.com/help-14/tkl-mechkey (https://github.com/help-14/tkl-mechkey)

(http://i.imgur.com/Uv9XPT8.png)
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: suicidal_orange on Sat, 11 June 2016, 13:39:56
You said you'd only found 24 pins, plus pin 22 you're still missing one? :confused:

Also 'print and test', you're etching it yourself?!
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Sat, 11 June 2016, 13:44:26
I asked Moz and he said there are only 25 pin available. So I re-wiring the last column and made it a row, so I can have the last pin for RGB.
I'l send it to printing shop, can't do it myself :v

(http://i.imgur.com/BHG1cG9.png)
Title: Re: [Question] Which controller should I use for a custom TKL
Post by: suicidal_orange on Sat, 11 June 2016, 13:55:59
Ah that makes sense, a DIY RGB PCB would be quite something!

How do Atmel get away with that false advertising though, is that not a thing in the US?  I thought you'd have bought 100, found them unsuitable for purpose, then sued for emotional distress :))

Title: Re: [Question] Which controller should I use for a custom TKL
Post by: help-14 on Sat, 11 June 2016, 14:04:40
Haha, maybe it is 26, but Moz said I shouldn't use port 33  :p But who care, i'll call my lawyer  :cool: