Tuesday, January 30, 2018

Pro Micros

Various Pro Micros

Several different "Pro Micros".

I use Pro Micros in many of my projects. Most have been the cheap blue clones, but lately some other variations have been showing up on eBay and Aliexpress. They are mostly all compatible with the original opensource design from Sparkfun. Some have electrical or physical differences.

 From left to right:
The Sparkfun Pro Micro was purchased directly from Sparkfun. The others were from eBay or Aliexpress.

They all have the Arduino compatible Caterina bootloader.

The Green Pro Micro has a different power circuit that makes it incompatible with some split keyboards.

The Black one uses the larger AtMega32U4 package.

The one with the Mini USB connector has the same pinout, but is taller, wider, and thicker (the USB connector is the thickest part.) I use it on the Tomato.

The genuine Sparkfun Pro Micro PCB is 0.8mm thick. You can find cheap Pro Micro's that are 1.2mm thick (second one). Most are 1.6mm thick.

Two different styles of micro USB connectors. Some are flat (black and green) and some have a flange. What you get with clones is totally random.

Not Pro Micros.

These can often be used in place of a Pro Micro, but changes to code and wiring would be required. The AtMega328p based boards would require V-USB to create a software USB HID interface with additional hardware components.
Some other controllers are compared here.

Monday, January 29, 2018


Single 4x4 PCB 16 Key macropad

Assembled a single board version of the 4x4x4x4x4 PCB. A 1/16th thick aluminum plate was used as the bottom. This can run the same firmware as the 4x4x4x4x4 using just the 4 left most columns. I also used kbfirmware.com to create a hex using this json file.

Gateron clear PCB mount switches.

Arduino Micro clone socketed to the bottom.

The aluminum was easy to drill through with a cordless hand drill. A PCB was used as a template to locate the screw holes. 5/64th inch drill bits are the perfect size for M2 screw holes. The aluminum is 5052 that was purchased on eBay. There are sellers that will do custom cuts. The accuracy isn't exact, but is close enough for this use.

Assembled with M2 spacers and screws.

Wednesday, January 24, 2018

Monday, January 22, 2018


Pro Micro Lobotomizer

The Lobot is my third version of a Pro Micro ISP programmer. The first version used a Pro Micro running the Arduino ISP sketch. The second version was a Raspberry Pi 0 using it's GPIO pins. I use these to replace the Arduino caterina bootloader with the standard Atmel DFU bootloader.

The caterina bootloader works fine when used with the Arduino IDE. It is automatic. However when being programmed outside of Arduino you have to manually deal with the reset timing which many people have problems with. The DFU bootloader is much simpler, once reset into bootloader mode it will stay in bootloader until power cycled or given the run command from the flashing software.

This version makes it easier to align the victim Pro Micro against the pogo pins. It also uses either an Arduino Nano or a TinyUSB programmer. Both are very cheap. There are many TinyUSB variants, these purple ones are easy to find on eBay or Aliexpress.

The Arduino Nano is programmed with the Arduino ISP sketch. The TinyUSB comes pre-programmed, but you may need to install a driver if you are running windows. The Arduino Nano shows up as a serial device, the TinyUSB is a LibUSB device.

The Arduino Nano has TX/RX lights so you can see when it is transmitting data. The TinyUSB has no activity lights, but it is faster. You can see the programming progress on screen so you don't lose much not having flashing LEDs.

You can create your own bootloader using LUFA or flash the stock DFU bootloader. Atmel was purchased by Microchip and their website is a mess. You can download the stock DFU bootloader via a Wayback snapshot. The FLIP utility for Windows is also available there.

Programming is through avrdude. To flash stock DFU with the Arduino Nano the commands are:

avrdude -p m32u4 -c avrisp -P comXX -b 19200 -U lfuse:w:0x5e:m -U hfuse:w:0x99:m -U efuse:w:0xf3:m -v

avrdude -p m32u4 -c avrisp -P comXX -b 19200 -B 4 -U flash:w:"ATMega32U4-usbdevice_dfu-1_0_0.hex" -v

Replace XX in comXX with the COM port number of the Arduino Nano. The first line sets the fuses. It will give a warning about changing them back, answer No. The second line flashes the bootloader.

With the USBtiny the commands are the same but with a different programmer and no serial port/speed.

avrdude -p m32u4 -c usbtiny -U lfuse:w:0x5e:m -U hfuse:w:0x99:m -U efuse:w:0xf3:m -v

avrdude -p m32u4 -c usbtiny -B 4 -U flash:w:"ATMega32U4-usbdevice_dfu-1_0_0.hex" -v

It takes about 10-15 seconds to program. The TinyUSB is faster than the Arduino Nano.

Gerber files on github.

Only the 6 pogo pins on the bottom row are really necessary for ISP flashing. GND, Reset, VCC, SCK, MISO, MOSI. The other pogo pins are there to support the Pro Micro when you press down.

The Pro Micro placed on the pogo pins. You press down to make solid electrical contact with the spring loaded pins during the programming process.

Arduino Nano on the left, TinyUSB on the right. You can see the TX/RX LEDs on the Nano. The TinyUSB just has a power LED.

Bottom view. A second PCB is used as the base. M2 Spacers and screws. The length of the spacers matters due to the length of the pogo pins. 6mm spacers are used, slightly longer would also work.

Side view. The pogo pins are only soldered to the top PCB. The bottom of the pogo pins are sitting in the holes of the bottom PCB. I used some tape on the bottom PCB to keep the pins from falling through during soldering. Be careful not to get flux on any of the moving parts of the pogo pins, they will stick in place.

