Author Topic: 24-pin microcontroller for handwired build?  (Read 3250 times)

0 Members and 1 Guest are viewing this topic.

Offline nalf

  • Thread Starter
  • Posts: 5
  • Location: Alberta, Canada
24-pin microcontroller for handwired build?
« on: Wed, 09 October 2019, 13:51:32 »
I am partway through a handwired build with 73 keys and i've wired the 16 columns and 5 rows. I also have 3 indicator LEDs. I have a pro micro but it doesn't have enough pins to accomodate the LEDs even if i chop up the wiring and make it a 9x9 matrix. Is there a controller that has 24 usable i/o pins? I have very little coding knowledge so I was hoping to use a controller that has some firmware already written i could use, like the pro micro. I was looking at the stm32 blue pill board, but I don't know enough about controllers to know if it will work.

Thanks for your help GH :)

Offline piit79

  • Posts: 313
Re: 24-pin microcontroller for handwired build?
« Reply #1 on: Wed, 09 October 2019, 13:58:41 »
I'm probably missing something, but 9 + 9 + 3 = 21 I/O pins?

That said, QMK Proton C Rev2 has 24 I/O pins: https://qmk.fm/proton-c/ and is now back in stock at keeb.io, 1Up etc. As the name suggests, it's supported by QMK ;)

Offline AuthenticDanger

  • Posts: 343
Re: 24-pin microcontroller for handwired build?
« Reply #2 on: Wed, 09 October 2019, 14:03:18 »
Absolute worst case, you can drop some columns and be creative with your rows to fit all the keys in. The "matrix" approach is great for visualization, but depending on your board's needs, isn't required.

I have a handwired 17col x 5row and I remember getting creative when I was wiring it up. You just have to translate your solution to your QMK config, but once it's setup, you'll likely never look at it again.
F Keys belong on the left.

Offline nalf

  • Thread Starter
  • Posts: 5
  • Location: Alberta, Canada
Re: 24-pin microcontroller for handwired build?
« Reply #3 on: Wed, 09 October 2019, 14:50:54 »
Okay thanks guys. You're right, i could do it with a minimum of 21 pins but I already wired it 16x5 and if i need to buy another controller regardless I thought I would get one which wouldn't require me to redo some of the wiring. I like the idea of the proton-c, especially the qmk part, but maybe based on shipping times ill get a teensy cause i could get one by tomorrow.

Thanks for your help guys!

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3856
  • Location: England
Re: 24-pin microcontroller for handwired build?
« Reply #4 on: Wed, 09 October 2019, 18:37:08 »
The standard response when a normal Teensy or pro micro doesn't have enough pins is the Teensy 2.0++
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod
MX Brown 30g, HHKBish
Vortex OEM PBT
for See how the other half lives challenge!

Offline gipetto

  • Posts: 83
Re: 24-pin microcontroller for handwired build?
« Reply #5 on: Fri, 18 October 2019, 06:58:34 »
+1 on the teensy2.0++. stm32 are probably workable using chibiOS but have a steeper learning curve. it's worth paying extra for the 8bit mcus.

Offline Findecanor

  • Posts: 4615
  • Location: Koriko
Re: 24-pin microcontroller for handwired build?
« Reply #6 on: Fri, 18 October 2019, 12:25:14 »
The Teensy 2.0, Pro Micro and Elite-C have the same MCU: the 8-bit AVR ATmega32u4, and no support chips so they can run the same firmware, except for having different pinouts, internal LEDs and power regulator (which is unnecessary when powered over USB).
The differences are in which bootloaders they have, so you use different programs to get your compiled firmware onto them. The Pro Micro was made for Arduino which uses its own weird numbering scheme: there is a chart here with the AVR port numbers.

The PJRC Teensy 2.0 (not the 2.0 ++) used to be what most people used before the Pro Micro became available at a lower price. In fact, most open-source firmwares used to be developed for the Teensy 2.0 first, built on top of PJRC's own USB firmware.

The Teensy 2.0 has a mini-USB socket. There are a total of 25 pins: 22 GPIO pins on the long edges. One pin is between the rows and two pins are on the short edge. The D6 pin in one corner corner is stupid though: it is also wired to a LED on the board so you can't use it unless you want an orange glow...

The Elite-C was made as a drop-in substitute for the Pro Micro: it is pin-compatible with the Pro Micro except that it has five more GPIO pins on the short edge and the RAW pin has been changed into a GPIO pin, for a total of 24 pins. No power regulator and no LEDs on board.

The Teensy 2.0 and Elite-C are priced about the same (available from multiple stores) but the Elite-C has a Type C socket while the older Teensy 2.0 has mini-B.

The QMK Proton C has an ARM-based microcontroller, and you would need to run the QMK firmware. The AVR-based boards run on 5V from the USB port but the Proton C has a power regulator to run on 3.3V. This has no significance for the matrix, but you'd need different resistor values for your LEDs.
The Elite-C and QMK Proton C are new and supply is more limited than for the Teensy 2.0.

If you want to not use the socket on board, but a USB breakout board or panel-mount socket mounted elsewhere inside your keyboard, then the Elite-C and QMK Proton C also have the USB data lines on pins that you could solder wires directly to. To do the same with a Teensy 2.0, you might have to splice a USB wire open.
« Last Edit: Fri, 18 October 2019, 12:52:52 by Findecanor »
Man must shape his tools lest they shape him
-- Arthur Miller

Offline ErgoMacros

  • Posts: 310
  • Location: SF Bay Area
Re: 24-pin microcontroller for handwired build?
« Reply #7 on: Fri, 18 October 2019, 17:44:29 »
And if you're willing to add a shift register, or two... that will save a lot of processor pins.
Example control 16 pins with 3 IO pins.

    http://www.openmusiclabs.com/learning/digital/input-scanning-matrix/shift-brigade/index.html

 (I know, probably not what you had in mind.)
Today's quote: '...“but then the customer successfully broke that.”