Author Topic: What is a teensy / ATmega32u4 controller?  (Read 1285 times)

0 Members and 1 Guest are viewing this topic.

Offline findingthelimit

  • Thread Starter
  • Posts: 158
  • Location: San Francisco, CA
  • Rawr
What is a teensy / ATmega32u4 controller?
« on: Wed, 10 December 2014, 23:33:59 »
Hi all,

I bought a keyboard with a phantom-style backplate, an ATmega32u4 controller, and ergo-clear switches here two summers ago.

Back then, I just got into keyboards, and thought I'll just buy a nice, expensive keyboard and forget about it. I never programmed on it, and never took it apart. I've been meaning to go back and learning about how this "teensy" thing works, and what a phantom backplate is, but this is from two years back (I think?) and it's hard to find resources.

From what I've read, it seems like a phantom is a keyboard that allows solderless switch swapping. What does this really mean? And by having a phantom-style backplate, does it mean that my keyboard uses the filco PCB, but has it's controller replaced? The filco is plate mounted, so what's the purpose of replacing the initial plate with the "phantom-style" backplate? Does the original plate not allow solderless switch swapping?

Finally, my main question is how the ATmega32U4 controller works. I've looked on DT and the other geekhack thread about this, and it talks about it's advantages bringing full programmability to the filco, but it never talks about how it's done. How do I code macros and change the keymapping on my keyboard, and how to I compile it (flash it?) to the controller? Is this done through USB, and what language is this in? I assume it's in C or assembly?
Poker 2 reds, GH60 42g ergo clears

Offline arakula

  • Posts: 49
Re: What is a teensy / ATmega32u4 controller?
« Reply #1 on: Thu, 11 December 2014, 00:58:27 »
I can only help with this one...
Finally, my main question is how the ATmega32U4 controller works. I've looked on DT and the other geekhack thread about this, and it talks about it's advantages bringing full programmability to the filco, but it never talks about how it's done. How do I code macros and change the keymapping on my keyboard, and how to I compile it (flash it?) to the controller? Is this done through USB, and what language is this in? I assume it's in C or assembly?
"How it's done" has some aspects.

In principle, the ATmega32U4 is an 8-bit microcontroller with quite a lot of capabilities. It's described here. Normally, this kind of controller holds two different programs in its flash memory: an application program and a boot loader, which can be used to download new application programs.
There are quite some boot loaders available. In the case of a Teensy, that thing is called "Halfkay" (because of its minute size) and it communicates over USB with a corresponding program on the computer you've attached it to. Simply press the Reset button on the Teensy (easy to find, there's only one button), the boot loader kicks in, then you can download a new application onto it.

The applications themselves vary in their complexity and capabilities. In theory, applications with a program size of up to 31.5K can be downloaded; if you're used to application programming on an Intel PC or Mac, where
Code: [Select]
#include <stdio.h>
int main(void) {
  printf("Hello, world\n");
  return 0;
  }
  tends to produce a bigger executable, that's really surprisingly much on a microcontroller. They're normally written in C or AVR assembler. Atmel provides its own AVR Studio application which runs on Windows, but I'm not a big fan of this overcomplicated environment.

And then, of course, the application may offer some reprogramming capabilities of its own; Soarer's Controller firmware, for example, stores the configuration in the on-board EEPROM of the ATmega32U4 and comes with its own set of tools to change that. Before reprogramming the configuration or assessing the possibilities, you'll have to find out first which application program is stored on your Teensy, of course  :D

HTH,
  Hermann
« Last Edit: Thu, 11 December 2014, 01:08:07 by arakula »

Offline AKmalamute

  • HHKB Scrub
  • Posts: 837
  • Location: Western WA, USA
Re: What is a teensy / ATmega32u4 controller?
« Reply #2 on: Thu, 11 December 2014, 01:09:04 »
the phantom is a keyboard. Specifically, it's an open sourced community-built design that has been converted into physical form at various times & places. Right now the most common is mechanicalkeyboard (.com). The board doesn't have the holes needed for PCB-mount CherryMX switches so a builder must use plate-mount switches.

While there's no requirement to use plates with switch-top cutouts, it's customary to do so. The MX switch can be disassembled allowing for replacing stock springs or sliders with custom choices ... this is how ergoclears are made; opening up MX-clear switches and placing a lighter spring inside them.

 But if the switches are plate-mounted and soldered to the PCB, you would have to remove each switch to open it ... except there are ways of cutting a switch-plate so that the top can be removed without desoldering. Thus the push for such cutout shapes on DIY boards.

 I hope I've answered other of your questions, and welcome to the world of mechanical keyboards. You've started down a very deep rabbit hole by asking these questions.

HHKB-lite2, Dvorak user