As part of my Beginner Series (1st post here: https://lemux.minnix.dev/comment/46392) I hoped to introduce this community to the idea of Microcontrollers.

Before I drill down into specific Microcontrollers, I think a history lesson is useful. In particular, the MCS-51 / 8051 chip from the 1980s defined this category of microcontroller chips, and even today its influences can be felt. Thinking in terms of the MCS-51 will help out the beginner to understand what is possible, especially on the low $1 (or cheaper) end of microcontrollers.

Historical Baseline: The Intel MCS-51 (aka: the 8051)

Beginners should have a “generic microcontroller” in their mind’s eye to serve as a baseline for other microcontrollers. And the Granddaddy of them all, the Intel 8051 from 1980, is perhaps the perfect chip to serve as the basis.

  • 8-bit CPU
  • 4kB ROM
  • 128 Bytes RAM (not kBytes, bytes).
  • 12MHz top clock speed, but 12-clock cycles per instruction. (Performed closer to a 1MHz processor today).
  • 2x Timers
  • 1x UART / Serial Port
  • External Memory Bus
  • 15mA sink per GPIO pin (“sourcing” current is nearly impossible: only 60 microamps or 0.06mA source)
  • ~12mA Active current
  • ~1.3mA Idle current
  • ~0.003mA Power Down current

8051 Assembly language was (and still is) wonky. Its designed to be written directly by a human (not through a compiler), so its almost easier for humans to write Assembly than to write C sometimes (or at least, if you write C-on-8051, you definitely need Assembly language to handle some details). Modern microcontrollers are better designed for C-programming (or even Rust and MicroPython).

4kB ROM and 128 Bytes of RAM sounds small and… it is. But this is what defined the category and what worked for decades. Eventually the 8051 upgraded to 8052 providing 256 Bytes of RAM, but engineers still got plenty accomplished even with just 256 bytes of RAM.

12MHz (with 12-clock ticks per instruction) is slow. But Microcontrollers get around that with dedicated peripherals. The UART / Serial Port on the 8051 for instance can perform the calculations needed to shift out bits (or shift them in) on time, with Parity and all.

The 2x Timers also added a lot of “pseudo-computational” work. Timers are one of the more important tools in your Microcontroller toolkit, effectively providing the engineer a “int16_t variable++” every clock tick, as well as a simple if-statement to control behaviors (ex: if variable == clock-max, set variable back to 0, or cause an interrupt, or… many other possibilities). The 8051 timers were crude and simple, but they got the job done. Modern timers will have far more features than the 8051, but universally every uC has a set of timer of some kind.

As crude as these specs seem, the 8051 achieved a legendary status and manages to remain used today in 2023 (!!!). SiLab’s BusyBee or NuMicro from Nuvoton still supporting 8051 code. Of course, technology is far superior today but its crazy that the 8051 continues to live on over 40 years after its release.

Beyond the Granddaddy: I2C and SPI for expansion and I/O

While the 8051 can do most of what modern uCs can do (albeit slower and with fewer features…), there’s two important additions to the uC world I feel the need to explicitly mention.

I2C (also known as IIC or Two-wire-interface) is a 2-wire bus. A “bus” means that a master tells everyone else when they’re allowed to talk. In theory, 127 devices could be hooked up to a single I2C set of wires, but in practice you’ll likely run into capacitive / pullup / voltage issues long before that number.

SPI (also known as Serial Peripheral Interface) is a simple 4-wire communication methodology between modern chips. Sometimes, multiple SPI chips can share the same line, but its never quite as easy as I2C to multiplex.

Modern uCs will inevitably use I2C or SPI peripherals. These are universal today, with additional Flash, RAM, SRAM, ADCs, DACs, Temperature sensors, gyroscopes, full size monitor-controls (I2C), tiny screens (SPI), programmers and more hanging off of these ports.

In practice, many microcontroller projects will probably be just a program that shuffles data between SPI chips and/or I2C chips. For example: I2C Thermometer + I2C Real-time Clock writes data to SPI-Flash for long-term storage/logging, waits for SPI-Ethernet packets and dumps this log over SPI-Ethernet.

I2C and SPI are universal features that all modern uCs support to a high degree. You can think of both I2C and SPI to be “like USB” for the embedded world.

The Rise of Mixed Signal Processing: ADCs, PWM, DACs, Comparators, and more

While many sensors exist in I2C or SPI form, other sensors remain purely voltage and/or current based. On the flip-side, the microcontroller will often have to “emit power” signals, turning on switches or otherwise controls to carefully move motors (or other actuators).

Traditionally, 8051 had no analog components. But today, mixed-signal combination analog+digital chips have become far more common.

ADCs (Analog to Digital Converters) convert analog voltages into digital values. For example, 2V against a 3.3V reference could become the 10-bit number 620 (620/1024 == 2V / 3.3). ADCs are extremely common today.

DACs (Digital to Analog Converters) convert a digital value into an analog voltage. For example, the digital value 620 could turn into 2V physically output at the DAC. True DACs are rare, so consider using PWM instead.

PWM, pulse-width-modulation is a digital technique that ends up kind-of-sort of like a DAC in practice. (Depending on application). Instead of outputing a constant voltage, PWM turns a pin on-and-off at a particular frequency. For example, 80% on would give you 80% power, while 5% on would only give you 5% power. Sometimes, PWM is the preferred way of controlling a set of motors or systems, it all depends on the overall design.

Analog Comparators perform a if/then statement over an Analog value, often with a bit of hysteresis. For example, if the Voltage goes above 0.5V, the Comparator will output 1 and will continue to do so until the Voltage drops below 0.4V.

There are also OpAmps, DSPs, Radios and more that are available. But these go beyond the scope of what I want to cover.

The Modern, Generic Microcontroller

So, with the history lesson + common features available, what does a modern uC look like in the year 2023?

  • 8-bit, 16-bit, or 32-bit – 8-bitters like AVR, PIC, STM8 and 8051 continue to grow like cockroaches, even today. The 16-bit world like TI’s MSP430 or PIC16 does exist as well, but most eyes and buzz remain around ARM’s 32-bit Cortex M0+, M23, M33, M4, M7 (etc. etc.) cores.

  • 0kB Flash to 1MB Flash – 1980s style ROM has been displaced with Flash, but otherwise on-board read-only-ish memory serves as where we write our programs in these devices. RP2040 (Rasp. Pi’s Microcontroller) is unusual with 0kB, requiring an external support chip for ROM.

  • 32 Bytes of RAM to 1MB RAM – On-board RAM for processing

  • 32kHz to 800MHz – Low-clocks minimize the power-consumption, and 32kHz chips are still commonly used today for the absolute minimum in power usage. Most 8-bitters drop down to 32kHz (or below!), while many 32-bit ARMs can also support 32kHz as a special case (though they tend to prefer 1MHz and above). High end 32-bit chips reach into the microprocessor-like 800MHz speeds with ARM-NEON (vector) processing, floating point and DSP-like speeds. (Some controllers require a lot of processor power to run… to calculate the voltages to send to motors to keep a drone flying for example)

  • I/O with GPIO (of various current source, sinks, push/pull configurations and various voltages), I2C, SPI are universal. USB, Ethernet, WiFi / 802.11, Zigbee, Bluetooth, CANbus, Ethercat, LIN, 10BASE-T1S, 10BASE-T1L and more. Microcontrollers exist to “interact” with the world and the set of I/O peripherals is often more important than any other specification.

  • Analog / Mixed Signal – ADC is universal, and Comparators are common. PWM is common especially with how universal Timers are. DACs, OpAmps and other analog components are less common. In all cases, accuracy is compromised due to the innate noise from digital processors, so a serious analog circuit will need to be off-board. But Mixed Signal is great for applications where a bit of noise isn’t a big deal.

  • Voltage – 1.2V, 1.8V, 3.3V, 3.6V, 5V… uCs come in all kinds of voltage support. The most typical uC is centered around 3.3V and 3.6V Lithium batteries today, though 5V is the USB-specification and deserves a mention, while lower-voltages (like 1.2V or 1.8) deserve mention for minimizing power usage.

  • Currents – Microcontrollers use anywhere from micro-amps, (especially at the 32kHz scale) to 250mA+, especially if they have Radios on board. Most (non-radio) microcontrollers tend to be in the 1mA to 50mA region, and some low-power Radios can even function within 20mA or less (!!). For especially low power operation (aka: “Years” on a single Lithium CR2032 cell), there are sleep-modes that can set some low-power uC into the sub-microamp range.


With an idea of what “generic” microcontrollers can do, I think my next post can dial into more specific chips and what they offer. My own personal biases keep me more interested in the low-end ($2 or less) market.