Embedded Systems
An embedded system is an electronic device designed to perform a specific function. It typically consists of a microprocessor integrated with other discrete components, each selected to meet a particular functional requirement of the system.
Smaller embedded systems are often used to control specific aspects of larger, more complex systems. For example, the GPS unit in a car is an embedded system whose primary function is to provide navigation. It operates alongside other embedded systems in the vehicle, such as anti-lock brakes, climate control, and engine management.
Unlike general-purpose computers, embedded systems are not designed for user reconfiguration. While a PC can run various operating systems and applications, an embedded system runs software provided by the manufacturer, with limited or no ability for the end user to modify its behavior. Users may interact with the system through inputs, but the core functionality remains fixed.
Microprocessor Overview
In this course, we’ll focus on the microprocessor, the central component of an embedded system. A common question is: Which microprocessor should we use? The answer depends on the system’s design requirements, as there are thousands of microprocessors available.
We’ll use a type of microprocessor called a microcontroller (MCU). Microcontrollers come in 4-, 8-, 16-, and 32-bit architectures. Generally, the more bits in the architecture, the more computationally powerful the MCU. For instance, adding two 32-bit numbers on an 8-bit MCU requires multiple instructions, while a 32-bit MCU can perform the same operation in a single instruction. However, 8-bit MCUs are typically cheaper and consume less power, leading to a trade-off between performance and power efficiency.
Most MCUs are System-on-Chip (SoC) devices, meaning they integrate most of the necessary components—such as memory, timers, and communication interfaces—onto a single chip. This reduces the number of external components needed (e.g., capacitors, resistors, programming headers), lowering the bill of materials (BOM) and overall product cost.
Microcontrollers also include a variety of interfaces for communicating with other components or peripherals. These peripherals add functionality, such as accelerometers or Bluetooth modules. Communication is handled through interfaces like GPIO, UART, SPI, I²C, and CAN. MCUs may also include internal peripherals like analog-to-digital converters (ADC) and digital-to-analog converters (DAC).
Many embedded systems are battery-powered, so minimizing energy consumption is critical. Engineers carefully select low-power MCUs and design software that leverages low-power modes. With proper design, an MCU-based system can run for years on a single coin cell battery.
Another advantage of microcontrollers is their low cost—many capable MCUs are available for under $2.00.
Finally, microcontrollers require minimal software to be functional. Unlike high-end CPUs that need operating systems, file systems, and libraries, an MCU can perform useful tasks with fewer than 100 lines of code.
ARM Overview
We’ll be using an ARM-based MCU. Why ARM? Because ARM is the most widely used architecture in embedded systems today. It’s also relatively easy to learn, making it ideal for educational purposes.
ARM stands for Advanced RISC Machine. ARM Holdings designs processor cores and licenses them to partner companies, who then manufacture chips with custom peripherals and features. Some partners focus on low power, while others target specific applications like motor control. With over 1,000 partners and more than 30 billion processors sold, ARM cores are found in nearly every smartphone and tablet on the market.
ARM Cortex-M Architecture
The ARM Cortex-M family includes several MCU cores, primarily:
- Cortex-M0 – optimized for ultra-low power consumption.
- Cortex-M3 – offers more computational power for mid-range applications.
- Cortex-M4 – similar to the M3 but includes a floating-point unit (FPU) for efficient digital signal processing.
Key Features of Cortex-M Cores:
- RISC Architecture
- Load/Store Architecture
- Harvard Architecture
- Three-Stage Pipeline
- Thumb-2 Instruction Set
All Cortex-M cores provide 16 general-purpose registers. Data must be loaded into a register before it can be processed by the Arithmetic Logic Unit (ALU). The ALU modifies or examines the data and writes the result back to a register. If the data needs to be preserved, it is stored in SRAM. This behavior is characteristic of a Load/Store architecture.
In the coming weeks, we’ll explore how to write applications that interact with devices that are commonly found in embedded systems.