+1 500 000 products in offer
7000 packages per day
+300 000 clients from 150 countries
Date of publication: 17-01-2025 Update date: 10-04-2026 🕒 10 min read
A microcontroller is more than a processor - by definition, it is a circuit containing at least several parts. These include the components necessary to execute the programme itself, such as the memory or clock source. But in a microcontroller you will also find additional circuits, called peripherals.
In this article, we will try to explain in an accessible way what microcontroller peripherals are, as well as describe the functions of their most popular examples. It should be emphasised here that this text is primarily intended for amateurs who are just beginning their adventure with electronics. We will not go into the principle of operation of each peripheral here, as some of them are very complicated. For the moment let's focus on the basic concepts and technologies. Most of these will be encountered the first time you come into contact with a microcontroller or an Arduino module....
In this article, we answer the following questions:
When explaining the general idea of a microcontroller as a component, the analogy of a computer is often used. Because in fact a microcontroller is a compact computer constructed in the form of an integrated circuit. The block diagram below shows the generalised structure of the ATmega328 - a microcontroller that can be found at the heart of, among others, the Arduino Uno. It contains, among other things, components with names that we know very well from our desktop or laptop computers (e.g. CPU,FLASH and SRAM). But not only.
Block diagram of the ATmega328 microcontroller.
In the centre we have, of course, the processor (CPU, or in fact the arithmetic logic unit ALU with similar functionality), the operational memory (SRAM or a small, very fast Cache used to store frequently used data) and the program memory (a kind of hard disk, here made as a Flash structure). It is worth noting that we would not find these elements on a microprocessor schematic - which indicates to us the basic difference between these solutions. When designing a microcontroller, manufacturers try to achieve the furthest possible integration and versatility - so that a single chip has the functionality of a complex, practical circuit.
A few more elements of the circuit diagram can be explained by analogy with a computer: The EEPROM is also a type of memory, and the circuit also contains an oscillator that generates the clock signal used to clock the processor. Further on, things get a bit more complicated, as additional blocks have been connected to the main bus: UART, SPI, timer/counter (T/C) - just like mouse, printer or monitor are connected to the computer. These are the peripherals. In the past, their functions were implemented using separate integrated circuits or entire specialised circuits. The microcontroller incorporates them to make things easier for designers and manufacturers of electronic devices, but they are optional equipment.
As you can see in the diagram, some of the peripherals have external connections. But this is rare: most components communicate 'with the outside world' via ports, which are connected to the physical pins of the microcontroller. The ports (generally abbreviated as GPIO, or general-purpose input/output) can be programmatically (often automatically) configured to perform various functions (once the GPIO role has been configured by the program author and this configuration is stored in non-volatile memory, it is loaded on restart. In this way, the GPIO ports are prepared to perform their assigned functionality). A single pin can (for example) be used to control the LED, can be connected to a communication interface input or can serve as the output of a PWM generator.
The differences between commercially available microcontrollers are enormous: some are capable of operating as a network device on their own - others are designed with miniaturisation in mind and have only a few basic peripherals and (literally) a few leads. But **what peripherals are most commonly encountered and are, in fact, the default equipment of microcontrollers?
Analogue-to-digital converters are among the most common peripherals found in microcontrollers. They can also be purchased in stand-alone versions - in which case they usually feature higher accuracy and noise immunity, although these differences will nowadays only be felt in professional applications where very high precision is required. These circuits are also referred to by the abbreviation A/C or ADC (analogue-digital converter).
The function of an A/D converter is relatively simple: it represents an electrical voltage value in digital form, i.e. a number. It is, in other words, a digital voltmeter. Since (as we know from Ohm's law) voltage, current and resistance are related physical quantities, the ADC circuit also allows the collection of current and resistance data. Applications of such transducers include. reading analogue sensor readings, thermocouples etc. A familiar role for these circuits is to determine the battery charge level in battery-powered devices. ADCs are also based on the inputs of multimedia equipment, converting analogue signals into their digital representation. This is the case with scanners, cameras, camcorders and recorders, for example.
The basic parameter of a converter is its resolution, measured in bits, which is related to the number of comparators used in the circuit. If an 8-bit element is referred to, this means that it indicates values from 0 to 255 (i.e. 2^8), with 12 bits the accuracy increases to 4096, with 16 to 65536, and so on. Resolution refers to the division of the full scale ADC, the upper limit of which is determined by the reference voltage. In the microcontroller, this is provided by a separate peripheral or an external source is required (in AVR systems, a pin marked AREF is used for this). It is a voltage regulator with low current capability but high precision and stability. The measured voltage value must not exceed the value provided by the reference source - therefore, in practice, an optimally calibrated divider circuit is often connected to the input of the A/D converter.
From a software point of view, operation of the A/D converter is straightforward; in some environments, it is limited to taking the value from the analogue input. For example, Arduino modules distinguish the pins to which the transducers are connected by designating them with letter A, from "analogue ".
In more advanced systems, one encounters converters with the opposite effect, or DAC, digital-to-analogue. Also known by their English name DAC, encountered not only in the context of electronic components but also multimedia equipment. This is because peripherals of this kind serve to convert abstract numbers into their corresponding voltage value. It is thanks to these peripherals that digitally stored sound samples can be (literally) converted into sound waves by setting the speaker diaphragm in motion.
A DAC, like an ADC, has a resolution expressed in number of bits - the accuracy calculus here looks analogous to that described above. It should be noted here that the output of a DAC is typically characterised by low power, so in practice the outputs of peripherals of this type are most often connected to amplifiers.
The DAC is a circuit less commonly found in microcontrollers due to its narrower range of applications. Applications for such DACs are primarily multimedia solutions, but include: creation of digital potentiometers, calibration circuits, display control. They are also sometimes used to control motor operation, but only for components requiring voltage regulation. D/A converters are also an essential component of SDR systems, or software-controlled radio circuits.
*the counter and timer are theoretically separate peripherals, but are often used together to perform a specific task together. The timer is used to determine equal intervals of time, usually based on the microcontroller's clocking signal. The task of the counter - quite obviously - is to count pulses. It can be performed as an increment or decrement (counting up or down, starting from a preset value). The counter register has a limited capacity (given in bits in the product specification), and when it overflows (clears) an interrupt is generated - so you can write a program that records one pulses without having to constantly monitor the signal. This has two advantages: it relieves the load on the microcontroller kernel, and it also allows the microcontroller to work with high-frequency** signals. This method is very flexible as the output value of the counter is adjustable, so we can count down from any value between 1 and the maximum register capacity.
The pulses summed by the counter can be in the form of a rising or falling edge occurring on a physical chip pin, but can also come directly from a timer. In this case, the counter is used to count down longer periods of time. Remember that the microcontroller relies on a signal whose frequency is given in megahertz, and therefore with a period of tens or even a few nanoseconds.
Using the specifications of the ATmega328 chip mentioned above: a 16-bit counter (max value 65535) counting clock pulses (16MHz, i.e. occurring every 62.5 nanoseconds) would overflow after only 4 milliseconds.
Such a frequent occurrence of interrupts may be desirable, but not in a limited number of applications - which is why timers are additionally equipped with a prescaler circuit. The prescaler reduces the speed of the timer's input signal by dividing the pulse frequency by a certain number. Sticking with the example of the ATmega328 microcontroller: it uses a 10-bit prescaler to divide the clock signal frequencies by 8, 32, 64, 128, 256 or 1024. Using the latter, the timer will record one per 1024 pulses. Connected to such a scaled timer, the 16-bit counter can generate an interrupt at intervals as short as 4 seconds (62.5ns 1024 65535 ≈ 4.2s).
As you might guess, control over the number of pulses and timing intervals are some of the most important functionalities of electronic components:
In our series on electronics basics, we have devoted a separate article to the communication interfaces of microcontrollers. Therefore, here we will limit ourselves to the most general information. Communication with other electronic components/devices can take place using a hardware interface, i.e. a microcontroller peripheral, or a software interface. In the latter case, the software, at the expense of the CPU's processing power, controls every aspect of the data exchange, including the generation of clock signals, etc. In order to speed up the overall circuit, it is more optimal to use a circuit that takes on the burden of handling the bus and even (in some cases) the communication protocol. From a software point of view, transmission is then simplified as much as possible: it consists of entering data into the output buffer and retrieving it from the input buffer.
The use of buffers means that the microcontroller core does not need to be immediately involved in the communication process. Nevertheless: since in some applications a direct response to the received data is desirable, the circuitry of selected interfaces can generate a hardware interrupt when new values appear in the buffer.
The most common interfaces found in microcontrollers are those used to communicate with other ICs (drivers, controllers, multiplexers etc.), although some have wider applications. Among the most popular solutions are circuits supporting serial SPI and I2C buses. These are relatively high-bandwidth technologies, characterised by their ease of implementation (requiring only a few lines, they are supported in development environments by intuitive commands). Their overriding advantage remains their popularity: they allow a significant extension of the microcontroller's capabilities, connecting countless controllers, sensors, displays, multiplexers and many other circuits/modules to it. The same is true of the UART interface, which has been widely used in electronics for several decades, allowing easy conversion to the USB standard (using, for example, the FT232 chip), thus giving the circuit the ability to communicate with a computer. Such functionality is used to make diagnostic calls, service calls, microcontroller programme updates and many other applications.
The circuits described above are included in almost all microcontrollers. In fact, one could even venture the thesis that it is thanks to their implementation that microcontrollers are so popular today - they have given these circuits universal capabilities and reduced complex systems to a single 'chip'. But the development of microcontrollers continues to progress, making them adapted to the most modern applications, as well as convenient to use. A few more popular peripherals should therefore be highlighted here, as well as market trends that hint at what solutions will become common standards in the near future.
Missing from the previously posted list of popular interfaces is USB, a bus that is well known to the computer and consumer electronics industry. In fact, USB hardware support circuits are not often implemented in cheaper microcontrollers - mainly due to their complexity and high signal frequency, which entails costs. However, manufacturers are well aware that microcontrollers are the basis for a growing number of electronic accessories, IoT devices, home automation modules, as well as products aimed at the industrial automation market. This growing popularity is due, among other things, to the need to regularly update their software and security features (which would be impossible in designs based on simple circuits with a well-defined function). At the same time, users/operators/technicians increasingly expect the devices they use to support a USB interface (e.g. for convenient configuration using a laptop). Therefore, the USB controller is a peripheral increasingly found in microcontrollers, especially the more complex ones. They simplify circuits, eliminating the need to build hardware based on microprocessor systems.
Another practical choice that manufacturers are increasingly opting for is to include a real-time clock in the microcontroller. It allows the chip to have uninterrupted access to information about the current date and time. This has, of course, a number of practical applications (the construction of clocks, time controllers, etc.) - but it is also linked to the growing requirements of information security, based on time-barred access keys, tokens, certificates, etc.
While timers and counters can indeed be used to generate a PWM signal, in practice they have a number of other uses and using them for such a trivial function is suboptimal. For this reason, independent rectangular waveform generators are placed in many microcontrollers to function as independent peripherals. This makes it possible to control receivers (e.g. the brightness of a light source) with minimal use of the core: the commands to operate the generator are limited to its setting and activation instructions.
Watchdog Timer (WDT) circuits are not a novelty, but today they are actually a standard in the microcontroller industry. They are circuits used to reset the microcontroller in the event of a failure, e.g. getting stuck in an infinite program loop or with errors related to a temporary disruption of the power supply, clock signal, etc. The scope of the WTD is configurable, which is commonly included in development environments.
Finally, let's take a look at a few 'innovations' that are not yet default elements of microcontrollers, but have quickly gained a growing number of enthusiasts thanks to their undeniable advantages.
CIPs (Core Independent Peripherals) are peripherals that operate completely independent of the core, able to run without delaying the main program and also while the rest of the components in the chip are in sleep mode, leading to significant power savings. This optimises the circuit for use in battery-powered circuits, such as remote IoT sensors or mobile devices. Comparators, transducers, generators and a growing number of other peripherals are realised in the CIP form factor.
CLBs, or peripherals, have started to be implemented in selected Microchip microcontrollers for some time Configurable Logic Block. These are structures consisting of basic logic gates that can be freely combined/configured by the designer (identical to what happens in FPGAs). Such a peripheral can very quickly execute conditional instructions and other simple functions (e.g. switching between operating modes, switching the backlight on, etc.), and generate an interrupt to the microcontroller's main program only when necessary.
For more than a decade now, in AVR microcontrollers (but not only), one can encounter slots that allow to realise a tactile user interface. These can be, for example, buttons or sliders made in the form of conductive fields placed under the surface of the panel/housing. The microcontroller detects the interaction with these, using capacitive technology, i.e. the change in capacitance caused by the proximity of the body to the capacitive sensor (electrode). This solution virtually eliminates the need for electromechanical components and, because it is contained within the main control circuit, allows construction of devices with an extremely compact design.
Transfer Multisort Elektronik (TME) is one of the world’s largest global distributors of electronic components, electrotechnical parts, workshop equipment, and industrial automation. The catalog includes over 1,500,000 products from 1,300 leading manufacturers. TME’s modern logistics centers in Łódź and Rzgów (Poland), with a combined area of over 40,000 m², ship nearly 6,000 packages daily to customers in more than 150 countries.
TME also invests in the development of knowledge and skills of young engineers and electronics enthusiasts through the TME Education project, and supports the tech community by organizing the TechMasterEvent series, promoting innovation and experience exchange.