Module 2
Components of an Embedded Systems
  Learning Objectives:
         At the end of this module, the student will be able to:
     1. Gain knowledge of different processors commonly used in embedded systems and their
        architecture.
     2. Differentiate memory technologies and memory types used in embedded systems
        development.
    3. Understand the different factors to be considered in the selection of memory for
       embedded systems development.
Learning Discussion
       You have already learned from the previous modules that embedded system is a
combination of software and hardware to perform one specific task and they are typically found
in various applications, such as consumer electronics, automotive systems, industrial machines,
medical devices, and more.
       The essential components of an embedded system include central processing unit (CPU)
or microcontroller, memory, input/output (1/0) Interfaces, peripherals, sensors and actuators,
and communication interfaces as shown in Figure 2.1.
                         FP'GAJASICJDSP/SoC
                         M lmtpl'W1"SMrl'11Glrolkr
                             ,.....-
                         ,         lppom
                                l n-.-r.)../
                                                                                          CamScanner
    ■    Central Processing Unit (CPU): The CPU is the core processing unit of the embedded
         system, responsible for executing instructions and managing the system's operation. It
         can be a microcontroller, microprocessor, or a specialized processing unit designed for
         embedded applications.
    •    Memory: Embedded systems typically have two types of memory:
           o Program Memory {ROM or Flash): This stores the firmware or software code that
               controls the system's operation.
           o Data Memory (RAM): Used for storing variables and temporary data during
                program execution.
•       Input/Output (1/0) Interfaces: These components allow the embedded system to
        communicate with the external world. Common 1/0 interfaces include digital and analog
        input/output pins, communication ports (e.g., UART, SPI, 12C), and interfaces for sensors
        and actuators.
•       Peripherals: Peripherals are additional hardware components integrated into the
        embedded system to perform specific functions. They can include timers, counters,
        analog-to-digital converters (ADCs), digital-to-analog converters (DACs), GPIO (General-
        Purpose Input/Output) pins, and more.
•       Sensors: Sensors are used to collect data from the environment. They can measure
        various parameters such as temperature, pressure, light, motion, and more, depending
        on the application.
•       Actuators: Actuators are components that perform actions based on the embedded
        system's instructions. Examples include motors, relays, solenoids, and LEDs.
•       Communication      Interfaces:   Embedded       systems     often   require   communication
        capabilities to exchange data with other systems or devices. This can involve wired
        interfaces like Ethernet or USB or wireless interfaces like Wi-Ff, Bluetooth, or cellular.
•       Software: This includes the application code and firmware that defines the behavior and
        functionality of the embedded system. Software is responsible for controlling the
        hardware, processing data, and making decisions based on input from sensors and user
        interactions.
                                                                                               CamScanner
     The specific components and their configurations In an mb dd d i; item d p        d n
system's Intended application, complexity, and resourc con tralnts. De fgn choic • are mad
based on factors like cost, power consumption, procesr;lng speed, and the requirern n 1 oft ,,,
task the embedded system is designed to perform.
2.1 Central Processing Unit (CPU)
       In the embedded systems, the central processing unit is the brain or the core of th,.
system responsible for executing instructions and managing the system's operation. 1t can be a
microprocessor, a microcontroller or specialized processor designed for embedded applicatiom.
       Types of Processors
         The processors employed in the manufacturing of the embedded system can be broadly
classified into three types. They are,
           •   Application-Specific System Processor (ASSP): This is an application-dependent
               system processor used for processing the signals involved in the embedded
               system. Therefore, for performing unique tasks the corresponding processor is
               required.
           •   Application-Specific Instruction Processor (ASIP): This is also an application-
               dependent, but instruction driven processor. This is used for processing various
               instructions set inside a combinational circuit of embedded systems.
          •    General Purpose Processor (GPP): GPP is used for proc.essing the signal from
               input to output by controlling the operation of the data bus, address bus, and
               system bus inside an embedded system. This GPP includes microcontrollers,
               microprocessors,.embedded processors, media, and digital signal processors.
       Microprocessor
        Basically, a microprocessor contains only a processing unit which is quite powerful in
terms of computing. To make use of a microprocessor, one needs extra hardware chips such as
memory (RAM), peripheral boards, system bus, etc. It means that microprocessors cannot be
used stand-alone. Processors inside a system consist of two essential units namely, a control unit
and an execution unit. Examples of microprocessors are the ARM Cortex-A series, Intel Pentium
series, etc.
                                                                                            CamScanner
       Example: Smart Refrigerator
        Smart refrigerators are a great illustration of how microprocessors are used in embedded
