Author Topic: Help Picking a Microcontroller  (Read 9724 times)

0 Members and 1 Guest are viewing this topic.

Offline Adlaiunm

  • Thread Starter
  • Posts: 1
Help Picking a Microcontroller
« on: Mon, 25 July 2016, 20:52:03 »
Hello everyone!

I'm new to geekhack and DIY keyboards in general, and I don't have a lot of knowledge about the parts typically used. Right now, I'm working on designing a really simple 2 key keyboard for osu!. It seems like it would be extremely easy to do with a Teensy or a Pro Micro, both of which are very cost effective. Considering a Teensy can support a matrix for an entire keyboard, using one for a mere 2 keys seems like a waste. Is there a microcontroller better suited for small projects? How about the cheapest one on the market that can be used to make a HID?

I apologize if this seems kind of vague. I don't really know what specific information I need to provide.

Anyways, thank you very much for your help! As soon as I have all of my parts picked out, I will take some pictures of the build process and maybe even make a tutorial.

Offline QuincyJones

  • Posts: 270
  • Location: The Greatest Of Them All, England
Re: Help Picking a Microcontroller
« Reply #1 on: Tue, 26 July 2016, 01:46:49 »
what's osu?
SENT FROM MY TRKA-100-ULTRA-PRO-1R WITH FLASHY MULTI-COLOURED LEDS FOR MEGA ULTRA COOLNESS
(please like me)

       

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Help Picking a Microcontroller
« Reply #2 on: Tue, 26 July 2016, 02:30:09 »
what's osu?

Cheap often means a Chinese clone, not necessarily a good idea.

An attiny85 can be used as an HID device using v-usb, Adafruit's Trinket is readily available and only $7 and there's a tutorial here - cheap and easy enough for a first project? :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline kawasaki161

  • Posts: 1059
  • Location: Germany
Re: Help Picking a Microcontroller
« Reply #3 on: Tue, 26 July 2016, 06:18:11 »
How professionally do you want to make it look?
If you just want 2 buttons and no light effects like on the osu!nono keyboard you could just pick up an old rubberdome board with ps/2 connector (go to a local recycling center, usually you can get one for free or basically free there) and use the controller from that one, just wire up your switches to it and you are in full ghetto mode. Here is a small Tutorial I found a while back: http://imgur.com/a/vwSyf.

For anything more professional the, already mentioned, Trinket should be one of the best solutions, especially with the huge amount of resources available.

Offline kolec94

  • Posts: 111
Re: Help Picking a Microcontroller
« Reply #4 on: Tue, 26 July 2016, 08:16:02 »
trinket or stm8 would probably be your best option or a arduino nano would work to
anything with 1 gpio and a usb will work though
check this out
http://kimondo.co.uk/smallest-usb-mechanical-keyboard-world/
« Last Edit: Tue, 26 July 2016, 10:10:48 by kolec94 »

kbparadise v60 blues

Offline tinyenormous

  • Posts: 27
Re: Help Picking a Microcontroller
« Reply #5 on: Wed, 31 August 2016, 17:55:40 »
The one benefit of getting a teensy over the trinket is that you could reuse the teensy to make a bigger board later on, where the trinket is limited to a much smaller max # of keys. Other than possible reuse in the future, you should let your budget be your guide. $8 vs $20 is close enough I'd upgrade, but they will both work.

Side note - has anyone used a trinket? It has 5 io pins, but 2 are shared with usb, so it seems that if you were using usb you would be limited to 3 pins. 3 pins is a max of 2 keys, right? 1x2

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Help Picking a Microcontroller
« Reply #6 on: Wed, 31 August 2016, 18:15:56 »
3 pins all connected to ground or 5v would be good for 3 switches :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline tinyenormous

  • Posts: 27
Re: Help Picking a Microcontroller
« Reply #7 on: Wed, 31 August 2016, 18:36:19 »
That's 50% more than my guess! Score!

Offline vextanys

  • Posts: 40
