Microcontrollers are described in terms of the number of bits the CPU can process or move in and out of memory at once. The major flavors these days are 8-bit and 32-bit devices.
Those terms are just shorthand for more important differences in the way the chips are made though.
All microcontrollers contain a processor that executes code and a set of circuits called 'peripherals' that provide additional functions: USB, serial interfaces, ADCs, timers, and so on. The biggest difference between microcontrollers is the relationship between the processor, the peripherals, and the physical pins that come out of the package.
8-bit devices are the simplest kind available these days and have been around the longest. They're generally simple enough that you can learn everything about them in a reasonable amount of time and there may be more sample code available on the Internet.
The Arduino Uno and the Adafruit Metro 328 (Uno compatible) are the most common boards in the 8-bit market with lots of software available. The tiny Adafruit Trinket is also 8-bit with fewer features.
An 8-bit microcontroller's peripherals are connected more or less directly to the processor and the physical pins.
If you change the voltage on a pin, the peripheral converts that to a value in the processor, then your code can use that value. Output from code to the physical pins works the same way.
Some 8-bit microcontrollers only have a few peripherals while others have many, but the overall design tends to remain the same: the peripherals connect the physical pins to data values in the processor.
A 32-bit device is more like a hardware store in a very small box. The actual microcontroller is only a small part of the chip, and usually isn't even discussed in the datasheet. Chip manufacturers tend to license generic processor designs like the ARM Cortex series.
The peripherals in a 32-bit microcontroller are more like separate devices connected to one or more data buses, and almost everything is a peripheral. In the SAMD21 (which we use in the Adafruit Circuit Playground Express and the Adafruit Feather M0 Express), the CPU clock, RAM, and Flash memory array are all peripherals.
More About Peripherals with 32-Bit Chips
Peripherals are the 'extras' beyond plain number crunching - like digital i/o pins, capacitive touch, ADC, SPI, I2C, UART, I2S, etc...
The peripherals don't have any direct connection to the processor. More traditional peripherals like the ADC and SPI hardware are connected to a separate data bus.
Connections between peripherals linked to the data buses are handled by an internal switching network, and that has two interesting side effects. First, peripherals can run from different clocks ticking at different rates. Second, peripherals can communicate with each other directly, without any control from code being executed in the processor. Chips with a Direct Memory Access (DMA) peripheral can move whole blocks of data from one peripheral to another. You can configure a chip to do many interesting things with the actual microcontroller completely shut down.
All of the physical pins are connected to a single peripheral called the pin multiplexer. In some chips, the multiplexer can connect any physical pin to any signal on any peripheral. The SAMD21 usually gives peripherals two or three pins that can handle a given signal, and a single physical pin can have as many as nine possible connections to peripherals.
The freedom to configure peripherals and move signals around like that makes 32-bit microcontrollers extremely flexible, but there are a couple of disadvantages as well.
The software written for an Adafruit product may not be 100% compatible with an Arduino or other manufacturer's product, even though they use the same chip.
So there may be less code on the Internet to show you how to use a 32-bit chip. Fortunately, Adafruit has invested a great deal to provide code examples, reusable code libraries and tutorials to easily use their more advanced products.
An SOC is usually a 32-bit microcontroller designed to do a specific thing. It's made the tradeoffs necessary to be good at that thing at the expense of all-around performance.
The ESP8266 is one example: it's designed to do WiFi at a very low cost. It has few input/output pins and peripherals, but one of the peripherals is a WiFi radio. It has large collection of built-in firmware, and a simple operating system that keeps the WiFi radio running more of less independently of the code you upload.
Some projects look to use this chip without WiFi solely due to cost. But the lack of input/output pins and peripherals often make it necessary to switch to a more capable chip.
The ESP32 and nRF52 are also SOCs. The ESP32 is intended to be a one-stop-shopping solution for any device with a wireless data connection. It can do WiFi, Bluetooth Classic, and Bluetooth Low Energy (BLE). The nRF52 focuses on BLE, and can operate as a BLE central device.
Text editor powered by tinymce.