systems. These refrigerators incorporate various sensors, connectivity features, and a user
interface to enhance their functionality.
       Here's how a microprocessor is used in a smart refrigerator:
           •   Control and User Interface: The microprocessor serves as the brain of the smart
               refrigerator. It controls the cooling system, manages temperature settings, and
               monitors various sensors. It also handles the user interface, including the
               touchscreen or digital display on the refrigerator door, where users can set
               temperature, access recipes, and manage the refrigerator's features.
           •   Connectivity: Smart refrigerators often include Wi-Fi or Ethernet connectivity.
               The microprocessor manages network connections, allowing the refrigerator to
               connect to the internet. This connectivity enables features such as remote
               monitoring and controJ through a smartphone ap,p.
           •   Sensors: Smart refrigerators are equipped with various sensors, such as
               temperature sensors, humidity sensors, and RFID scanners. The microprocessor
               reads data from these sensors to maintain optimal temperature and humidity
               levels, and to track the contents of the refrigerator.
           •   Data Processing: The microprocessor processes the data received from sensors
               and makes decisions based on this information. For instance, it can adjust the
               cooling system to maintain the desired temperature, send alerts if the door is left
               open, or create a shopping list based on the items in the refrigerator.
           •   Energy Efficiency: Microprocessors in smart refrigerators are programmed to
               optimize energy consumption. They can adjust the cooling cycles based on usage
               patterns, saving energy when the refrigerator is not frequently accessed.
           •   Updates and Maintenance: Microprocessors enable firmware updates, ensuring
               that the refrigerator can receive new features and security updates overtime.
           •   Interaction with Other Smart Devices: Smart refrigerators often integrate with
               other smart home devices, such as voice assistants or home automation systems.
               The microprocessor facilitates communication with these devices.
 Mlcrocontroller
       Microcontrollers serve as the central processing unit in embedded systems, providing
 the necessary intelligence and control to perform tasks efficiently, reliably, and often in real
                                                                                              CamScanner
time. Unlike the microprocessor, a microcontroller contains the three major components In a
single chip: the processing unit, memory, and the 1/0 ports.
       Microcontrollers are responsible for controlling and coordinating the operation of
various hardware components, including sensors, actuators, and communication interfaces.
They make decisions based on input data and programmed logic, enabling the embedded
system to respond to its environment. Microcontrollers are widely used in embedded systems
where dedicated control and real-time processing are essential.
       Microcontroller families that have been commonly used i·n embedded systems are·:
             •    AVR microcontroller family, like the ATmega328P used in the Arduino Uno
             •    STM32 microcontrollers, based on the ARM Cortex-M cores, are popular for a
                  wide range of applications, including loT, industrial control, and automotive.
             •    PIC microcontrollers are widely used in industrial automation, automotive
                  systems, and consumer electronics.
             •    Broadcom BCM283X: While not strictly a microcontroller, Raspberry Pi single-
                  board computers are commonly used for embedded applications that require
                  more computational power and versatility.
      Some real-life examples of microcontrollers in embedded systems are listed below:
          •      Automotive Engine Control U.nits (ECUs): Modern vehicles contain multiple
                 microcontrollers within their ECUs. These microcontrollers are responsible for
                 managing engine performance, controlling fuel injection, handling emissions, and
                 monitoring various sensors to optimize the engine's operation and fuel efficiency.
         •       Home Automation Systems: Microcontrollers are found in devices like smart
                 thermostats, smart locks, and home security systems. They control and automate
                 tasks like temperature regulation, access control, and monitoring sensors for
                 detecting intruders or environmental changes.
         •       Wearable Health Devices: Fitness trackers and smartwatches often use
                 microcontrollers to collect and process data from sensors like heart rate
                 monitors, accelerometers, and gyroscopes. The microcontroller manages data
                 storage, wireless connectivity, and user interface.
         •       Digital Cameras: Digital cameras use microcontrollers to control image capture,
                 image processing, storage, and user interface functions. They handle tasks like
                 autofocus, exposure, image compression, and LCD display control.
         •       Industrial Control Systems: Microcontrollers are extensively used in industrial
                 automation. They control robotic systems, CNC machines, conveyor belts, and
                                                                                            CamScanner
               other manufacturing processes. These microcontrollers ensure precision and
               efficiency in industrial operations.
           •   Embedded Medical Devices: Medical devices, including infusion pumps,
               pacemakers, and blood glucose monitors, use microcontrollers to perform critical
               tasks related to patient care, such as administering medications, regulating heart
               rhythms, and monitoring vital signs.
           •   loT Devices: Internet of Things (loT) devices, such-as smart bulbs, smart switches,
               and environmental sensors, commonly employ microcontrollers to collect data,
               communicate with other devices, and enable remote control via the internet.
        The table below summarizes the comparison between the microprocessor and