I used two different types of pogo pins. The faceted one on the left and the smooth conical one on the right. I got them on eBay, look for P75 for the size of the pins. The different style heads all have different codes. The faceted one is T2 and the conical one is E2. There are many other styles that may work.

There is a problem with the conical E2 pins. Some Pro Micros have really large holes and they will fall right through. The T2 pin heads are large enough for these holes.

Blue, Black and Green Pro Micros. The Blue has very large holes, not all I have seen are as large as this one. The Black and Green have smaller holes.

Monday, January 15, 2018

I am Groot

Groot at the Hawaii Emergency Management Agency

New restrictions on potted plants at the HEMA.

 It should probably be made more difficult to send emergency alerts.

Friday, January 12, 2018

Disappointing eBay purchase

Not broken.

Got these two 60% keyboards on eBay for cheap. They were listed "as is for parts". One is a Massdrop KC60 with the misspelled backspase key. The other is a V60 Matias.

Both work fine. Was planning to take them apart to use for parts, but since they work I will probably just leave them alone. They have little signs of wear.

The only thing wrong with the KC60 is there are no stabilizer inserts in the keycaps. This is probably because the Massdrop fake costar stabilizers are terrible. I'll probably just replace them with real ones.

I was planning to swap the PCB in the V60 with a Hasu Alps64 PCB. I think the last person using it could not figure out how to make it work with a Mac. The DIP switches were set weird. Other than that it works fine.

Monday, January 8, 2018


Modular keypad/keyboard

The basic unit is a 4x4 matrix with 16 keys. Up to 4 of these can be connected to each other side by side.

4x4, 4x8, 4x12 and 4x16 are possible.

There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or with pin headers and shunt jumpers.

The PCB is a perfect square. Exactly 3 inches square. Standard switch spacing is 0.75 inches, 19.05mm. The header pins are the common 0.1 inch spacing (2.54mm).

The Gerber files are on github.

The schematic shows how the header pins are connected. The Row pins connect straight across. The column pins shift up diagonally from board to board.

The pinout. Each additional board uses another set of 4 Column pins.

It is running TMK. The 4x16 layout is here on github. For 4x4, 4x8 and 4x12 you can either modify the matrix or just ignore the columns on the right that are unused.

The top of an assembled 4x16 using 4 boards. Gateron clear PCB mount switches.

The bottom. A second set of 4 boards were used as the base of the keyboard. 3m Bumpons at each corner of each board.

Side view. M2 spacers and screws hold the two PCBs together. You can see the Arduino Micro on the right. It is right side up so that the reset button can be pressed.

The bottom of PCB with the socket for the Arduino Micro (not a Pro Micro). The Arduino Micro has an odd number of pins and I had to cut down two different sockets to fit it. If I had a 40 pin socket I could have just cut off pins from one end to make a 34 pin socket.

Close up of the solder bridges. Solder isn't a good mechanical connection, but it works. A solid plate or base plate is needed to keep the board from flexing.

Header pins are much sturdier and the jumpers are removable. I didn't have enough jumpers to complete a board. The header pins are the ones that came with Pro Micros, I snapped them into 4 pin sections.

Completed 4x4x4x4x4 board with keycaps. It is my standard Planck layout with a numpad on the right.

Thursday, January 4, 2018


Purpose built steno keyboard

The Outrigger and Kon Tiki were modifications of a Gherkin that added 4 keys to the bottom. The Kolea is a complete redesign that adds some keys and removes others that aren't used.

The firmware is StenoFW by Emanuele Caruso. The only modifications are to the matrix. His original Stenoboard is a split design. The Stenokey project has added additional features to StenoFW.

The firmware is an Arduino Sketch, it also requires the PJRC Teensyduino libraries. You should check the PJRC site to see what is the latest version of Arduino that the current Teensyduino supports before installing the Arduino IDE.

The Kolea has 1.25u width keycaps for the * keys (middle of the board). You can also fit 1.25u or 1.5u keycaps rotated for the AOEU keys.

Like the Gherkin, a second PCB is used as the bottom. M2 spacers and screws hold the two PCBs together.

The PCB Gerber files are on Github.

The top of the board populated with diodes and resistors. The resistors are optional, only needed if you want LED backlighting.

The bottom of the board with the 28pin socket for the Teensy LC (or Teensy 3.2). The SOIC MOSFET is only needed if you want LEDs. This was a 32 pin socket cut down to size.

The matrix rows and columns. FN1 and FN2 are for changing output modes. NKRO, Gemini and TXBOLT are supported in the firmware.  If you have LEDs installed you can control the brightness with them.

It will work with either a Teensy LC or a Teensy 3.2. These are purple Teensy from OSH Park. (Teensy 3.2 on the top, Teensy LC on the bottom). There is no reason to use the more expensive Teensy 3.2, unless you are going to modify the firmware and need the larger amount of RAM and Flash memory.

When assembled with a second PCB on the bottom, the reset button on the Teensy is lined up so that it can be accessed through one of the switch holes.

The NKRO Keymap. In NKRO mode all the keys can be pressed and registered simultaneously.

The Plover stroke display showing all the different individual keypresses in Gemini or TXBOLT mode. The last line shows all keys being pressed simultaneously.

In Gemini and TXBOLT modes the output is through a virtual serial port over the USB connection. This is much more convenient as you can continue to use a regular keyboard at the same time as the Kolea.

Outrigger, Kon Tiki and the Kolea. I was using the Outrigger and Kon Tiki with Plover as NKRO keyboard devices. It was awkward. The serial output modes of StenoFW are a major improvement.