Definition
A microcontroller is a control system consisting of a microprocessor and a number of inputs and outputs. Sensors or memory storage are connected to the inputs, while actuators such as motors, LEDs or displays are connected to the outputs. Microcontrollers have a volatile working memory (RAM), which is deleted when they are switched off, and generally also have an EEPROM, where programs and data can be saved on a long-term basis. In contrast to laptops and PCs, there is neither a keyboard for input nor a screen as an output unit; these must be controlled separately.
Familiar, commonly used examples of these kinds of microcontrollers are, for instance, the Arduino, the BBC micro:bit, the Calliope Mini and the TXT Controller from fischertechnik.
The heart of the microcontroller is a microprocessor. In and of itself, a microprocessor is an integrated circuit (IC), which loads commands and data from a (temporary) memory – called Random Access Memory (RAM) – into the registry of the IC, processes them in a computing unit, and saves the results back in the RAM. A microprocessor consists primarily of transistors – electronic “switches” that have exactly two states: “On” and “Off”. These transistors can be used to construct logical circuits such as “and”, “or” and “not” gates. The results are saved in a “flip-flop”, a stable changeover switch (for further information, see the “Electronics” educational box).
A quartz oscillator indicates the clock rate, speed with which the microprocessor should process the commands and internal computing steps. The commands are indicated in a machine code (which differs by microprocessor type), and consist of a command (such as “add two values) and multiple parameters depending on the command (such as the two values to be added or the registries where the values are saved).
The performance of the microprocessor is determined by its clock rate, the data width in bits (which indicates how large the addresses and values which the microprocessor commands can process in one step may be) and the machine code itself: The more complex the commands that the IC can execute are, the faster data processing generally is. To accelerate access to the RAM, many microprocessors today contain a separate cache memory where they temporarily store commands and data during processing.
The microprocessors used in laptops and PCs today can process 64 bit long data (values, RAM addresses). They contain many billions of transistors, and are clocked at multiple GHz (billions of vibrations per second). They can share the work (“multi-core”) and have cache memories that are many megabytes in size. Today, microcontrollers generally use microprocessors with a word width of 32 bits and a clock frequency of less than one GHz – which is sufficient by far to handle the tasks of a microcontroller.