Microcontroller

From SEGGER Knowledge Base
Jump to navigation Jump to search

A Microcontroller is a single-chip computer. It contains all required components: One or multiple CPU cores), RAM in one or multiple banks; ROM (read-only memory) (for program and constant data, typically so called flash memory, which can be erased and reprogrammed, but is read only in regular operating mode); and, typically, I/O units (peripherals). Many microcontrollers come with built-in oscillators in order to reduce the number of external components needed.

A schematic representation of a microcontroller unit

CPU

Most of today's microcontrollers are built around a single 8/16- or 32-bit CPU core. However, there are also microcontrollers with multiple CPUs. Since the CPU core usually only uses a small percentage of the silicon (die) area, it is not very expensive to add one ore multiple additional CPUs to a Microcontroller.

RAM

RAM stands for random-access memory. It is memory which can be read and written to by the CPU (or in many cases also DMA controllers)

ROM

ROM is non-volatile, read only memory used to hold the program and read other read only data. In most cases, it is actually flash memory, which is reprogrammable solid-state memory. The ROM of the device is usually programmed in-system initially. Firmware updates can then be done by thr firmware itself.

Oscillator

An oscillator is a device that provides a more or less constant clock source. An 8MHz Oscillator provides 8 million clock cycles per second. Many microcontrollers have built-in oscillators (typically operating at relatively low speeds between 1 an 16MHz). The built-in osciallators are a great choice when timing is not super important, as their accuracy is typically in the range of 1 - 5%, so not very accurate. For more accuracy, typically external oscillators are used. For CPUs running at higher speeds, microcontrollers tend to also incorporate one ore multiple PLLs (phase locked loops), which can generate higher output frequencies from the supplied input frequency.

Peripherals

A peripheral is a hardware device other than the processor and the memory. Peripherals can be basic digital I/O (also referred to as GPIO, general purpose I/O), or more complex things such as Timers, UART, SPI, Ethernet or CAN interfaces.