Re: Help Picking a Microcontroller
« Reply #8 on: Thu, 01 September 2016, 03:32:39 »
The cheap Arduino clones (make sure its a 32U4, not 328P) are pretty good and cheap. Last I bought was about £1.50 + as much again in postage - definitely cheaper, but took about 3 weeks to deliver (so cheap I've ordered more than I've got uses for at the moment)
Quality wise, I've bricked 1 of 4 or 5, and the PCBs cuts are poor, but fully functional (I think the bricking was my fault)

Offline plainbriny

  • Posts: 192
  • Location: Taiwan
Re: Help Picking a Microcontroller
« Reply #9 on: Thu, 01 September 2016, 06:49:19 »
Here is a two-key keyboard using a Digispark clone.

147091-0

Digispark and it's clones are much cheaper than trinket here, <$5 each.
I use two pins, and with some trick you can input 3 to 4 keys with it.
(1: A, 2: B, 1+2: C)

I prefer trinket's USB code, but it is larger than that in digispark, and it's way more expansive than digispark clones.

147093-1

Offline jaffers

  • Posts: 611
Re: Help Picking a Microcontroller
« Reply #10 on: Thu, 01 September 2016, 07:07:11 »
Hmmm not sure if you could almost use an IC clocked by the USB itself to power something like a 2 key circuit. I mean, you would only need 4 pins for the entire thing. If not, china is bursting at the seams with cheap cheap cheap MC's. Check out gearbest or aliexpress for all that stuff, element14/digikey/etc if you dont want to wait

Not sure how new you are to circuit design but if you are fresh to all this jazz, I'd go with something that is arduino compatible. It's sooo simple and easy and there isn't too too much that you need much more advanced functionality
« Last Edit: Thu, 01 September 2016, 07:12:30 by jaffers »

Offline kolec94

  • Posts: 111
Re: Help Picking a Microcontroller
« Reply #11 on: Thu, 01 September 2016, 08:33:49 »
for 2 keys i would use a attiny mcu

kbparadise v60 blues

Offline rvense

  • Posts: 6
Re: Help Picking a Microcontroller
« Reply #12 on: Thu, 01 September 2016, 15:53:54 »
My perspective on this is a little different: The time you spend on it is going to be most expensive part of the project, so there's little need to save a few dollars on the microcontroller (I say that without knowing your situation, of course, but I imagine that's true for most people). The Teensies are by all accounts very easy to work with and playing with one of them them would mean learning something that would prepare you better for other, bigger projects.

Offline wolfv

  • Posts: 269
Re: Help Picking a Microcontroller
« Reply #13 on: Wed, 28 September 2016, 17:17:29 »
I'm new to geekhack and DIY keyboards in general, and I don't have a lot of knowledge about the parts typically used.
Hi Adlaiunm,

This series of tutorials is the easiest way to learn keyboard electronics and firmware:
 https://github.com/wolfv6/keybrd/tree/master/tutorials
Start with tutorial_0_introduction.md

This series of tutorials builds simple keyboards on a breadboard.
The beauty of using a breadboard is that when you're done learning and prototyping, use can pull the Teensy processor out of the breadboard and put it on a different keyboard.
Parts are listed on breadboard_keyboard_supplies.ods
« Last Edit: Wed, 28 September 2016, 18:12:39 by wolfv »

Offline hanya

  • Posts: 132
  • Location: Japan
Re: Help Picking a Microcontroller
« Reply #14 on: Wed, 28 September 2016, 21:37:09 »
I'm trying to use EFM8UB1 series for my 2 keys keyboard. They have 8K and 16K SROM variation.
The series have internal 5V to 3V3 regulator and USB function. The manufacturer provides keyboard example shares around 5K bytes ROM.
I tried to add fucntion to change keycode assigned through USB configuration request. I shares 8100 bytes (98.9% of SROM).
If I can use EFM8UB10F8G-C-QFN20(8K SROM), it cost only $0.86 per 1 MCU.
Oops, I forgot about pre-programmed bootloader shares last 3 pages (1.5K), so I have to keep the code below 6.5K bytes if I need to keep the bootloader. Since I could not solder QFN package myself, I would choose EFM8UB11F16G-C-QSOP24 which has 16K ROM.
PFU HHKB JP, Sanwa MA-TB38 trackball