microcontroller.
                 MIcroprocessor                               Microcontroller
    Microprocessors are designed for general-M icrocontrol lers are designed for
    purpose computing and are typically foundspecific control applications, and their
    in personal computers, servers, and otherprimary role is to control the operation
    systems where versatility      and high  of devices and systems. They are
    processing power are required.           commonly-used in embedded systems.
    Microprocessors are typically the main   Microcontrollers      integrate   on-chip
    processing unit in a system and require  components such as CPU, memory
    external components such as memory       (RAM and ROM/Flash), timers, GPIO
    (RAM and ROM/Flash), input/output        (General-Purpose .Input/Output) p.ins,
    peripherals, and external control circuits
                                             and communication interfaces on a
    to form a complete computer system.      single chip. This integration makes them
                                             suitable for embedded applications.
    Microprocessors are not optimized for Microcontrollers are well-suited for
    real-time operation. They are designed to real-time tasks. They can precisely
    handle a variety of tasks and may not be control devices and sensors with
    suitable for applications where precise minimal latency.
    timing and responsiveness are critical.
    Not Built for Real-Time Operation        Real-Time Operation
    more expensive due to their complexity   cost-effective because they include the
    and high processing power.               essential components         needed    for
                                                 control applications on a single chip.
                                                 This makes them suita·bte for cost-
                                                 sensitive embedded systems.
                                                                                           CamScanner
Digital Signal Processors (DSPs)
         Digital Signal Processors (DSPs) play a critical role in many embedded systems,
particularly in applications that require real-time signal processing and analysis. DSPs are
specialized microprocessors optimized for mathematical and numerical operations, making
them ideal for tasks involving digital signal manipulation.
        Here are some examples of how DSPs are used in embedded systems:
           •    Audio Processing: DSPs are commonly used in audio applications, such as
                smartphones, audio interfaces, and noise-canceling headphones. They can filter,
                equalize, compress, and enhance audio signals in real time, delivering high-
                quality sound.
            •   Speech and Voice Recognition: DSPs enable voice recognition and speech
                processing in applications like smart speakers, voice assistants, and automated
                call center systems. They can filter out noise, extract features, and recognize
                spoken words or commands.
           ■    Image and Video Processing: In embedded systems like cameras and video
                surveillance, DSPs handle tasks such as image enhancement, compression,
                motion detection, and facial recognition. DSPs can optimize image and video
                quality while minimizing processing time.
Commercial Off-The-Shelf (COTS)
        Commercial Off-The-Shelf (COTS) components are readily available, pre-designed, and
mass-produced components that are commonly used in embedded systems. These components
offer several advantages, including cost-effectiveness, reliability, and faster development times.
Programmable Logic Devices (PLDs)
        Programmable Logic Devices (PLDs) are commonly used in embedded systems to provide
hardware customization and accelerate development. PLDs, such as Field-Programmable Gate
Arrays .(FPGAs) and Complex Programmable Logic Devices (CPLDs), offer flexil?ility and versatility,
enabling designers to implement custom logic and interfaces tailored to their specific embedded
system requirements.
      PLDs allow engineers to design and implement custom logic circuits and functions that
are not achievable using off-the-shelf components. This is particularly useful when the
embedded system requires specialized, application-specific functions.
                                                                                            CamScanner
        PLDs are well-suited for real-time control applicsitions, s1.Jch as motor control and robotics.
 They can provide fast response times, making them valuable in systems that require precise timing.
        In embedded systems where board space and power consumption are critical, PLDs can
 replace multiple discrete components, such as logic gates and counters, with a single
 programmable device.
2.2 Memory
        Embedded systems use various types of memory to store and manage data, program
