<<

4/5/2019 What Is a ? The Defining Characteristics and Architecture of a Common Component

What Is a Microcontroller? The Defining Characteristics and Architecture of a Common Component March 25, 2019 by Robert Keim (/author/robert-keim)

In this article we’ll look at the defining characteristics of these extremely popular ICs, and then we’ll explore the internal architecture.

If I had to choose one skill that would be the most valuable addition to any ’s repertoire, it would undoubtedly be proficiency in microcontroller-based circuit design.

The microcontroller has played a fundamental—I would even say dominant—role in the technological revolution that has shaped modern life. are small, versatile, inexpensive devices that can be successfully implemented and programmed not only by experienced electrical but also by hobbyists, students, and professionals from other disciplines.

The list of possible microcontroller applications is so long that I hesitate to even give examples. Low-cost wearables, medical equipment, high-end consumer , rugged industrial devices, state-of-the-art military and aerospace systems—these adaptable, affordable, user-friendly components are a welcome addition to just about any electronic product.

This arbitrary waveform generator (https://www.allaboutcircuits.com/projects/high-speed-waveform-generation-with-an- mcu-and-a-dac/) is one of many circuit boards that I have designed around an 8- microcontroller.

https://www.allaboutcircuits.com/technical-articles/what-is-a-microcontroller-introduction-component-characteristics-component/ 2/8 4/5/2019 What Is a Microcontroller? The Defining Characteristics and Architecture of a Common Component

In this article, we'll go over the definition of a microcontroller and consider what purpose it serves in a design.

What Is a Microcontroller? A microcontroller is an (IC) device used for controlling other portions of an electronic system, usually via a unit (MPU), memory, and some . These devices are optimized for embedded applications that require both processing functionality and agile, responsive interaction with digital, analog, or electromechanical components.

The most common way to refer to this category of integrated circuits is “microcontroller" but the abbreviation “MCU” is used interchangeably as it stands for “microcontroller unit”. You may also occasionally see “µC” (where the Greek letter mu replaces “micro”).

“Microcontroller” is a well-chosen name because it emphasizes defining characteristics of this product category. The prefix “micro” implies smallness and the term "" here implies an enhanced ability to perform control functions. As stated above, this functionality is the result of combining a digital and digital memory with additional hardware that is specifically designed to help the microcontroller interact with other components.

Microcontrollers vs. People will sometimes use the term “microprocessor” or "MPU" when referring to a microcontroller, but these two devices are not necessarily the same. Both microprocessors and microcontrollers function as small, highly integrated systems, but they may serve different purposes.

The term “processor” is used to identify a system that consists of a and (optionally) some memory; a microprocessor is a device that implements all of a processor’s functionality within a single integrated circuit. Microcontrollers, by comparison, place greater emphasis on additional hardware modules that allow the device to control a system rather than simply execute instructions and store .

The diagram below illustrates this concept.

https://www.allaboutcircuits.com/technical-articles/what-is-a-microcontroller-introduction-component-characteristics-component/ 3/8 4/5/2019 What Is a Microcontroller? The Defining Characteristics and Architecture of a Common Component

Overall, using the terms "microprocessor" and "microcontroller" interchangeably is not a major problem when we’re speaking informally or when we’re trying to avoid saying the same word over and over again. However, in the context of a technical discussion, it’s important to maintain the distinction between the two concepts.

Microcontrollers vs. Processors (DSPs) A digital processor (or "DSP") is a microprocessor that is optimized for demanding computational tasks such as digital filtering, mathematical analysis of real-time signals, and data compression. A highly sophisticated microcontroller may be able to function as a replacement for a , but it is still considered a microcontroller if a significant portion of its internal circuitry is intended to control, monitor, and communicate with the surrounding system.

https://www.allaboutcircuits.com/technical-articles/what-is-a-microcontroller-introduction-component-characteristics-component/ 4/8 4/5/2019 What Is a Microcontroller? The Defining Characteristics and Architecture of a Common Component

The Elements of a Microcontroller A microcontroller consists of a central processing unit (CPU), nonvolatile memory, volatile memory, peripherals, and support circuitry.

The Central Processing Unit The CPU performs arithmetic operations, manages data flow, and generates control signals in accordance with the sequence of instructions created by the . The extremely complex circuitry required for CPU functionality is not visible to the designer. In fact, thanks to integrated development environments (https://www.allaboutcircuits.com/technical- articles/what-are-integrated-development-environments/) and high-level languages such as (https://www.allaboutcircuits.com/technical-articles/introduction-to-the-c-programming- language-for-embedded-applications/), writing code for microcontrollers is often a fairly straightforward task.

Memory Nonvolatile memory is used to store the microcontroller’s program—i.e., the (often very long) list of -language instructions (https://www.allaboutcircuits.com/technical-articles/how- to-write-assembly--assembly-instructions-ARM-instruction-set/) that tell the CPU exactly what to do. You will typically see the word “Flash” (which refers to a specific form of nonvolatile data storage) instead of “nonvolatile memory.”

Volatile memory (i.e., RAM) is used for temporary data storage. This data is lost when the microcontroller loses power. Internal registers also provide temporary data storage, but we don’t think of these as a separate functional block because they are integrated into the CPU.

Peripherals We use the word “” to describe the hardware modules that help a microcontroller to interact with the external system. The following bullet points identify the various categories of peripherals and provide examples.

Data converters: analog-to-digital converter, digital-to-analog converter, reference- voltage generator

https://www.allaboutcircuits.com/technical-articles/what-is-a-microcontroller-introduction-component-characteristics-component/ 5/8 4/5/2019 What Is a Microcontroller? The Defining Characteristics and Architecture of a Common Component

This plot shows three-axis accelerometer data (https://www.allaboutcircuits.com/projects/gathering-and-analyzing-a- robots-accelerometer-data/) that I digitized using a microcontroller’s on- ADC.

Clock generation: internal oscillator (https://www.allaboutcircuits.com/technical- articles/choosing-the-right-oscillator-for-your-microcontroller/), crystal-drive circuitry, phase-locked loop (https://www.allaboutcircuits.com/technical-articles/what-exactly-is-a- phase-locked-loop-anyways/) Timing: general-purpose , real-time clock, external-event , pulse-with modulation (https://www.allaboutcircuits.com/technical-articles/turn-your-pwm-into-a- dac/) Analog signal processing: operational amplifier (https://www.allaboutcircuits.com/textbook/semiconductors/chpt-8/introduction- operational-amplifiers/), analog comparator /output: general-purpose digital input and output circuitry, parallel memory Serial : UART (https://www.allaboutcircuits.com/technical-articles/back- to-basics-the-universal-asynchronous-receiver-transmitter-uart/), SPI (https://www.allaboutcircuits.com/technical-articles/spi-serial-peripheral-interface/), I2C (https://www.allaboutcircuits.com/technical-articles/introduction-to-the-i2c-/), USB (https://www.allaboutcircuits.com/projects/communicating-with-an-efm8-microcontroller- via-/)

https://www.allaboutcircuits.com/technical-articles/what-is-a-microcontroller-introduction-component-characteristics-component/ 6/8 4/5/2019 What Is a Microcontroller? The Defining Characteristics and Architecture of a Common Component

My colleague Mark Hughes designed this subsystem (https://www.allaboutcircuits.com/projects/how-to-design- super-simple-sensor-system-PCB-industrial-applications/) around a 16-bit microcontroller.

Support Circuitry Microcontrollers incorporate a variety of functional blocks that cannot be classified as peripherals because their primary purpose is not to control, monitor, or communicate with external components. They are, nonetheless, very important—they support the internal operation of the device, simplify implementation, and improve the development .

Debug circuitry allows the designer to carefully monitor the microcontroller as it is executing instructions. This is an important, and sometimes indispensable, method of tracking down bugs and optimizing performance. are an extremely valuable aspect of microcontroller functionality. Interrupts are generated by external or internal hardware-based events, and they cause the processor to immediately respond to these events by executing a specific group of instructions.

https://www.allaboutcircuits.com/technical-articles/what-is-a-microcontroller-introduction-component-characteristics-component/ 7/8 4/5/2019 What Is a Microcontroller? The Defining Characteristics and Architecture of a Common Component

Microcontroller programs written in C are organized into functions (https://www.allaboutcircuits.com/technical- articles/introduction-to-functions-in-c-programming/). An causes program to “vector” to an interrupt service routine (ISR), and after the ISR has completed its tasks, the processor returns to the function that was executing when the interrupt occurred.

A clock-generation module can be considered a peripheral if it is intended to produce signals that will be used outside the chip, but in many cases the primary purpose of a microcontroller’s internal oscillator is to provide a for the CPU and peripherals. Internal oscillators often have low precision, but in applications that can tolerate this low precision, they are a convenient and effective way to simplify the design and save board space. Microcontrollers can incorporate various types of power-supply circuitry. Integrated voltage regulators allow for on-chip generation of required supply voltages, power- management modules can be used to significantly reduce the device’s current consumption during inactive states, and supervisor modules can place the processor in a stable reset state when the supply voltage is not high enough to ensure reliable operation.

Next Articles In this article, we defined a microcontroller as a device that consists of a small, efficient processor core combined with program memory, data memory, peripherals, and various forms of support and debug circuitry.

In the installment of this “Introduction to Microcontrollers” series, we'll go over how to choose the right microcontroller. We'll then move into how to read a microcontroller's datasheet.

If you have any topics that you would like to see covered in future articles, please let us know

https://www.allaboutcircuits.com/technical-articles/what-is-a-microcontroller-introduction-component-characteristics-component/ 8/8