Microcontroller is a small computer on a single integrated circuit. It contains processor core, memory and input/output peripherals. Program memory (RAM, Flash, OTP ROM, EEPROM..) one or more can be embedded into microcontroller chip.
Microcontrollers are heart of most of embedded system that are surrounding us (remote controls, office machines, power tools, thermostats, toys..)
Depending on application of embedded system, microcontroller inside can be very sophisticated and minimal and power efficient on other side. Different application requirements for memory and program length will define a choice of “perfect MCU”
Microcontrollers MUST PROVIDE REAL TIME response to events. While working in some predictable loop MCU could miss some event happening which will cause system to fail. Interrupts make sure that everything is cached by signaling the processor to suspend processing the current instruction and to begin the interrupt service routine ISR. After ISR is performed, process will be returned into original instruction sequence. Interrupt resources varies from device to device and system to system and they often include: internal timer overflow, completing AD conversion, logical level change on input pin (external interrupt)…. Interrupts are also used to wake-up MCU from sleep (low power) states in battery powered applications
Processing speed of MCU can sound very low these days (ex 72MHz) but combining dedicated loops for specific operations and interrupts for ultra fast reactions makes system high performance processing unit for specific application
GPIO – General purpose inputs/outputs (also referred as digital I/O). Software programmable to be input (get sensor data) or output (drive external device). Implementing different schematic GPIO can drive simple LED or powerful drill
ADC – Analog to digital converter
Since not everything is 1 and 0 ADC are user to convert incoming, analog, signal into a form that the processor can recognize.
DAC – Digital to analog converter does just the opposite of ADC input as output. Digital data given by the processor are converted into analog signal at the output.
PWM – pulse width modulation gives MCU ability to control power converters, motors with minimal MCU resources used.
SPI, I2C, OneWire, UART… are common communication interfaces and they enable MCU to communicate with chips on the same board or externally with other devices