Microelectronics
20
Feb
2024

How a microcontroller works

In a microcontroller are:

An arithmetic-logic device (processor), which performs calculations and logical operations;
Memory (RAM)
Program memory (Flash), which is analogous to PC hard drive, it stores the program firmware;
Nonvolatile memory (EEPROM), where the program can store data that will not disappear when power is turned off. The program memory is also non-volatile but can not be used for storing program data during operation (in principle it is possible but not done due to limited number of write/erase cycles (10000 for AVR)).
The I/O ports which are used for communication with the “outside world”. If the PC ports are standardized and each have their own purpose, then they are just pins which can be configured programmatically depending on the wishes of the developer of the device on the MCU.
Other peripherals such as an analog-to-digital converter (actually measures the voltage value at the input, outputting the result in digital form), an analog comparator (compares analog signal voltages and outputs a value greater than / less than 1 or 0), timers that are used to measure time intervals, delays, and other functions.
Many MCUs also have UART (serial port), JTAG (protocol for debugging the program inside the controller), USB and other interfaces built in.

What Microcontrollers Purpose
And now let’s talk about the application area of the MC. You can’t think of anything here:

Use to replace complex logic circuits. If there is no requirement for speed, because still the program will calculate your logic function may introduce a delay much greater than a circuit built on elements of discrete logic (microcircuits series K155, K176 and similar).
One example is, for example, a circuit that implements a dynamic display on seven-segment LEDs.

The operation of sensors as well as drives and lighting control is done with a microcontroller C8051. And it, in turn, is connected to a PC, tablet or other device with a complete operating system.
Application in various robotic devices, including drones;
For example, the quadcopter is guided by the “Crius MultiWii SE” board, which is built on the AVR ATMEGA328P microcontroller. It processes signals from tilt angle, acceleration, pressure, magnetic field (compass) sensors, and allows for flight stabilization

Control units for household appliances (washing machine, food processors, microwave ovens, etc.), audio equipment (regulation from remote control e / y). are also often used as control devices in voltage stabilizers. For example, relay regulators are basically built on a microcontroller which, by measuring the voltage presented to the ADC input, draws a conclusion as to how the transformer windings should be turned on so that the output is about 220.

Various programmers and other devices, act as interface converters from the PC to other devices. For example, a K-Line adapter for diagnostics of injection engines.