1
\$\begingroup\$

I'm a beginner in electrical engineering but I'm into mechanical keyboards and I want to build a keypad (1 row, 6 cols).
I recently wrote a macro for a keyboard (ATmega32U4 microcontroller) using the QMK Firmware and I'd like to restart from there.

What microcontroller should I use to build this keypad and what resources or open-source projects should I look at to get there?
I prefer the AVR family since I'm more familiar with but any advice is helpful at this point!

Thank you.

\$\endgroup\$

closed as off-topic by Andy aka, Chris Stratton, laptop2d, DoxyLover, PeterJ Jun 3 '18 at 13:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    \$\begingroup\$ Any micro at all would do what you want providing it has 6 pins free for the 6 buttons. \$\endgroup\$ – Andy aka Jun 1 '18 at 15:37
  • 2
    \$\begingroup\$ I mean, if you are using QMK, you should use one of the controllers it supports. Its in the documentation: docs.qmk.fm/#/hardware_avr \$\endgroup\$ – pgvoorhees Jun 1 '18 at 15:38
  • 1
    \$\begingroup\$ Also, do you care about the package? Would you prefer DIP, or is SOIC OK? presumably BGA would not be a good idea. \$\endgroup\$ – Jack B Jun 1 '18 at 15:39
  • 1
    \$\begingroup\$ @isar Don't worry about "overkill" it'll be fine. The cost of the chip will be absolutely swamped by PCBs if you have them made. If you are just going to prototype them, "surfboards" are available for most Quad-Flat pincounts. The other thing too, when you are starting out, it is better to copy and understand a design. Once you understand it, you can change it. \$\endgroup\$ – pgvoorhees Jun 1 '18 at 15:43
  • 1
    \$\begingroup\$ If you think the ATmega32u4 is overkill, but you want to keep with AVRs and you want a USB port, then the smallest/cheapest option is probably an ATmega8U2. It's about half the price, and slightly smaller. It also has about 1/4 of the flash and RAM and half the eeprom and hardware timers, and no ADCs or I2C. But still enough for what you want I expect. \$\endgroup\$ – Jack B Jun 1 '18 at 15:46
1
\$\begingroup\$

Based on you comments, it sounds like you want:

  • An 8-bit AVR, because that is what you are used to
  • A USB device port, so you can communicate with the computer
  • A cheap chip, not so much to save £1, but so it doesn't feel like overkill

You can find that by going to this page on the Microchip website (Microchip now own Atmel, and make the AVRs): https://www.microchip.com/ParamChartSearch/chart.aspx?branchID=1005

Then, in the "CPU type" box pick 8-bit AVR. Scroll across to the USB section and pick number of USB modules 1, 2 and 3, and then order by pricing. The displayed prices are only if you order 5000, so they will be a bit more expensive one at a time.

The winner on the list is the ATmega8U2. It's about half the price, and slightly smaller than the ATmega32U4. It also has about 1/4 of the flash and RAM and half the eeprom and hardware timers, and no ADCs or I2C. But still enough for what you want I expect. Second place is the ATmega16U2, which is only 16 cents more, but has quite a lot more flash. If you don't want to stick with AVRs, then the PICs are even cheaper, but probably won't work with the QMK library.

Most manufacturers who have large complicated ranges have a similar tool, and they are great for finding the right chip.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.