code, and configuration settings. The choice of memory type depends on factors such as speed,
cost, power consumption, and the specific requirements of the embedded system.
Types of Memory used in Embedded Systems
   •   Read-Only Memory (ROM)
           o Program Memory (Code Memory): Stores the firmware or program code that is
             permanently written during manufacturing. It is non-volatile and retains data
             even when power is removed.
          o Types of ROM include Mask ROM, OTP (One-Time-Programmable), and Flash
             ROM.
   ■   Random-Access Memory (RAM)
           o   Data Memory (Working Memory): Used for temporary data storage during
               program execution.
           o   RAM is volatile, meaning it loses data when power is removed.
           o   Types of RAM include SRAM (Static RAM) and DRAM (Dynamic RAM).
                                                                                                  CamScanner
        •
                         Non-Volatile Data Storage: Used to store configuration settings, calibration data,
                         and other data that must be retained even when the power Is off.
                         EEPROM is reprogrammable and allows data to be updated.
        •     Flash Memory
                    o    Data Storage and Code Execution: Used to store program code, application data,
                         and system updates.
                    o    Flash memory is non-volatile and Is often used for in-field firmware updates.
                    o    Types offlash memory include NOR flash and NAND flash.
        •    Cache Memory
                    o    Data Acceleration: A small, high-speed memory used to temporarily store
                         frequently accessed data.
                    o    It accelerates data retrieval and enhances the performance of the processor.
    •       External Storage Devices
                o       Hard Drives (HDD): Used in embedded systems when larger storage capacities
                        are required, such as in industrial applications and digital signage.
                o       Solid-State Drives (SSD): Faster and more reliable than HDDs, SSDs are used
                        when the embedded system needs both storage capacity and speed.
                o       SD Cards and MicroSD Cards: Used in applications where removable and
                        expandable storage is needed, such as in digital cameras and loT devices.
Memory Selection for Embedded Systems
       Selecting the right memory for an embedded system is a critical decision, as it affects
performance, power consumption, cost, and overall functionality. The memory selection
process should consider the specific requirements and constraints of the embedded system.
            Choosing the appropriate memory for your embedded system requires the following:
   1. Understand System Requirements
                o       Begin by thoroughly understanding the requirements of your embedded system.
                        Consider the following factors:
                          • Processing power: What is the required performance level of the system?
                                                                                                     CamScanner
                    •   Storage needs: How much program code and data storage Is necessary?
                    •   Data processing: Are there specific data processing requirements, such as
                        real-time processing or complex calculations?
                    •   Power constraints: Are there limitations on power consumption or battery
                        life?
                    •   Environmental factors: Will the system operate in extreme temperatures
                        or harsh conditions?
 2. Determine Memory Types
       •    Identify the types of memory required for your system.
       •    This may include program memory, data memory, non-volatile storage, and
            specialized memory for specific functions.
 3. Select the Right Memory Types
       •   Choose the appropriate memory types based on your system's needs.
       •   For example:
               o Use Flash memory for program storage and in-field firmware updates.
               o Utilize SRAM for fast, volatile data storage when high-speed access is critical.
               o Consider EEPROM or NAND flash for non-volatile data storage.
               o Employ external memory interfaces when the on-chip memory is insufficient
                  for the system's requirements.
4. Calculate Memory Size
           •   Determine the req.ui.re.d memory size by considering:
               o The size of the program code and firmware.
               o Data storage needs, including variables, configuration settings, and data logs.
               o The size of any external data files or assets used by the system.
               o Memory overhead for stack space, buffers, and memory-mapped registers.
5. Balance Cost and Performance
   •       Strike a balance between cost and performance.
   •       High-speed memory and larger capacities often come at a higher cost, so select
           memory sizes and types that provide the necessary functionality without
           overdesigning.
6. Power Management
           •   Optimize power consumption by selecting memory technologies that align with
               your system's power constraints.
                                                                                           CamScanner
              I
                  For example, low-power SRAM or power-efficient flash memory can be used to
                  conserve energy.
   7. Compatibility and Interoperability
          •       Ensure that the selected memory components are compatible with the rest of
                  the system and can Interface with the processor, peripheral devices, and
                  communication interfaces effectively.
References:
          ■       Shivu KV (2009). Introduction to Embedded Systems. Mc Graw Hill Education
                                                                                          CamScanner