geekhack

geekhack Community => Other Geeky Stuff => Topic started by: Me on Sun, 16 May 2021, 20:42:17

Title: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Me on Sun, 16 May 2021, 20:42:17
I was wondering just out of curiosity whether a teensy or pro micro was something specifically for keyboards or something that could be used  for other electrical input devices?
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: MIGHTY CHICKEN on Sun, 16 May 2021, 21:33:39
You can use it to make anything really as long as you are able to write a script for it, its commonly used in those stem/tinkering classes where the course would be to connect pins from a micro to a breadboard or smth and write scripts to make it do cool stuff like turn on a light, run a motor, etc.
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Me on Sun, 16 May 2021, 22:03:41
So basically its all in the firmware. If you can solder it together, and code the firmware, you can pretty much make anything that is within reason.
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: MIGHTY CHICKEN on Sun, 16 May 2021, 22:38:51
So basically its all in the firmware. If you can solder it together, and code the firmware, you can pretty much make anything that is within reason.
Pretty much, the sky is the limit(If the sky is a tiny MCU)
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Me on Mon, 17 May 2021, 00:08:47
So basically its all in the firmware. If you can solder it together, and code the firmware, you can pretty much make anything that is within reason.
Pretty much, the sky is the limit(If the sky is a tiny MCU)

Haha. Thanks for the quick tidbit!
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Leslieann on Mon, 17 May 2021, 07:38:05
I was wondering just out of curiosity whether a teensy or pro micro was something specifically for keyboards or something that could be used  for other electrical input devices?

They're no different then any other Arduino (Pro Micro IS an Arduino) or Raspberry Pi, just smaller with less computing power.

People use them to make sensors, motor controls, joysticks, throttle quadrants, steering wheels, pedal setups, volume knobs...
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Me on Mon, 17 May 2021, 08:59:12
Ok, that makes plenty of sense. We worked with arduinos this year in Technology class(I am in 8th grade), albeit through a virtual circut building program due to..... things*.


*THERE'S A FREAKING PANDEMIC!"
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: tp4tissue on Mon, 17 May 2021, 09:22:41
[attachimg=1]
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: yui on Mon, 17 May 2021, 09:29:21
the simplest way to look at it is that it is a very slow and dumb computer, with none of those fancy video capabilities etc. but much more resilient I/O and bigger voltage ranges. like a computer you can program it to do anything, but although you could run it, crysis would have a rather low frame-rate, in the few frames per day :) (i do not think anyone would be stupid enough to code cryengine in AVR C though, so it would be quite the task :))

TL;DR: microcontroler = very slow and simple PC
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Me on Mon, 17 May 2021, 10:19:15
Does it have all the different parts(cpu, ram, gpu, memory, etc.) built into it then?
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: MIGHTY CHICKEN on Mon, 17 May 2021, 10:22:35
Does it have all the different parts(cpu, ram, gpu, memory, etc.) built into it then?
Pretty much, the mcu is the cpu and ram kinda, then it has all the capacitors and other mcu stuff with it too which makes it so good for keebs cause the only thing you have to do now is route some simple switches and resistors.
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Me on Mon, 17 May 2021, 10:32:15
Ok. That's really cool actually, I might try and think of a cool project with one of them after I am done handwiring my keyboard. Done with all the diodes but I have to go and pick up some small wire cutters.
Title: Re: What exactly can you do with a microcontroller(i.e. teensy, pro micro)
Post by: Findecanor on Mon, 17 May 2021, 11:42:32
To be specific, the "microcontroller" ("C" for short) is the chip on a microcontroller board. And the central part of it is the MPU - "microcontroller processing unit" which is like its CPU.

There are many different varieties of Cs, and they can be found in lots of things that need some control logic. The number of applications is practically endless.
The microcontroller was invented right before the microprocessor (CPU), and in the early days there weren't that much difference between them. Some older 8-bit CPUs have continued to be produced and used as microcontrollers in various devices long after they were considered obsolete for use as CPUs in computers.

Nowadays, a typical microcontroller is a system-on-chip ("SoC") with integrated RAM, Flash and I/O (input/output) capabilities. The program is written into the Flash, and often supposed to be run from the Flash directly -- not from the RAM.
However, a microcontroller can also be part of a larger chip: e.g. every PC has dozens of them for various purposes including one dedicated to controlling the PS/2 port.

The Teensy 2.0 board was chosen for keyboards because the board was small (at a time when most microcontroller boards were much larger) and the C: (ATmega32u4 in the AVR family) contains USB hardware for which the maker provided a library that firmware could use. It can also be programmed over USB, whereas many other microcontrollers need to be programmed over dedicated serial interface pins.
The Pro Micro has the same microcontroller as the Teensy 2.0, but fewer pins available: it got popular because you can get them very cheap ($5 for a clone from China instead of $16 for the Teensy).
The Teensy 2.0 is also going to be discontinued next year.

There are also several microcontroller families that are based on a ARM Cortex-M MPU which is 32-bit, and often runs at much faster clock than AVR. But each family needs new firmware, because they are not compatible with one-another. Most mass-produced keyboards use some ARM-based microcontroller or other.

However, the ARM-based ones typically support only 3.3V signals, while the AVR is capable of 5V signals -- which older computers and protocols used.
Therefore, AVR is still the best choice for adaptors from PS/2 and other vintage protocols. NeoPixels, often used for side-glow, also use 5V.