Offline rowdy

  • HHKB Hapster
  • * Erudite Elder
  • Posts: 21175
  • Location: melbourne.vic.au
  • Missed another sale.
Re: Help Picking a Microcontroller
« Reply #15 on: Fri, 30 September 2016, 05:47:34 »
Welcome to Geekhack!

if you choose a Teensy, you'd be climbing on the shoulders of years of experience using them, especially for keyboards.

You will gain experience in a professional and flexible keyboard interface, which may be invaluable for your next, perhaps larger, keyboard project.

And if you decide to disassemble the one you are making now, you will be able to readily reuse the parts.
"Because keyboards are accessories to PC makers, they focus on minimizing the manufacturing costs. But that’s incorrect. It’s in HHKB’s slogan, but when America’s cowboys were in the middle of a trip and their horse died, they would leave the horse there. But even if they were in the middle of a desert, they would take their saddle with them. The horse was a consumable good, but the saddle was an interface that their bodies had gotten used to. In the same vein, PCs are consumable goods, while keyboards are important interfaces." - Eiiti Wada

NEC APC-H4100E | Ducky DK9008 Shine MX blue LED red | Ducky DK9008 Shine MX blue LED green | Link 900243-08 | CM QFR MX black | KeyCool 87 white MX reds | HHKB 2 Pro | Model M 02-Mar-1993 | Model M 29-Nov-1995 | CM Trigger (broken) | CM QFS MX green | Ducky DK9087 Shine 3 TKL Yellow Edition MX black | Lexmark SSK 21-Apr-1994 | IBM SSK 13-Oct-1987 | CODE TKL MX clear | Model M 122 01-Jun-1988

Ị̸͚̯̲́ͤ̃͑̇̑ͯ̊̂͟ͅs̞͚̩͉̝̪̲͗͊ͪ̽̚̚ ̭̦͖͕̑́͌ͬͩ͟t̷̻͔̙̑͟h̹̠̼͋ͤ͋i̤̜̣̦̱̫͈͔̞ͭ͑ͥ̌̔s̬͔͎̍̈ͥͫ̐̾ͣ̔̇͘ͅ ̩̘̼͆̐̕e̞̰͓̲̺̎͐̏ͬ̓̅̾͠͝ͅv̶̰͕̱̞̥̍ͣ̄̕e͕͙͖̬̜͓͎̤̊ͭ͐͝ṇ̰͎̱̤̟̭ͫ͌̌͢͠ͅ ̳̥̦ͮ̐ͤ̎̊ͣ͡͡n̤̜̙̺̪̒͜e̶̻̦̿ͮ̂̀c̝̘̝͖̠̖͐ͨͪ̈̐͌ͩ̀e̷̥͇̋ͦs̢̡̤ͤͤͯ͜s͈̠̉̑͘a̱͕̗͖̳̥̺ͬͦͧ͆̌̑͡r̶̟̖̈͘ỷ̮̦̩͙͔ͫ̾ͬ̔ͬͮ̌?̵̘͇͔͙ͥͪ͞ͅ

Offline Greywolf

  • Posts: 14
Re: Help Picking a Microcontroller
« Reply #16 on: Sat, 23 November 2019, 18:12:55 »
Hey there, all,

I am interested in designing my own keyboard, but unlike going for the uber small ones, I wish to to design an 87-key, so I'm looking for a suitable microcontroller by which to do so...

If I were to use an atmega32u4 which seems to head toward a 15x5 space, wondering what I could get away with by migrating to a 13x7 space and what impact that would have on the design...

[alternate plans for separate 10-key [RHS] and 6x2 (or 6x4) auxiliary key [LHS] keyboards are also on the plate.]

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Help Picking a Microcontroller
« Reply #17 on: Sat, 23 November 2019, 20:30:47 »
If you don't have all the keys in each row and column on the same pin it's harder to work out the wiring but it will work fine.  If you need/want more pins the chip on the Teensy 2.0++ is supported in all firmwares so that could be a better choice, don't know the name off the top of my head.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod