geekhack

geekhack Projects => Making Stuff Together! => Topic started by: Melvang on Sat, 20 September 2014, 20:34:35

Title: Teensy for larger keyboards
Post by: Melvang on Sat, 20 September 2014, 20:34:35
So I am planning on using a Teensy for building up a WYSE and an Apple AEK II.  The Wyse is a 101 key layout and the AEK II is 105.  For this I was planning on using a hand wired 10x11 matrix.  I realize that I will have to get a bit creative with rows and columns. 

But my biggest question is aside from GND, VCC at the USB port end and VCC, GND, and RST which leaves 26 pins left, are there any of these that simply can't be used for connecting the matrix or indicator LED's? 

If the ones aside from what I listed can all be used, a 10x11 matrix plus 3 pins for LED's (correct me if I am wrong on number of pins for indicator LEDs) can be achievable and still have 2 pins leftover. 

Help in this would be greatly appreciated.  I am confident that I can do the physical assembly once I get details such as this sorted out.
Title: Re: Teensy for larger keyboards
Post by: plainbriny on Sat, 20 September 2014, 20:49:38
You can use an I/O expander.

The ergodox design use one to simplify the connection between the two halves. However, you can also use it to expand the number of I/O pins.
Title: Re: Teensy for larger keyboards
Post by: Melvang on Sat, 20 September 2014, 20:56:49
You can use an I/O expander.

The ergodox design use one to simplify the connection between the two halves. However, you can also use it to expand the number of I/O pins.

How much of a change in the code would it take to use one of these? 

Electronics is not a very strong suit of mine.  Really I just know how to use the tools to build a keyboard so if I just have to do some funny stuff with columns and rows and not have to use an I/O expander that would be great.
Title: Re: Teensy for larger keyboards
Post by: jacobolus on Sat, 20 September 2014, 22:30:45
From my count there are 25 digital I/O pins on a Teensy 2.0:
http://www.pjrc.com/teensy/card2a.pdf
Title: Re: Teensy for larger keyboards
Post by: dorkvader on Sat, 20 September 2014, 23:45:54
From my count there are 25 digital I/O pins on a Teensy 2.0:
http://www.pjrc.com/teensy/card2a.pdf

that's right. Only one of the interior pins is usable.

I think soarer's code supports IO expanders. ergodox supports it, but the scan rate of the other half is really low.
Title: Re: Teensy for larger keyboards
Post by: Melvang on Sat, 20 September 2014, 23:50:38
Ok so 10x11 matrix is workable.  So for 3 indicator LED's for caps, num, and scroll locks, I would need 4 pins, correct?  The thought here is one common and a 3 discrete, one for each LED which brings me up to 25 pins so I would be maxed out but workable for 111 keys max including 3 LED's.  Is my logic here correct?
Title: Re: Teensy for larger keyboards
Post by: Igthorn on Sun, 21 September 2014, 00:01:55
For LEDs you only need 3.  A pin for each then you would use GND or VCC depending on how you want to supply current to them.
Title: Re: Teensy for larger keyboards
Post by: vvp on Sun, 21 September 2014, 03:19:12
You can add one more led or a buzzer :)
If one does not need to minimize lines to the other half (e.g. because the whole keyboard is in one piece) and all the switches have a diode then a shift out register (http://www.openmusiclabs.com/learning/digital/input-matrix-scanning/shift-out-mux/) is a better option than an IO expander.
Title: Re: Teensy for larger keyboards
Post by: admiralvorian on Sun, 21 September 2014, 12:47:00
Why not use a teensy++?
Title: Re: Teensy for larger keyboards
Post by: Melvang on Sun, 21 September 2014, 14:55:39
Why not use a teensy++?

Because I already have a couple 2.0's but one has a lifted pad.