geekhack
geekhack Projects => Making Stuff Together! => Topic started by: variab1e on Thu, 16 March 2017, 09:45:26
-
I am looking to handwire a keyboard (almost a full keyboard) where the columns + rows will be greater than the 17 pins I have available on my Feather BluFruit 32u4. To my understanding I must have the same (or greater) number of pins on the controller as there are columns + rows. So what solution is there?
A i/o expander?
Or to make 2 columns on a single wire?
Any ideas? I'm sure this has been encountered and solved before. Any help is very much appreciated! Thanks!
-Eric
-
2 columns on a single wire will increase the number of rows, so that would not really work either. i/o expander is probably the way to go with the feather
-
It depends on the layout.
A 60% is 15 columns 5 rows. 15 * 5 = 75. But that's quite a few more keys than you need.
So a 60% can be 8 columns 8 rows. 8 * 8 = 64. That's just enough keys for a 60%
-
If your keyboard has more than 8*9=72 keys then read read this:
http://www.openmusiclabs.com/learning/digital/input-matrix-scanning/
... and select the method you like most.
-
Why does a 32u4 board only have 17 pins?
As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.
The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.
I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.
-
Why does a 32u4 board only have 17 pins?
As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.
The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.
I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.
The board he is using has BLE built in and some of the pins are dedicated to that.
-
Why does a 32u4 board only have 17 pins?
As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.
The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.
I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.
The board he is using has BLE built in and some of the pins are dedicated to that.
Ah, interesting.
OP you may find it easiest to look into using TRRS (check out the Let's Split) and having one controller for BT and one controller for actually reading the matrix. This would give you plenty of pins.
-
Why does a 32u4 board only have 17 pins?
As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.
The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.
I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.
The board he is using has BLE built in and some of the pins are dedicated to that.
Correct - I'm using this board for the Bluetooth capability.
Would you happen to know of a GPIO expansion option for the greater?
-
Why does a 32u4 board only have 17 pins?
As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.
The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.
I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.
The board he is using has BLE built in and some of the pins are dedicated to that.
Ah, interesting.
OP you may find it easiest to look into using TRRS (check out the Let's Split) and having one controller for BT and one controller for actually reading the matrix. This would give you plenty of pins.
Ah, maybe using the Teensy2.0++ with an SPI bluetooth module? Would something like the Adafruit SPI bluetooth work (https://www.adafruit.com/products/2633)?
-
Ah, maybe using the Teensy2.0++ with an SPI bluetooth module? Would something like the Adafruit SPI bluetooth work (https://www.adafruit.com/products/2633)?
That board is the same module that is on the feather. It should work the same connected to the SPI bus. The feather is nice though since it also incorporates the lipo charger. If you can fit your matrix in 17 pins or add an io expander you could still use the feather.
-
Ah, maybe using the Teensy2.0++ with an SPI bluetooth module? Would something like the Adafruit SPI bluetooth work (https://www.adafruit.com/products/2633)?
That board is the same module that is on the feather. It should work the same connected to the SPI bus. The feather is nice though since it also incorporates the lipo charger. If you can fit your matrix in 17 pins or add an io expander you could still use the feather.
a-c have you used the feather? Any recommendations for an i/o expander?
Right now I'm at 18 rows and 6 columns. So I need a few more...
Maybe something like this (http://www.mouser.com/ProductDetail/Cypress-Semiconductor/CY8C9540A-24PVXI/?qs=sGAEpiMZZMuFG5L82ZqpsiCt2WeF4X3ZE%252bhO4GSQCSI%3d), 40 I/O over I2C
-
Take a look at https://deskthority.net/wiki/Costar_replacement_controllers (https://deskthority.net/wiki/Costar_replacement_controllers)
He uses binary to decimal decoders. Very simple and requires little code.
-
The link I posted contains many ways how to do it. I prefer shift registers myself. Cheap chips and easy to handle in firmware.